Overview
Message bridging enables smart contracts on different chains to communicate and trigger execution across chains. A contract on the source chain callsbridgeMessage with encoded function data, and the bridge executes that data on the destination contract when the message is claimed.

Message Model
What Message Bridging Supports
- Contract-to-contract communication: Smart contracts can trigger function calls on other chains
- Cross-chain state updates: Contracts can update state on destination chains
- Trustless communication: Cryptographic verification of all cross-chain messages via Merkle proofs
Message Structure
Cross-chain messages contain:- Destination contract: Address of the contract to execute on the destination chain
- Function data: Encoded function call data
- Value: ETH value to send with the message (if any)
- Gas limit: Maximum gas for execution on the destination chain
- Metadata: Additional data for the message
Bridge Message Function
ThebridgeMessage function initiates message transfers between chains.
Function Signature
Parameters
destinationNetwork: Network ID of the destination chaindestinationAddress: Address of the contract to execute on destination chaingasLimit: Maximum gas for execution on destination chaindata: Encoded function call data
Process Steps
- Validation: Check destination network is not the source network
- Value Handling: Handle ETH value if provided
- Event Emission: Emit
BridgeEventwith message details - Tree Update: Add message to Local Exit Tree as leaf node
Example Usage
Claim Message Function
TheclaimMessage function claims and executes bridged messages on the destination chain.
Function Signature
Parameters
smtProofLocalExitRoot: Merkle proof for Local Exit RootsmtProofRollupExitRoot: Merkle proof for Rollup Exit RootglobalIndex: Global index identifying the messagemainnetExitRoot: Mainnet Exit Root at time of messagerollupExitRoot: Rollup Exit Root at time of messageoriginNetwork: Network ID of source chainoriginAddress: Address that sent the messagedestinationNetwork: Network ID of destination chaindestinationAddress: Address of the contract to executegasLimit: Maximum gas for executiondata: Encoded function call data
Process Steps
- Validation: Verify destination network matches current chain
- Proof Verification: Verify Merkle proofs against Global Exit Root
- Duplicate Check: Ensure message hasn’t been claimed before
- Message Execution: Execute the message on destination contract
- Claim Record: Mark message as claimed
Message Execution
- Messages can only be executed if the
destinationAddressis a smart contract that implements theIBridgeMessageReceiverinterface - If the receiving address is an EOA, the call will result as a success, meaning that the amount of ether will be transferred correctly, but the message will not trigger any execution
- If the native gas token is
ETH, then transferETHto thedestinationAddressand execute the message - If
ETHis not the native gas token, then mintWETHto thedestinationAddressand execute the message
IBridgeMessageReceiver Interface
For a contract to receive bridged messages, it must implement theIBridgeMessageReceiver interface:
originAddress: Address that sent the message on the source chainoriginNetwork: Network ID of the source chaindata: The message data/metadata sent from source chain