L1 and EVM
Token bridges and gateways
Token bridges build on L1 and EVM message passing to connect a token on its native domain to a wrapper on the other domain. A pair of contracts, called gateways, manages the tokens on each side. The escrow gateway holds the canonical tokens, while the mint gateway manages their wrapper.
The protocol provides default gateway pairs that handle this message passing and token accounting for L1-native and EVM-native ERC-20 tokens. These pairs can operate before a Core asset exists and are designed so that the existing bridge and wrapper can be linked to that asset later.
Choosing gateways
When launching a token or enabling transfers between L1 and EVM, consider whether you want the bridge and its wrapper to support future Core integration.
The default gateways provide a ready-made bridge with that compatibility built in. If you need more control over the bridge's behavior, you can implement a custom pair. To preserve the option of linking it to a Core asset later, follow the gateway requirements and external wrapper requirements in Token linking. Gateway selection can connect the pair to the Core asset after registration.
If you do not need future Core integration, you can still use the default gateways or build your own token bridge on the messaging infrastructure. A standalone L1–EVM bridge does not have to implement the interfaces required for Core integration and can define its own transfer rules and interfaces.
These compatibility requirements concern linking an existing bridge and wrapper to Core. Registering the canonical asset on Core is a separate process and does not itself require a gateway pair.
Transferring through the default gateways
The procedures below apply to the protocol's default gateways. Find their deployed addresses in Chain info. A custom bridge defines its own transfer interface.
The default gateways do not support fee-on-transfer or rebasing tokens. Their accounting assumes that the amount received matches the amount transferred and that escrowed balances do not change independently of transfers.
To find a token's wrapper address, call computeTokenAddress(canonicalToken) on the default mint gateway on the wrapper's domain. If the wrapper does not yet exist, it is deployed when the first incoming transfer is successfully delivered. An existing wrapper is reused.
Bridging L1-native tokens
Deposit (L1 to EVM)
Approve L1EscrowGateway to spend the canonical L1 token, then call sendTokens(...) on that gateway.
token
The canonical token address on L1.
to
Recipient on Lighter EVM.
amount
Amount in the token's smallest units on L1.
gasLimit
Gas limit for message execution on EVM.
refundAddress
L1 address that receives excess fees. Defaults to msg.sender when using sendTokens(...).
Supply the appropriate priority request fee as msg.value.
The gateway escrows the canonical tokens and sends a replayable message to EvmMintGateway. On successful delivery, the mint gateway mints the corresponding wrapped tokens to the recipient.
Withdraw (EVM to L1)
Approve EvmMintGateway to spend the wrapped token, then call sendTokens(...) on that gateway.
token
The wrapped token address on EVM.
to
Recipient on L1.
amount
Amount in the wrapped token's smallest units on EVM.
No ETH value is passed to this gateway call. The transaction still incurs EVM gas and the L1 data fee.
The gateway burns the wrapped tokens and creates an L1 call. After its batch has been executed on L1, follow the EVM-to-L1 execution flow to release the canonical tokens from L1EscrowGateway to the recipient.
Bridging EVM-native tokens
Deposit (EVM to L1)
Approve EvmEscrowGateway to spend the canonical EVM token, then call sendTokens(...) on that gateway.
token
The canonical token address on EVM.
to
Recipient on L1.
amount
Amount in the token's smallest units on EVM.
No ETH value is passed to this gateway call. The transaction still incurs EVM gas and the L1 data fee.
The gateway escrows the canonical tokens and creates an L1 call. After its batch has been executed on L1, follow the EVM-to-L1 execution flow to mint the corresponding wrapped tokens through L1MintGateway.
Withdraw (L1 to EVM)
Approve L1MintGateway to spend the wrapped token, then call sendTokens(...) on that gateway.
token
The wrapped token address on L1.
to
Recipient on EVM.
amount
Amount in the wrapped token's smallest units on L1.
gasLimit
Gas limit for message execution on EVM.
refundAddress
L1 address that receives excess fees. Defaults to msg.sender when using sendTokens(...).
Supply the appropriate priority request fee as msg.value.
The gateway burns the wrapped tokens and sends a replayable message to EvmEscrowGateway. On successful delivery, the escrow gateway releases the canonical tokens to the recipient.
Failed message handling
A successful source transaction does not guarantee delivery. If the destination call fails, the default gateways use the retry mechanisms provided by the messaging infrastructure.
L1 to EVM. Follow the replayable-message flow to retry delivery, increasing the gas limit if needed.
EVM to L1. Retry the L1 call execution using the same proof. A successful call cannot be executed again.
ETH transfers
ETH transfers use the messaging contracts directly and do not require token gateways.
ETH from L1 to EVM
The following TypeScript example sends ETH from L1 to an address on Lighter EVM using L1ReplayableMessenger.sendMessage, derives the corresponding L2 transaction hash, and waits for the L2 receipt.
ETH from EVM to L1
The following TypeScript example withdraws ETH from Lighter EVM to L1. It initiates the withdrawal on L2, waits for L1 finalization, fetches the Merkle proof from the node, then claims the withdrawal on L1.
Plain ETH transfers
EvmToL1Messenger also has a receive() fallback. Sending ETH to it with empty calldata is equivalent to initiateWithdrawal(msg.sender, ""): a withdrawal of msg.value to the same address on L1.
Last updated
Was this helpful?