Canonical message service
The canonical message service passes arbitrary messages (that is, user-specified data and native currency) between a LinethLineth (Formerly the Linea Stack) The open-source ZK-rollup stack, codebase, and technical protocol that's the foundation of Linea Mainnet. Operators can deploy this stack to launch their own Ethereum-compatible L2 or L3 networks. network and its
finalization layerFinalization layer The blockchain where a Lineth deployment submits proofs and state commitments for verification and hard finality. If the finalization layer is Ethereum (an L1), the deployment is an L2. If the finalization layer is Linea (an L2), the deployment is an L3.. It is general-purpose infrastructure: the canonical token bridge is built on it, and any contract or dapp can call it directly.
How it works
The service is a pair of message service contracts, one deployed on the network and one on the finalization layer. An optional offchain relay, the Postman, watches both contracts and submits claims when a delivery fee was paid. Sending a message from the origin chain to the destination chain works as follows:
- A caller invokes
sendMessage()on the origin contract with a destination address, a calldata payload, any native value to transfer, and an optional delivery fee. The contract emits the message. - A message commitment is anchored on the destination contract.
- Claiming the message executes it: the destination contract checks the claim against that commitment, then calls the destination address with the payload and the value.
Claiming is permissionless: anyone can submit the claim. This gives senders two delivery modes:
- Push: The sender pays a fee up front, and the Postman claims on their behalf, pushing the message to the recipient without them doing anything.
- Pull: No fee is paid, so the message sits unclaimed until the recipient, or anyone else, pulls it by submitting the claim and paying the gas.
Push relies on the Postman for convenience, not for correctness. The fee goes to whoever submits the claim, so if the Postman is unavailable, the recipient or a third party can claim the message and collect the fee instead.
Message commitments
Each direction commits to its messages differently, because only one of the two chains sits behind a proof.
Network to finalization layer. Finalizing a range of blocks verifies its
ZK proofZero-knowledge proof A cryptographic method that allows an individual to prove that a statement is true without conveying any additional information. This is useful for scaling blockchain networks through rollups, because it reduces the amount of information you have to provide to lower layers. and anchors the Merkle root of the messages those blocks sent. A claim on the finalization layer's message service carries a Merkle proof. The service accepts the claim only if the proof shows the message is included under that anchored root. Messages are therefore only claimable once the blocks that sent them are finalized.
Finalization layer to network. The coordinatorCoordinator Lineth's coordination module for batching, proof generation, and finality submission. The coordinator monitors block production, manages conflation deadlines, batches blocks, combines batches into blobs, orchestrates execution, compression, and aggregation proofs, and submits proofs and data to the finalization layer. anchors incoming message hashes on the network as a rolling hash. Those messages are claimable once anchored, without waiting for the next finalization. The next finalization checks the network's rolling hash against the hash the finalization layer's message service computed when the messages were sent. If the hashes differ, the network cannot finalize, because it would be finalizing messages the finalization layer never sent.
See also
- Configure Postman behavior using the Linea Postman options.
- See the messaging contract source code
and the Postman source code in the
lineth-monorepo.