ERC-7888 Cross-chain message broadcaster (Crosschain Broadcaster)
Draft · Other · created 2025-02-18
A standard in which storing a message in a Broadcaster on one chain lets a Receiver on any chain sharing a common ancestor chain verify a chain of state proofs to trustlessly read that message.
Why it is needed
As the number of rollup chains grows rapidly, user experience becomes increasingly fragmented, and there is no unified, trustless way to exchange messages between chains using different rollup stacks. Intent-based protocols lack a standard interface for sending settlement messages after fill, so each builds its own approach, raising the barrier to entry for fillers, integrators, and new protocols. Multichain apps deployed across several chains find it cumbersome to propagate a governance decision made on one chain to all instances, and multichain oracles also struggle to post data on one chain and easily consume it on others. Furthermore, since each rollup has a different state commitment scheme and storage layout, hardcoding verification logic risks breaking whenever a chain upgrades.
What to implement
event MessageBroadcast(bytes32 indexed message, address indexed publisher);: An event emitted when a message is broadcast, recording the message and the publisher's address.function broadcastMessage(bytes32 message) external;: The publisher broadcasts a 32-byte message. If the same publisher sends the same message again, it fails.function verifyTargetStateCommitment(bytes32 homeStateCommitment, bytes calldata input) external view returns (bytes32 targetStateCommitment);: Takes the home chain's state commitment and proof, verifies and returns the target chain's state commitment. Fails if called on the home chain.function getTargetStateCommitment(bytes calldata input) external view returns (bytes32 targetStateCommitment);: Reads state directly on the home chain to fetch the target chain's state commitment. Fails if called anywhere other than the home chain.function verifyStorageSlot(bytes32 targetStateCommitment, bytes calldata input) external view returns (address account, uint256 slot, bytes32 value);: Takes the target chain's state commitment and proof, verifies and returns a specific storage slot and its value on the target chain.function version() external pure returns (uint256);: Returns the version number of this StateProver implementation.function implementationCodeHash() external view returns (bytes32);: Returns the code hash of the latest StateProver implementation that the current pointer points to.function implementationAddress() external view returns (address);: Returns the home chain address of the latest StateProver implementation that the current pointer points to.function verifyBroadcastMessage(RemoteReadArgs calldata broadcasterReadArgs, bytes32 message, address publisher) external view returns (bytes32 broadcasterId, uint256 timestamp);: Takes a route and proof, verifies the message stored in a Broadcaster on a remote chain, and returns the Broadcaster's identifier and the timestamp at which the message was recorded.function updateStateProverCopy(RemoteReadArgs calldata scpPointerReadArgs, IStateProver scpCopy) external returns (bytes32 scpPointerId);: After confirming the StateProverPointer's code hash and version via proof, registers the locally deployed StateProver copy in the cache.function stateProverCopy(bytes32 scpPointerId) external view returns (IStateProver scpCopy);: Returns the address of the local StateProver copy corresponding to a given StateProverPointer ID. Returns 0 if no such pointer exists.
In depth
State commitment and chain compatibility requirements
A state commitment is a 32-byte hash representing a chain's state at a given point in time; a block hash (recommended), state root, or batch hash can be used. Which commitment is used depends on what the rollup actually commits to its parent chain. To be compatible with this protocol, a chain must store its finalized state commitment on the parent chain, must also store the parent chain's state commitment in the child chain's state, and must have L1 and EVM equivalence. EVM equivalence is required because the StateProver is deployed identically across multiple chains and must behave the same way on every chain.
Broadcaster message storage rules
The Broadcaster stores only 32-byte messages, and the caller is called the publisher. If the same publisher sends the same message again, it must fail; calling broadcastMessage must emit a MessageBroadcast event; and block.timestamp must be stored in the slot keccak(message, msg.sender). Additional delivery mechanisms, such as a child-parent native bridge, may also be used together. Allowing duplicate publishing would require a nonce scheme, but since not every publisher or subscriber needs this, it was left out of this standard and left to be implemented at the publisher/subscriber layer.
StateProver: one-directional cross-chain proof
A StateProver proves a one-directional link between two chains, a home chain and a target chain, that have direct access to each other's finalized state commitments. Because it is one-directional, each chain must have two StateProvers, one for child-to-parent and one for parent-to-child. The StateProver must have the same code hash on every chain it is deployed to. verifyTargetStateCommitment and verifyStorageSlot must be pure except for reading address(this).code, while getTargetStateCommitment can only be called on the home chain and may make external calls.
StateProverPointer: an upgradeable reference
Because a StateProver's verification logic is immutable and can break if the chain structure changes, a Route does not reference a StateProver directly but indirectly through a StateProverPointer. The Pointer must store the latest implementation's code hash in STATE_PROVER_POINTER_SLOT; when swapping the implementation, the new StateProver's home and target chains must match the previous ones and its version() must be higher, and an ImplementationAddressSet event must be emitted on the swap. This indirection means an in-progress message's route does not break even when a chain is upgraded.
Route and Remote Account ID
A Route is a path listing StateProverPointer addresses from the local chain to the remote chain. The home chain of route[0] must equal the local chain, and the target chain of route[i] must equal the home chain of route[i+1]. The Remote Account ID is a value obtained by accumulating the route's pointer addresses and the remote address with an accumulator (sequential keccak256) function; unlike a chain ID, it is guaranteed to be unique and is relative to the local chain. A single Remote Account ID points to only one storage slot, but the same slot can be identified by multiple Remote Account IDs.
Receiver's verification procedure and StateProverCopy
The Receiver takes RemoteReadArgs (route, scpInputs, proof) and verifies the remote Broadcaster's message via verifyBroadcastMessage. The proof must always be for a single storage slot; a proof covering multiple slots must fail. Because the StateProver pointed to by a StateProverPointer is identified only by its code hash, the Receiver can hold and run a local copy of that code (StateProverCopy). updateStateProverCopy checks that the submitted copy's code hash matches the hash stored in the pointer and that its version has increased, then registers it in mapping(bytes32 => IStateProver).
Why storage proofs were chosen, and the cost
Storage proofs are used instead of forwarding messages through a canonical bridge because intermediate chains along the route do not need gas tokens, storage slots share the same state root so caching provides implicit batching, and if the common ancestor is Ethereum, a canonical bridge would require an expensive L1 transaction. Each hop along the route needs a proof of about 6.5 thousand bytes, which, converted at the post-Pectra non-zero calldata rate, comes to up to roughly 260,000 L1 gas; this is a ceiling about twice that of a single canonical bridge message (roughly 150,000 gas), but in practice it rarely reaches this ceiling and is reduced further by caching.
Current status: Draft
This standard was written in February 2025 and its status is currently Draft. Draft is an early stage that has not yet gone through community review and consensus, so details such as the StateProver and Receiver interfaces, the Remote Account ID computation method, and caching policy may still change, be discussed further, or stall. Developers who want to build contracts based on this standard should check the latest version of the specification and the discussion thread.
Things to watch out for
- State commitment contamination from chain upgrades: If a chain upgrade causes a StateProver's verifyTargetStateCommitment or getTargetStateCommitment to return a value that is not the finalized state commitment, the Receiver risks reading an incorrect message. For example, if the slot that stored the state commitment is repurposed for another use, an old StateProver could pass an invalid commitment.
- Abuse of authority by the StateProverPointer owner: If a StateProverPointer owner maliciously switches the pointer to a tampered StateProver, messages can be forged; if they neglect to update it, messages may fail to reach their destination. For this reason, the pointer owner should generally be the same as the chain owner who manages that chain's state commitment slot, to avoid introducing additional risk.
- Limits of message delivery guarantees: This standard only guarantees that a remote message can be read, not that it will be read. It is the responsibility of whoever calls the Receiver to decide which message to read and when.
- Delay due to finality: Because this standard uses only finalized blocks, each chain along the route must finalize sequentially, which can take time for message propagation. The total latency is the sum of the finality times at each hop along the route.