Soroban-EVM Bridge
This document gives an extensive detail on the implementation of ZKLiquid's Soroban-EVM bridge. It discusses the technologies used and their functionality
Introduction
As Web3 applications and infrastructures continue to grow, with many innovative ideas being built on the blockchain, the need for interoperability between siloed blockchains has become more and more pressing. This is one of the most important problems that need to be solved, not just because of its necessity, but also because most existing interoperability solutions pose huge vulnerabilities. Just in 2022 alone, over $2 billion worth of crypto assets were hacked due to exploits on multi-chain bridges that relied on a centralized infrastructure, server/node for cross-chain data validation and transfer. These centralized solutions introduce a single point of failure, where exploiters target and tamper with data being sent across chains.
ZKLiquid Relay Network provides the crypto space with a secure, decentralized interoperability protocol that connects siloed blockchains in a secure way. Just as Chainlink’s Cross-Chain Interoperability Protocol (CCIP) serves the interoperability needs of EVM chains, ZKLiquid Relay Network provides a secure interoperability network that connects EVM chains to Soroban. The goal is to facilitate the secure and seamless flow of assets from EVM chains to Soroban/Stellar. ZKLiquid Relay Network supports the flow of assets in both directions, but we foresee a significant flow from EVM to Soroban.
The rest of this document focuses on a technical overview of the EVM-Soroban bridge components, these are the ZKLiquid Relay Network, the Bridge Liquidity Pool and Pool Balancer Protocol
ZKLiquid Relay Network
The main aspect of the Soroban-EVM bridge is ZKLiquid Relay Network. The relay network is a decentralized oracle network (DON), essentially a blockchain network that uses a proof of stake (PoS) consensus mechanism to validate and sync transaction/state data between Soroban and EVM chains facilitating secure interoperability between Soroban and EVM chains.
The ZKLiquid Relay Network is the core component of the Soroban-EVM bridge. It is a decentralized oracle network (DON), which functions as a blockchain network using a proof of stake (PoS) consensus mechanism. Its primary purpose is to validate and sync transaction/state data between Soroban and EVM chains, thereby facilitating secure interoperability between Soroban and EVM blockchains.
Relay Network Security
To ensure the secure and tamper-proof transfer of data between chains, the relay network implements several measures, leveraging its PoS consensus mechanism:
Decentralization and Validator Nodes: The network is secured by multiple node validators, with a minimum requirement of 20 nodes. This high number of validators ensures decentralization, significantly reducing the risk of a 51% attack.
Staking Requirements: Validator nodes are required to stake XLM tokens. The amount required to become a validator must exceed a specified minimum stake, ensuring that validators have a vested interest in the network's integrity.
Penalization via Stake Slashing: Nodes that misbehave or act maliciously are penalized through stake slashing. This means that a misbehaving node will lose a portion of its staked tokens as a penalty, deterring dishonest actions.
Random and Proportional Block Forging: To ensure security and fairness, the selection of the node (forger) that adds a new block to the network is both random and proportional to the amount of XLM staked. For example, if Node A has 100 XLM staked and Node B has 300 XLM staked, Node B has three times the chance of being selected as the forger compared to Node A. However, the selection process remains fundamentally random.
By implementing these security measures, the ZKLiquid Relay Network ensures robust, decentralized, and secure interoperability between the Soroban and EVM chains.
Functional Components of the Relay Network
After discussing the implementation of the PoS consensus mechanism used by the Relay Network, let's now give an overview of its functional components. The relay network comprises two decentralized Oracle Networks (DONs):
Data Transfer DON
The Data Transfer DON is a group of connected nodes responsible for validating and transferring data/states between the source and destination chains. This DON does not perform any state changes; it solely focuses on securely syncing important data between both chains.
Execution DON
The Execution DON consists of nodes responsible for executing transaction upkeeps based on the incoming data on the destination chain. For example, if 50 USDC tokens are sent from Ethereum to Soroban, the Data Transfer DON handles the transfer data, which includes the equivalent token address on Soroban (USDC on Soroban), the amount sent, and the recipient's address. Once the nodes reach finality on the data, the Execution DON updates the states on Soroban with the incoming data and performs the necessary upkeep.
By dividing responsibilities between the Data Transfer DON and the Execution DON, the relay network ensures efficient and secure data transfer and state updates across blockchain networks.
A high level architecture of the relay network connecting an EVM chain to Soroban is as follows:
How it works
When crypto assets are sent from an EVM chain (source) to Soroban (destination), the process of transferring the asset is as follows:
Asset Locking: The token sent is locked in the bridge liquidity pool on the source chain. This action ensures that the asset is securely held and cannot be double-spent during the transfer process.
Data Transmission and Validation: Validators within the decentralized Data Transmission Decentralized Oracle Network (DON) receive the data regarding the locked token. This network is responsible for securely transmitting and validating transaction data across chains.
Finality and Data Availability: After transaction finality is reached on the source chain, the transfer data—which includes the token address on the destination chain, the amount, and the recipient's address—is securely transmitted and made available to the destination chain. This ensures that the transaction details are accurate and immutable.
Execution and State Update: The execution process then updates the state of the bridge liquidity pool on the source chain to reflect the locked asset. The corresponding tokens are minted or unlocked on the destination chain and transferred to the recipient's address. This final step involves performing an upkeep operation to ensure the accurate and secure transfer of assets.
This decentralized and secure approach ensures that asset transfers are conducted without a single point of failure, enhancing the security and reliability of the cross-chain bridge.
Bridge Liquidity Pool:
The bridge liquidity pool is a crucial component of the Soroban-EVM bridge. It consists of liquidity pools on each connected chain, allowing users or community members to provide (add) bridge liquidity to earn rewards from the protocol fees. Liquidity providers can withdraw their provided liquidity, either partially or entirely, at any time.
For each Soroban-EVM lane implementation, a bridge liquidity pool smart contract will be deployed on each supported EVM chain as well as on Soroban. In this context, a "lane" refers to a pair of Soroban-EVM implementations.
Pool Balancer Protocol
The Pool Balancer Protocol is the final component of the liquidity protocol. This mechanism ensures that liquidity pools remain balanced across the network. It identifies out-of-balance pools and rewards 'return-to-threshold' transactions. These transactions involve removing liquidity from an over-balanced pool (above the target TVL) and adding it to an under-balanced pool (below the target TVL). The mechanism algorithmically determines the out-of-balance amount and calculates the reward users receive for participating in liquidity balancing.
Last updated