Skip to main content
Metalayer provides a secure message passing system built on a sovereign deployment of Hyperlane’s battle-tested technology, automatically deployed on every Caldera chain. This independent validator network is operated specifically for the Metalayer ecosystem. Messages can optionally include cross-chain state reads from an arbitrary number of chains, enabling real-time data access across the network.
Important: Developers must interact exclusively with Metalayer’s router contracts to ensure messages are correctly routed within our network, rather than referencing any public Hyperlane contracts that may exist on-chain.
Message Passing Infographic

Core Concepts

Chains

Each blockchain network is identified by a unique chain number in the Metalayer protocol. This chain identifier is used when specifying the destination chain for cross-chain messages.

Cross-Chain Operations

Metalayer Messaging supports two types of cross-chain operations:
  • Writes: Send messages and execute functions across chains
  • Reads: Query data from contracts on other chains

Message Components

  • Destination Domain: The target blockchain network
  • Recipient Address: The contract address that will receive the message
  • Read Operations: Optional queries to execute on other chains
  • Write Call Data: The function call to execute on the destination chain
  • Finality Flag: Whether to wait for source chain finality before relay

Configurable Finality

Messages in Metalayer support two finality modes, allowing developers to balance speed and security:

Soft Finality (Default)

  • ~10 second latency
  • Validators confirm sequencer commitment to include transaction
  • Optimal for most applications needing quick settlement
  • Trust assumption: Validators honestly report sequencer feed data

Finalized Mode

  • Requires batch submission to parent chain and finality on that chain
  • Provides protection against sequencer reorgs
  • Note: Optimistic rollups retain 7-day dispute window
  • Same validator trust model as soft finality, but with additional reorg protection
  • Recommended for high-value transfers or security-critical applications

System Architecture

Component Architecture

The diagram below shows the main components of the Metalayer system and how they interact: Component Architecture Infographic

Message Flow

The sequence diagram below illustrates the step-by-step process of sending a cross-chain message: Cross-Chain Messaging Infographic

Gas Abstraction

Metalayer handles cross-chain gas payments, allowing developers to pay for destination chain execution using the source chain’s native token. This simplifies the user experience by eliminating the need to hold gas tokens on multiple chains.

Security Features

Message Verification

  • Cryptographic Proofs: All messages verified through Hyperlane’s security model
  • Independent Validators: Sovereign validator set for enhanced security
  • Configurable Thresholds: Adjust security requirements per message type

Cross-Chain State Reads

  • Real-Time Data: Query contract state from multiple chains simultaneously
  • Atomic Operations: Read results are included in message delivery
  • Consistency Guarantees: Reads are executed at a consistent block height

Settlement Components

Core Contracts

  • MetalayerRouter: Main entry point for dispatching cross-chain messages
  • Inbox Contract: Logs fulfillment actions on destination chains
  • IntentSource: Registry for user intents and execution tracking on source chains
  • MetaProver: Service that generates cryptographic proofs of fulfillment

Settlement Flow

  1. Message Dispatch: Application calls MetalayerRouter to send cross-chain message
  2. Event Emission: Router emits message event picked up by validator network
  3. Cross-Chain Relay: Validators transport message to destination chain
  4. Execution Logging: Action logged in destination’s Inbox contract
  5. Proof Generation: MetaProver constructs proof of fulfillment message
  6. Settlement Verification: Proof sent back to source chain for final settlement

Future Evolution

As rollup stacks evolve to support stack-native interoperability (like Superchain or ZKSync native bridging), Metalayer will automatically upgrade to use these mechanisms. Applications specifying “finalized” mode will seamlessly benefit from improved security guarantees without any code changes. Finalized mode brings the future benefits of stack-native interop to developers today — without forcing devs to lock into a specific ecosystem.

Integration Examples

Basic Message Sending

import {IMetalayerRouter, ReadOperation} from "@metalayer/contracts/interfaces/IMetalayerRouter.sol";
import {FinalityState} from "@metalayer/contracts/lib/MetalayerMessage.sol";

IMetalayerRouter router = IMetalayerRouter(0x09Ce71C24ee2098e351c0cF2dC6431b414d247f3); // Apechain router
address receiver = 0x1234567890123456789012345678901234567890;
ReadOperation[] memory reads;
bytes memory callData = abi.encodeWithSignature(
  "settle(bytes32,address,uint256)",
  intentId,
  receiver,
  amount
);

uint256 fee = router.quoteDispatch(
  33139, // destination domain
  receiver,
  reads,
  callData,
  FinalityState.INSTANT,
  500_000 // destination gas limit
);

router.dispatch{value: fee}(
  33139,
  receiver,
  reads,
  callData,
  FinalityState.INSTANT,
  500_000
);

Cross-Chain Reads

address recipientContract = 0x9876543210987654321098765432109876543210;
ReadOperation[] memory reads = new ReadOperation[](2);
reads[0] = ReadOperation({
  domain: 1,
  target: 0x64FF4Fa53F2ae3f4dD0B3ad5A2ff2b0D6901b21f,
  callData: abi.encodeWithSignature("latestAnswer()")
});
reads[1] = ReadOperation({
  domain: 42161,
  target: 0xc778417E063141139Fce010982780140Aa0cD5Ab,
  callData: abi.encodeWithSignature("getReserves()")
});

uint256 fee = router.quoteDispatch(
  33139,
  recipientContract,
  reads,
  abi.encodeWithSignature("settle(bytes)" , readContext),
  FinalityState.FINALIZED,
  600_000
);

router.dispatch{value: fee}(
  33139,
  address(recipientContract),
  reads,
  abi.encodeWithSignature("settle(bytes)", readContext),
  FinalityState.FINALIZED,
  600_000
);
Reminder: Router addresses and domain IDs are listed in /metalayer/resources/contract-deployments. Always quote the fee before dispatching so the router call includes the correct gas payment.

Next Steps