> ## Documentation Index
> Fetch the complete documentation index at: https://docs.caldera.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Metalayer System Architecture

> Three-layer system enabling secure cross-chain interoperability via bridge aggregation

Metalayer is designed as a vertically-integrated interoperability stack that connects rollups through a three-layer architecture. Each layer serves a specific purpose in enabling seamless cross-chain interactions.

## Three-Layer System

### 1. Execution Layer

The top layer handles bridge requests and routing decisions:

* **Request Processing**: Parses user requirements and translates them into executable plans
* **Quote Aggregation**: Simultaneously queries multiple bridge providers and execution engines
* **Route Optimization**: Evaluates options based on cost, speed, security, and liquidity
* **Transaction Assembly**: Constructs ready-to-sign transactions with optimal routing
* **Status Tracking**: Monitors execution across all integrated providers

### 2. Bridge Provider Ecosystem

The middle layer consists of different types of bridge providers that fulfill cross-chain requests:

#### Intent-Based Networks

* **Eco Solver (Caldera)**: ETH and native token focused routes

#### Intent-Based Networks (External)

* **Across Protocol**: Independent intent-based protocol with UMA verification
* **Relay Protocol**: Independent cross-chain infrastructure with Solana support
* **Eco Solver (Eco)**: Stablecoin-focused routes

#### Native Bridges

* **Arbitrum Bridge**: Direct L2 canonical bridge integration
* **Optimism Bridge**: OP Stack canonical bridge access
* **Base Bridge**: Native L2 bridge integration
* **zkSync Bridge**: Zero-knowledge proof based bridge

#### Specialized Bridge Providers

* **MetaToken**: Caldera's omnichain token standard with hub-spoke architecture
* **OFT**: LayerZero's omnichain token standard
* **Future Integrations**: Expanding ecosystem of bridge technologies

### 3. Settlement Layer (Metalayer-Powered Routes only)

The bottom layer provides secure messaging and final settlement:

* **Hyperlane Integration**: Sovereign deployment of proven messaging technology
* **Custom Validators**: Independent validator set for enhanced security
* **Message Verification**: Cryptographic proofs ensure secure delivery
* **Cross-Chain Reads**: Query state from multiple chains atomically
* **Configurable Security**: Choose between fast finality and full finalization

## Data Flow

<img className="block" src="https://mintcdn.com/metalayer/5ZBnFuPUXwmobeeU/images/data-flow.png?fit=max&auto=format&n=5ZBnFuPUXwmobeeU&q=85&s=6b02711c2edf471aedbac76bcbc52356" alt="Data Flow Infographic" width="1280" height="1240" data-path="images/data-flow.png" />

## Component Interactions

### Bridge Request Flow

1. **User Submits Request**: Via SDK, widget, or direct API call
2. **Quote Aggregation**: System queries all available bridge providers
3. **Route Optimization**: Evaluates quotes by multiple criteria
4. **Execution Selection**: User or system selects optimal route
5. **Transaction Signing**: User signs constructed transaction
6. **Cross-Chain Execution**: Provider fulfills request on destination (via competitive solvers for intent-based routes, directly for native bridges)
7. **Settlement Verification**:
   * External intent protocols: Handle their own settlement
   * Metalayer-powered routes: Metalayer verifies and settles execution
   * Native bridges: Handle their own settlement

### Message Passing Flow (Metalayer-Powered Routes only)

1. **Message Dispatch**: Contract calls MetalayerRouter on source chain
2. **Event Emission**: Router emits cross-chain message event
3. **Validator Pickup**: Hyperlane validators detect and verify event
4. **Cross-Chain Relay**: Validators relay message to destination chain
5. **Delivery Execution**: Destination router executes message payload
6. **Confirmation**: Source chain receives confirmation of delivery

## Security Architecture

### Multi-Layer Security

* **Execution Layer**: Rate limiting, quote validation, route sanity checks
* **Provider Layer**: Liquidity commitments, reputation tracking, and route-level safeguards
* **Settlement Layer**: Cryptographic proofs, validator consensus, finality guarantees

### Configurable Trust Models

* **Fast Finality**: \~10 second latency with sequencer trust assumptions
* **Full Finalization**: Wait for L2 finality with maximum security
* **Custom Security**: Per-application security parameter configuration

### Economic Security

* **Provider Liquidity**: Intent-based providers deploy their own capital and maintain balances across chains
* **Validator Incentives**: Validators rewarded for honest behavior
* **Risk Controls**: Route-level limits and monitoring mitigate malicious actions

## Deployment Architecture

### Per-Chain Deployments

Each supported chain has consistent contract deployments:

* **MetalayerRouter**: Main entry point for cross-chain operations
* **Inbox Contracts**: Receive and process incoming messages
* **IntentSource**: Registry for user intents and execution tracking (for Metalayer-Powered intents)
* **MetaProver**: Generates proofs for intent fulfillment (for Metalayer-Powered intents)

### Shared Infrastructure

* **Aggregation API**: Centralized service for quote aggregation, event indexing, and status tracking
* **Eco Solver Networks**:
  * Caldera-operated solver for ETH and native token routes
  * Eco-operated solver for stablecoin-focused routes
* **Validator Network**: Independent Hyperlane validator set for secure message passing

## Scalability Design

### Horizontal Scaling

* **Provider Competition**: Multiple entities can fulfill the same route types
* **Chain Agnostic**: Add new chains without modifying existing deployments
* **Provider Integration**: Easy onboarding of new bridge providers

### Performance Optimization

* **Parallel Processing**: Simultaneous quote requests to all providers
* **Caching**: Intelligent caching of quotes and chain state
* **Routing Heuristics**: Preference scoring based on historical latency and fees (ML-driven routing is on the roadmap)

## Next Steps

<CardGroup cols={3}>
  <Card title="Intent System" icon="brain" href="/metalayer/how-it-works/intent-system">
    Learn about intent-based execution
  </Card>

  <Card title="Security & Economics" icon="shield-check" href="/metalayer/how-it-works/security">
    Security model and economic incentives
  </Card>

  <Card title="Message Passing" icon="message" href="/metalayer/how-it-works/message-passing">
    Understand the messaging layer
  </Card>
</CardGroup>
