How does the CrossDomainMessenger carry Base messages?
What is the CrossDomainMessenger in OP Stack bridges? It relays calls between Ethereum and Base, using a portal for deposits and a proven withdrawal path.
The Coinvane Desk3 min read

After you send 1 ETH from Ethereum to Base, the CrossDomainMessenger pair carries the call between chains: the L1CrossDomainMessenger sends it through the OptimismPortal, and the L2CrossDomainMessenger relays it to the bridge on Base. The messengers add a way to identify the original sender, retry failed calls and give apps a common route for cross-chain messages.
For this deposit, the L1StandardBridge asks the L1CrossDomainMessenger to call its counterpart on Base. That messenger sends the message as a deposit through the OptimismPortal, Ethereum’s entry point for deposits to an OP Stack chain. On Base, the L2CrossDomainMessenger receives the message and calls the L2StandardBridge, which credits the ETH. The Base bridge is the user-facing service for moving supported assets between Ethereum and Base; this messenger path is the mechanism beneath a standard bridge transfer.
A deposit passes from the L1 messenger through the portal
The OptimismPortal carries an L1-to-L2 deposit to the L2CrossDomainMessenger. That L2 messenger is a predeploy at 0x4200000000000000000000000000000000000007. A predeploy is a contract at a fixed address on the OP Stack chain.
During relay, the receiving contract can check two identities. msg.sender should be the messenger contract on its chain, while xDomainMessageSender() should be the expected remote contract. For the ETH deposit, that remote sender should be the L1StandardBridge. The first check identifies the local messenger; the second confirms which contract sent the cross-chain message.
Take two otherwise identical calls to a receiving bridge contract. When the remote sender is its expected bridge, the contract can accept the call. Change only the remote sender, and the contract should reject it. Checking only msg.sender is unsafe: anyone able to call the messenger could otherwise make a message appear to come from an authorized remote contract.
A withdrawal needs proof and finalization before its relay
To withdraw, the L2StandardBridge asks the L2CrossDomainMessenger to send a message to the L1StandardBridge. The L2 messenger writes the withdrawal through L2ToL1MessagePasser, which records the message for proof on Ethereum.
The user must prove the withdrawal on L1, then wait out the seven-day challenge period before finalizing it. Finalization lets the OptimismPortal execute the withdrawal and call the L1CrossDomainMessenger, which relays the message to the L1StandardBridge. The bridge then handles the corresponding asset release. The delay is part of the withdrawal path; deposits use the portal’s deposit route instead.
A relay can fail if the target call reverts. The messenger records the failed message in failedMessages so it can be retried later; a failed relay does not by itself erase the message. This retry mechanism and xDomainMessageSender() apply to arbitrary cross-chain calls, not just token transfers. L1StandardBridge and L2StandardBridge are applications built on that shared messenger layer for ETH and ERC-20 transfers.
Related
What is the OptimismPortal?
It carries deposits from Ethereum to the OP Stack chain and executes finalized withdrawals back on L1.
What does L2ToL1MessagePasser do?
It records L2-to-L1 withdrawals so they can be proven and finalized on Ethereum.