Skip to main content

Sign and Verify a Block Attestation

Bind a Block hash to an attester with EIP-712 typed data and verify the recovered signer. The same domain, type definition, and message must be available to both sides.

Before You Start

Prepare an EIP-712 signing library, a signer, a 32-byte Block hash, and the exact signing domain used by the integration. Dedicated Block-attestation helpers are not currently included in the JavaScript package.

How It Works

  1. Build the BlockAttestation message.
  2. Sign the typed data under the chosen domain.
  3. Reconstruct the same domain and message during verification.
  4. Recover the signer and compare the address with attester.

When to Use This Workflow

Use an attestation when an application needs a durable signature over a Block hash. Use replay-protected protocol requests for time-bound operations with nonce and expiry checks.

The message binds blockHash, attester, and timestamp.

BlockAttestation(
bytes32 blockHash,
address attester,
uint256 timestamp
)

Use a 32-byte Block hash, an Ethereum address, and an unsigned timestamp value.