Overview
Chromia provides native bridging technology that transfers tokens (ERC20, ERC721) between Ethereum-based chains and the Chromia ecosystem. The bridging mechanism relies on an internal component called the Ethereum Interoperability Framework (EIF), designed to source data from EVM chains and submit transactions.
There are two types of bridges:
- Token Bridge: An implementation of the bridge that developers can customize to transfer tokens (ERC20, ERC721) to their dapps running on the Chromia network.
- Chromia Token Bridge: The official bridge that enables the transfer of the
CHR
ERC-20 token between EVM chains and the Chromia network.
Bridges are protected by having withdrawal proofs signed by Chromia nodes through block headers, resembling a multi-signature setup. If a majority of nodes get compromised, honest nodes can initiate a mass-exit, allowing users to retrieve their balances based on a prior state. This setup makes it difficult for attackers to gain control over the bridge's balance.
For demonstration purposes, consider the following infographic that highlights the EIF framework components and the token bridge:
- Token Bridge: Represents a smart contract running on the EVM chain. It carries the necessary business logic to process deposits to the Chromia network and the release of tokens. When users deposit tokens into the smart contract, the contract locks them and mints them on the dapp blockchain. During a withdrawal, the bridge burns the tokens, sends proof of the burn to the token bridge smart contract, and releases the tokens to the user’s address.
- Event Receiver Chain: An essential component of the EIF framework, which reads the Token Bridge smart contract state and writes events to block headers.
- Dapp #1-3: Any number of dapps can read events from the Event Receiver Chain using the ICMF protocol and handle them accordingly.
Chromia uses the following bridge mechanisms:
-
Lock and mint – Lock assets on the smart contract and mint assets on the destination chain(dapp).
-
Burn and release – Burn assets on the Chromia chain and release assets on the destination chain (EVM smart contract).
Lock and mint
- Deposit: Users deposit tokens (ERC20, ERC721) on an EVM-compatible chain, where they are locked in a smart contract on that chain.
- Monitor: The Event Receiver Chain monitors the deposit event on the EVM smart contract and writes this event to its ledger.
- Detect: Upon detecting the deposit event, dapp #2 creates, validates, and executes a transaction using a specific
Rell operation called
__evm_block
. - Mint: This transaction mints equivalent pegged tokens for the user on the Chromia chain.
When the user wishes to withdraw the pegged tokens from Chromia back to the original token on the EVM-compatible chain, the bridge follows the Burn and release mechanism.
Burn and release
- Burn: The user initiates the withdrawal by burning the token.
- Query proof: The user queries the proof of the withdrawal event.
- Request withdrawal: The user requests withdrawal by sending the withdrawal event data to the EVM smart contract.
- Release: The user claims tokens, and the smart contract releases them.