Skip to main content

Overview

Asset bridging enables the transfer of tokens and native assets between Agglayer-connected chains. The Unified Bridge handles different token types with distinct mechanisms depending on whether the token originates from the source chain or is a foreign token. Asset Bridging Process Figure 1: Complete asset bridging flow from L1 to L2

Supported Token Types

The Unified Bridge handles different token types with specific mechanisms:

Bridge Asset Function

The bridgeAsset function initiates asset transfers between chains.

Function Signature

Parameters

  • destinationNetwork: Network ID of the destination chain
  • destinationAddress: Address to receive assets on destination chain
  • amount: Amount of tokens to bridge
  • token: Token contract address (0x0 for native gas token)
  • forceUpdateGlobalExitRoot: Whether to update GER immediately
  • permitData: Raw permit data for ERC20 tokens (optional)

Process Steps

  1. Validation: Check destination network is not the source network
  2. Token Preparation: Handle token based on type (lock, burn, or transfer)
  3. Event Emission: Emit BridgeEvent with transaction details
  4. Tree Update: Add transaction to Local Exit Tree as leaf node

Token Preparation Logic

The bridge handles different token types with specific mechanisms based on their origin and nature:
Note that in case ETH is the native token, WETHToken will be at 0x0 address.

Native Gas Token (ETH, Custom Gas Token)

WETH Token

Foreign ERC20 Token (Not native to source chain)

Native ERC20 Token (Native to source chain)

Claim Asset Function

The claimAsset function claims bridged assets on the destination chain.

Function Signature

Parameters

  • smtProofLocalExitRoot: Merkle proof for Local Exit Root
  • smtProofRollupExitRoot: Merkle proof for Rollup Exit Root
  • globalIndex: Global index identifying the transaction
  • mainnetExitRoot: Mainnet Exit Root at time of transaction
  • rollupExitRoot: Rollup Exit Root at time of transaction
  • originNetwork: Network ID of source chain
  • originTokenAddress: Token address on source chain
  • destinationNetwork: Network ID of destination chain
  • destinationAddress: Address to receive assets
  • amount: Amount of tokens to claim
  • metadata: Additional metadata (if any)

Process Steps

  1. Validation: Verify destination network matches current chain
  2. Proof Verification: Verify Merkle proofs against Global Exit Root
  3. Duplicate Check: Ensure transaction hasn’t been claimed before
  4. Token Transfer: Transfer tokens based on token type (see Token Transfer Logic below)
  5. Claim Record: Mark transaction as claimed

Token Transfer Logic

Once the proof verification passes, the bridge claims tokens using different mechanisms based on the token type:

Proof Verification Logic

Bridging Flows

L1 to L2 Bridging

L2 to L1 Bridging

L2 to L2 Bridging