Ethereum reference implementation for ERC-7888: Crosschain Broadcaster. The standard defines a storage-proof based way to publish 32-byte messages on one chain and verify their existence on any other chain that shares a common ancestor.
- Broadcast:
Broadcasterstoresblock.timestampin slotkeccak(message, publisher), emitsMessageBroadcast, and prevents duplicates per publisher. - Prove:
Receiverwalks a user-specified route ofBlockHashProvercontracts to recover a finalized target block hash, proves a storage slot on a remoteBroadcaster, checks the slot is non-zero and matches the expected(message, publisher)slot, then returns the timestamp. - Upgrade safely:
BlockHashProverPointerholds the latest prover implementation address and code hash in a fixed slot (BLOCK_HASH_PROVER_POINTER_SLOT), enforcing monotonicversion()upgrades so routes stay stable while provers evolve. - Reusable proving code:
BlockHashProvercopies can be deployed on any chain; the pointer-stored code hash guarantees the copy matches the canonical implementation.
src/contracts/Broadcaster.sol: Minimal broadcaster with deduplication and timestamp storage.src/contracts/Receiver.sol: Verifies broadcast messages from remote chains using a route of block-hash provers and a final storage proof; can cache prover copies.src/contracts/BlockHashProverPointer.sol: Ownable pointer storing the current prover implementation address and code hash with version monotonicity checks.src/contracts/libraries/ProverUtils.sol: Shared helpers for verifying block headers and MPT proofs (state root, account data, storage slot).- Interfaces:
IBroadcaster,IReceiver,IBlockHashProver,IBlockHashProverPointer.
- Broadcaster: Singleton per chain that timestamps 32-byte messages in deterministic slots and emits
MessageBroadcast. - Receiver: Trustlessly reads a remote
Broadcasterslot by following a prover route, checking slot correctness, and returning(broadcasterId, timestamp). - BlockHashProver: Chain-specific verifier that proves a target block hash from a home chain state root and verifies arbitrary storage for that block.
- BlockHashProverPointer: Stable address that stores the prover implementation address and code hash in
BLOCK_HASH_PROVER_POINTER_SLOT, enforcing increasingversion(). - BlockHashProverCopy: Locally deployed prover contract whose
codehashmatches the pointer; used byReceiverwhen proving multi-hop routes. - Route: Ordered addresses of prover pointers from the destination back to the origin chain; hashed cumulatively in
Receiverto produce unique IDs.
- Publisher broadcasts on L2-A →
Broadcasterstores timestamp atkeccak(message, publisher). - On L2-B, caller gives
Receiver.verifyBroadcastMessage:- Route:
[L2-A→L1 pointer, L1→L2-B pointer] bhpInputs[0]: proof for L2-A block hash committed to L1bhpInputs[1]: proof for that L1 block hash committed to L2-BstorageProof: proof for the(message, publisher)slot on L2-A at the proven block hash
- Route:
Receiveruses a localBlockHashProverCopyfor hop 2 (code hash must match pointer), verifies each hop, checks the slot matcheskeccak(message, publisher), and returns(broadcasterId, timestamp).- Subscriber contracts compare
broadcasterIdagainst their allowlist and mark messages as consumed.
- A publisher calls
Broadcaster.broadcastMessage(message)on Chain A. The(message, publisher)slot now holds the timestamp. - To trustlessly read that message on Chain C, a caller provides
Receiver.verifyBroadcastMessagewith:route: addresses of theBlockHashProverPointerhop-by-hop path (e.g., child→L1 pointer, L1→dest pointer).bhpInputs: prover-specific inputs for each hop (built off-chain with the TS helpers).storageProof: a storage proof for theBroadcasterslot on the source chain at the proven block hash.
Receiveraccumulates the route to derive unique IDs, ensures the proven slot matcheskeccak(message, publisher), and returns(broadcasterId, timestamp).- Before verifying, callers can seed
Receiver.updateBlockHashProverCopywith a local prover copy whose code hash matches the pointer slot and whoseversion()increases.
src/contracts/– Solidity contracts and interfaces.src/ts/– Proof input builders used by the forthcoming SDK.docs/– Design notes, specs, and chain-specific proving guides.scripts/,broadcast/,artifacts/– Deployment/testing assets (Hardhat, Foundry).wagmi/– Generated ABIs for TS helpers.
- Install deps:
yarn install(ornpm install) - Build contracts, ABIs, TS:
yarn build - Tests:
yarn test - Clean:
yarn clean
- Deploy a
Broadcasteron each chain where messages originate. - Deploy a
BlockHashProverPointerper chain pair direction; point it to the canonicalBlockHashProverimplementation (must exposeversion()and stable code hash). - On destination chains, deploy
Receiverand register local prover copies viaupdateBlockHashProverCopyonce the pointer’s code hash is provably available. - Off-chain, use the TS helpers (or your own tooling) to:
- Find a route (e.g., L2→L1→L2),
- Build
bhpInputsper hop plus the finalstorageProof, - Call
Receiver.verifyBroadcastMessagewith(message, publisher); use the returnedbroadcasterIdto authorize the source broadcaster.
- ERC text: eip-7888
- Discussion: https://ethereum-magicians.org/t/new-erc-cross-chain-broadcaster/22927