Skip to main content

subscribeEmptyBlockAttestations

Subscribe to a real-time stream of attestations indicating that an Angstrom trading block will be empty (i.e., no Angstrom-sequenced trades will occur). These attestations are signed by the current Angstrom leader validator.

This stream is primarily for sophisticated traders or solvers who wish to swap against Angstrom's pool outside of the batch in its unlocked state. The data provided allows users to unlock the pool by passing the signature in hookData when calling the Uni V4 swap.

Subscribing to these attestations allows users to:

  • Gain immediate access to the pool once an empty block state is confirmed by the Angstrom network leader.

The leader validator will only emit an attestation once there certain that the batch for the current block will be empty. This typically occurs at the earliest of:

  • The leader having received all pre-proposals from other validators, and all are empty.n (For more context on consensus, see Consensus Mechanisms).

  • In the case the leader node is aware that a bundle is going to land, A update will go out with empty bytes to signify this attestion is not needed.

Params

This subscription method currently does not accept any filtering parameters. Subscribers will receive all empty block attestations emitted by the connected Angstrom node.

ParameterTypeDescription
paramsarrayAn empty array [] as no parameters are required.

Request

To subscribe, send a JSON-RPC request to the Angstrom WebSocket endpoint:

wscat -c ws://<ANGSTROM_URL>:<ANGSTROM_PORT>
> {"jsonrpc": "2.0", "id": 1, "method": "consensus_subscribeEmptyBlockAttestations", "params": []}

Response

When an empty block attestation is available, the leader node will push a notification message containing the attestation data.

{
"jsonrpc": "2.0",
"method": "consensus_subscribeEmptyBlockAttestations",
"params": {
"subscription": "SUBSCRIPTION_ID_EXAMPLE_XYZ789",
"result": {
"data": "0xValidatorAddressAsBytesConcatenatedWithSignatureAsBytes",
"block": 123234
}
// Example: "0x1122334455667788990011223344556677889900aabbccddeeff...(signature bytes)...ff"
//
// This 'result' is the complete byte string (hex encoded) to be used directly as 'hookData'.
// It internally consists of:
// - First 20 bytes: The Ethereum address of the attesting Angstrom validator (the 'node').
// - Remaining bytes: The signature from that validator.
//
// About the signature:
// This is an EIP-712 compliant signature. It attests that Angstrom operations
// for a specific block (the one current when the hook is called with this data,
// or for which this attestation is explicitly valid) will result in an empty batch.
// The specific message structure signed is 'AttestAngstromBlockEmpty(uint64 block_number)',
// which has a known type hash (0x3f25e551746414ff93f076a7dd83828ff53735b39366c74015637e004fcb0223).
//
// The on-chain `unlockWithEmptyAttestation` function (called by Angstrom's hook)
// will verify this signature using the current block number at the time of execution.
}
}

Using the Attestation Data

This data would be passed in as the hookData parameter when calling the Uni V4 swap function.