LX-to-LY Bridge

A smart contract enables asset transfers between two layers

The LX-to-LY bridge in Hyper Chain is a smart contract that connect two layers, thus enabling users to securely transfer assets between Layer 1 (L1) and Layer 2 (L2). It comprises two identical smart contracts, one deployed on each chain. The L1 Bridge Contract is deployed on the Ethereum mainnet and manages asset transfers between rollups. While the L2 Bridge Contract is deployed on a specific rollup and is responsible for asset transfers between the mainnet and the rollup(s).

By implementing LX-to-LY bridge, users are able enjoy the benefits of zkEVM, such as increased scalability and reduced gas fees, and can move assets seamlessly between the different L2 networks under high-level interoperability.

Bridge L1 Contract

Bridge L1 Contract is responsible for two operations, namely, "bridge" and "claim". The "bridge" operation enables asset transfer between rollups, while the "claim" operation allows the contract to claim assets from any rollup.

To perform these operations, the Bridge L1 Contract uses two Merkle trees: the "globalExitTree" and the "mainnet exit tree". The "globalExitTree" contains information about the exit trees of all rollups, while the "mainnet exit tree" contains information about the transactions made by users interacting with the mainnet. Additionally, a contract called the "global exit root manager L1" manages exit roots across multiple networks.

Bridge L2 Contract

Bridge L2 Contract is deployed on Layer 2 and it contains ether on its genesis block to facilitate the minting and burning of the native ether.

Similar to Bridge L1 Contract, it also requires the information of exit trees of all rollups that are contained in the "globalExitTree" Merkle tree. To manage the exit roots across multiple networks in this case, there is a smart contract named the global exit root manager L2.

While most bridge contracts only function as an L2-to-L1 bridge, Hyper Chain Bridge can serve as a bridge between any two arbitrary Layer 2 chains, or between any Layer 2 chains and the Ethereum blockchain. As a result, Hyper Chain Bridge stands out from typical bridge smart contracts as it offers more flexibility.

The LX-to-LY Bridge functions as shown in Figure 4 below.

Figure 4. How LX-to-LY Bridge works in Hyper Chain

Last updated