Skip to main content

EVM bridge

Chromia provides a bridging mechanism called Ethereum Interoperability Framework (EIF) that allows transferring ERC-20 tokens between Ethereum-compatible networks and the Chromia ecosystem. The EIF itself represents a GTX (Generic Transaction Protocol) module that can be added to the dApp, extending its original functionality.

The EIF GTX module performs the following activities:

  • Reads events from the EVM, supports multiple EVM networks, multiple contracts, and multiple contract events.
  • Validates EVM events.
  • Adds EVM events to the postchain block using the special operation __evm_block.

The EIF framework can be divided into the following components:

  1. Token Bridge - acts as a vault that stores the received tokens. Once ERC-20 tokens are received, they get locked. Allows depositing and withdrawing tokens from the smart contract.
  2. Event Receiver Chain - represents a blockchain in the Chromia ecosystem that reads events of the Token Bridge and inserts it into Rell using the special operation __evm_block. The Event Receiver Chain provides the state information to Bridge Chain that is subscribed to different events.
  3. Bridge Chain - Reads EVM events from the EVM Event Receiver Chain via ICMF, or directly if the EVM Event Receiver Chain is embedded. Keeps track of ERC-20 tokens, bridges, accounts, deposits from EVM, and withdrawals to EVM. Allows obtaining a proof that unlocks tokens on the bridge once it is verified on the bridge side. Also supports snapshots for foreign tokens, such as tokens that are native to the EVM side.
  4. Dapps - An account in the dapp receives newly minted tokens on the bridge chain via the cross-chain transfer.

For a visual representation of the EIF framework and the token bridge, see the diagram below:

EIF Overview

Bridge types

A developer can choose between two bridge types, depending on where the token was initially minted:

  1. Token Bridge - is used when the token was initially issued on the EVM chain.
  2. Chromia Token Bridge - is used when the token was initially issued on the Chromia blockchain.

The Token Bridge is a basic bridge contract used for transferring ERC-20 tokens. When users deposit tokens into the token bridge, the contract locks them and the corresponding tokens are minted on the Chromia side. Upon withdrawal, the bridge burns the tokens on Chromia and unlocks or transfers them back to the user on the EVM side.

Bridges remain secure through withdrawal proofs signed by Chromia nodes via block headers, resembling a multi-signature setup. If malicious actors compromise a majority of nodes for EVM-originating tokens, honest nodes can initiate a mass exit, allowing users to recover their balances based on a previously known state. This design makes it difficult for attackers to manipulate the bridge’s balance.

Transfer mechanisms

Bridges operate in two modes, based on the source chain of the token transfer:

  1. Lock and mint: Lock tokens on the source chain and mint them on the destination chain.
  2. Burn and release: Burn tokens on the source chain and release them on the destination chain.

Lock and mint

EIF Deposit Process
  1. Deposit - On the EVM chain, users deposit tokens (ERC-20 or ERC-721) into the EMV Token Bridge contract.
  2. Event monitoring - The Event Receiver Chain detects the deposit event and inserts it into Chromia using the __evm_block operation.
  3. Processing - The bridge chain processes the event by decoding and validating the deposit.
  4. Mint - The bridge mints equivalent tokens on Chromia.

The burn and release process occurs when users want to transfer tokens back to an EVM-compatible chain.

Burn and release

EIF Withdrawal Process
  1. Burn - On Chromia, the user initiates a withdrawal by burning their tokens.
  2. Generate proof - The user queries and generates proof of the withdrawal.
  3. Withdrawal request - The user submits the proof to the Token Bridge contract to initiate withdrawal.
  4. Lockup period - The contract verifies the proof and starts a configured security lockup period.
  5. Fund release - After the lockup period expires, the bridge automatically releases the funds to the user’s address.