Token bridging
Chromia provides bridging technology that enables seamless token (ERC-20) transfers between Ethereum-based chains and the Chromia ecosystem. This bridging mechanism leverages the Ethereum Interoperability Framework (EIF) to source data from EVM chains and facilitate transaction submissions.
Bridge customization
There are two types of bridges supported, depending on the origin of the token:
- If the token was initially issued on an EVM chain, use the token bridge.
- If the token was native to Chromia, use the Chromia token bridge (also known as the native bridge).
Chromia token bridge
This contract facilitates the transfer of tokens native to Chromia. It overrides the deposit and withdrawal functions by burning ERC20 tokens upon deposit and minting them upon withdrawal. This mechanism ensures that the total token supply is managed on the Chromia side, allowing users to withdraw FT4 tokens directly to EVM without holding tokens in the contract beforehand.
Token bridge
The token bridge is a basic bridge contract used for transferring ERC20 tokens. When users deposit tokens into the token bridge, the contract locks them and mints the corresponding tokens 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.
For a visual representation of the EIF framework and the token bridge, see the diagram below:
Token bridge components
-
EVM smart contract: This contract operates on the EVM chain and contains the essential business logic for processing deposits to the Chromia network and releasing tokens. When users deposit tokens into this smart contract, it locks them while the Chromia dapp chain mints the corresponding amount. During a withdrawal, the bridge burns the tokens, and once this process is complete, the user sends proof of the burn to the EVM smart contract to request a manual withdrawal of the funds.
-
Event Receiver Chain: Reads events (not contract state) from the EVM
TokenBridge
contract and inserts them into Rell using the special operation__evm_block
. -
Dapp #1-3: Any dapp chain on Chromia can access events from the Event Receiver Chain using the ICMF protocol and act on them accordingly.
Transfer mechanisms
Bridges facilitate two directional mechanisms, depending on the source chain from which the token is being transferred:
- Lock and mint: Lock tokens on the source chain and mint them on the destination chain.
- Burn and release: Burn tokens on the source chain and release them on the destination chain.
Lock and mint
- Deposit – On the EVM chain, users deposit tokens (ERC-20 or ERC-721) into the
TokenBridge
contract. - Event monitoring – The Event Receiver Chain detects the deposit event and inserts it into Chromia using the
__evm_block
operation. - Processing – The bridge chain processes the event by decoding and validating the deposit.
- 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
- Burn – On Chromia, the user initiates a withdrawal by burning their tokens.
- Generate proof – The user queries and generates proof of the withdrawal.
- Withdrawal request – The user submits the proof to the EVM token bridge contract to initiate withdrawal.
- Lockup period – The contract verifies the proof and starts a configured security lockup period.
- Fund release – After the lockup period expires, the bridge automatically releases the funds to the user’s address.