What are cross-chain bridges?

Sunflower Corporation
sunflowercorporation
11 min readJun 27, 2022

Decentralized applications that allow the transfer of the same asset across multiple blockchains. Do you want to learn more? Let’s go!

Cross-chain bridges allow tokens of various standards (ERC-20, BEP-20, and others) to be moved between blockchains. There are also cross-chain bridges that allow funds to be transferred between blockchains built on different technologies (Bitcoin, Ethereum, Litecoin, Dogecoin), as well as between Layer 2 scaling solutions (Arbitrum, Optimism).

Wrapped assets can be created to facilitate transfers between blockchains, and liquidity pools in multiple ecosystems can be used. Relay nodes with liquidity in different blockchains can also transfer funds.

To use a cross-chain bridge, you need to connect to it using a Web3 wallet, such as MetaMask. After sending funds through the decentralized application, they will arrive at the sender’s address, but on a different blockchain. A cross-chain transfer operation is not significantly different from a swap within the same blockchain using non-custodial exchanges.

Why are cross-chain bridges difficult to implement?

In the absence of user trust, an exchange transaction between two users, one of whom wants to buy asset A and the other wants to sell it for asset B, necessitates the involvement of a third party (guarantor). The seller will provide the guarantor with asset A and funds (asset B). After receiving funds from both users, the guarantor will transfer funds to each of them, thus completing the exchange transaction.

This algorithm can be used for any type of exchange operation. A transaction can act as a guarantee. A smart contract on the same blockchain can act as a guarantor for asset exchanges.

A smart contract blocks each user’s funds asynchronously and, once sent, unblocks them and transfers the required assets to each user. Until recently, this method of exchange was not widely used because it required the presence of a seller and a buyer who were both willing to exchange funds in the same amount at the same time.

Existing non-custodial exchanges require funds to be blocked by Liquidity Providers (LPs). When performing exchange transactions, the user’s funds are transferred into a liquidity pool in one asset, and the user receives funds in another asset in exchange. All of these transactions are carried out using smart contracts and do not necessitate the use of a guarantor.

However, smart contracts can only be executed on a single blockchain (e.g., Ethereum). Because a smart contract does not allow you to interact with it, such an algorithm will not work if you need to move assets to another ecosystem.

Cross-chain transfers require the use of special algorithms that enable interaction with multiple blockchains. It is also necessary to have liquidity providers in various systems. Layer 2 scaling solutions are commonly used to implement these algorithms.

L2-solution smart contracts enable information from other ecosystems, such as bitcoin, Ethereum, Binance Smart Chain (BSC), and other blockchains. They can also interact with external data by retrieving data from online analytics through Oracles.

How do you use wrapped tokens for cross-chain transfers?

Wrapped tokens are one method for moving assets between blockchains. Moving assets involves two paired operations: locking coins — issuing wrapped tokens and burning coins — unlocking coins, as well as combinations of these operations.

The Ren project follows a similar strategy. It is ideal for transferring assets between blockchains. Let’s take a closer look at Project Ren’s cross-chain bridge between bitcoin and Ethereum.

To initiate a cross-chain transfer, a user sends BTC to a bitcoin address generated by the decentralized application while specifying their Ethereum blockchain address. The funds sent are blocked, and the user is given wrapped Ethereum renBTC tokens in exchange. The latter are ERC-20 standard coins whose value is tied to the underlying asset’s price. They can be freely transferred and exchanged to any other user.

Any renBTC holder can obtain the underlying assets (in this case, bitcoin) from the blockchain source. The user must send renBTC to an address generated by the app to receive the funds in BTC. The user will then be transferred to his or her bitcoin blockchain address after a coin burn.

Due to the existence of more advanced solutions, using wrapped assets to transfer stabelcoins between EVM-compatible blockchains is not feasible. Because there is already a USDC token on this network, the implementation of transferring USDC from Ethereum to BSC by issuing renUSDC will not be in demand.

How does a blockchain intermediary enable the implementation of a cross-chain bridge?

A specialized blockchain is a promising way to transfer assets between networks.

A similar mechanism is used in the THORChain project, which employs the native RUNE token. The technology necessitates liquidity providers, who contribute funds to the pool and profit from it.

The algorithm entails putting money into liquidity pools on two blockchains, one of which is THORChain. The majority of the funds are deposited in RUNE tokens and used as collateral, while the remainder is used to conduct exchange transactions. The project enables the exchange of assets from different blockchains with varying values.

The exchange operation is carried out in two stages via a decentralized application. First, an asset from the source blockchain is converted to an RUNE token using funds from the first liquidity pool.

The RUNE token is then exchanged for an asset on the destination blockchain using the second liquidity pool in the second step.

Let’s take a closer look at the BTC to ETH conversion. This transaction necessitates the use of two liquidity providers, one of which provides BTC and RUNE and the other of which provides ETH and RUNE.

All transactions are processed by a decentralized application. After submitting a request for funds transfer and specifying an address in the Ethereum destination blockchain, the user must transfer BTC to the address specified by the app.

The first liquidity provider receives the BTC and transfers a corresponding amount in RUNE to the second LP. After receiving the funds in RUNE, the second liquidity provider transfers ETH in the Ethereum blockchain to the address specified by the user.

The liquidity providers perform these transactions automatically, and the LPs’ integrity is guaranteed by collateral that exceeds the value of the funds used for the exchange transactions. Because there are two liquidity pools, assets can be exchanged in both directions.

THORChain enables the exchange of stabelcoins (USDT, USDC, and others) between EVM-compatible blockchains such as Ethereum, BSC, Huobi ECO Chain (HECO), and others. There are no restrictions on the types of assets and blockchains that can be used in exchange transactions. The only prerequisite is the availability of suitable liquidity pools.

How are EVM compatible blockchains transferred?

L2 solutions are useful for asset transfers between EVM-enabled blockchains. They can enable fast asset transfers as well as exchanges between layer 1 and layer 2 systems by interacting with the underlying networks via smart contracts.

L2 solutions develop a universal algorithm for transferring funds between blockchains. When there are liquidity providers in both the source and destination blockchains, assets are transferred using the funds of a single liquidity provider.

If neither the source nor the destination blockchains have a single LP with assets, one or more intermediary chains can be used. Intermediaries can be provided by Layer 1 and Layer 2 blockchains. Asset transfer channels will be established in each of these.

Consider an intermediary blockchain transfer algorithm that employs Celer Network’s cBridge cross-chain bridge as an example.

Node A is a user who owns assets in chain 1 and wants to transfer those assets to node D in chain 3. (the same user must be represented by address A in chain 1 and address D in chain 3 to transfer assets).

If no liquidity provider with assets in chains 1 and 3 is found, the decentralized application chooses two relay nodes B and C. Relay node B owns an asset in chains 1 and 2 and serves as the liquidity provider for transactions between these chains.

Similarly, relay node C connects chains 2 and 3. Smart contracts are deployed in three chains to form three asset transfer channels linking nodes A, B, C, and D in order to implement cross-chain transfer.

Relay nodes B and C provide liquidity as well as payment routing. They are compensated for providing these services.

Unlike the traditional model of interaction with liquidity providers used in non-custodial exchanges, funds provided by relay nodes are not held for an extended period of time. They will only be blocked during the exchange transaction in the amount required to complete it.

cBridge uses smart contracts with temporary fund blocking — Hashed Time Lock — to implement this algorithm. Cross-chain transfers involve the transfer of funds from the user to the liquidity provider via a smart contract that locks assets for a set period of time. The relay node must transfer assets to the user in the destination blockchain during this time.

If the node does not complete the transfer during this time, the user’s blocked funds are returned.

The Celer Network architecture is built with open source software, so anyone can build a relay node. However, if the relay node is malicious, the smart contract algorithm discussed here protects the user from losing money.

What are cross-chain?

Following the rapid development of DeFi and non-custodial exchanges, decentralized applications that implement cross-chain transfers began to emerge. Most have a similar interface, but their algorithms may vary significantly. The most common cross-chain bridges are:

  • cBridge. A project focused on L2 solutions that use smart contracts for cross-chain transfers. Allows for the transfer of stabelcoins as well as a limited number of tokens based on the Ethereum, BSC, HECO, and other ecosystems, as well as between different second-tier networks (Arbitrum, Polygon, etc.).
  • Hop Exchange. This L2 solution employs smart contracts to transfer assets between second-tier blockchains (Arbitrum, Polygon, etc.). Transactions are carried out in stabelcoins.
  • xPollinate. The cross-chain bridge uses smart contracts to transfer stablecoins between BSC and second-tier solutions (Arbitrum, Polygon, etc.).
  • THORChain. The project is a blockchain intermediary that allows you to exchange BTC, LTC, BCH, and other assets. The exchange takes place between the respective blockchains, as well as Ethereum and Binance Chain. A large number of ERC-20 and BEP-20 tokens, as well as native coins, are also available for exchange.
  • AnySwap. Several cross-chain transfer technologies are used in this project. Allows for the exchange of a large number of tokens on the Ethereum, BSC, HECO, and OKExChain blockchains, as well as between different L2 solutions.
  • Ren. Cross-chain bridge allows you to transfer BTC, BCH, DOGE, ZEC and other assets from the respective blockchains by creating wrapped tokens, as well as performing reverse transfers. Destination blockchains: Ethereum, BSC, Polygon, Arbitrum and others.

How do you use cBridge’s cross-chain bridge?

Moving an asset between blockchains is similar to swapping assets within a single blockchain. As an example, consider the USDC token transfer from Arbitrum to Binance Smart Chain via cBridge.

For swaps within the same blockchain, you must use a Web3 wallet such as MetaMask to connect to the cross-chain bridge. The chosen blockchain and your address will then appear in the upper right corner.

The interface for making a cross-chain transfer is quite simple. You must specify the source and destination blockchains, as well as the asset itself.

In this case, we select BNB Chain as the source and Arbitrum as the destination, with USDT as the asset.

Source: Celer cBridge

Before the exchange, it is necessary to ensure that there is sufficient liquidity for the operation. In some areas, the latter may be absent or insufficient.

Enter the transfer amount after selecting the basic parameters (for example, 100 USDT). If the direction is active (there is a repeater node for it) and there is enough liquidity for the transfer, the amount to receive (93,8 USDT) and commission (6,1 USDT) will be displayed in the bottom window. If all parameters are acceptable, click Transfer.

The next step is to confirm the use of the USDN token from MetaMask. This step should only be performed once; subsequent USDT transfers from the BNB Chain will not require confirmation. Following that, a request for a cross-chain transfer must be sent.

Source: Celer cBridge

The app will ask you to confirm the interaction with the smart contract, for which you will be charged a fee. After confirming the transaction in MetaMask, you’ll have to wait for a while for the transaction to be confirmed at the blockchain level.

After submitting a transfer request to the relay node, you’ll have to wait for a while for the node to respond. Following that, you should transfer funds by pressing the appropriate button and confirming the transaction in MetaMask.

Source: Celer cBridge

After the funds are transferred, the relay node will send the assets to your destination blockchain account. When the exchange is completed, you will see information about the successful cross-chain transfer.

All that remains is to switch the blockchain in MetaMask to the destination blockchain and check the account. The blockchain browser can be used to view the transaction’s details.

What are the future prospects for cross-chain bridges?

Current trends indicate that it is unlikely that one blockchain will become dominant and displace other solutions. Despite Ethereum’s extensive capabilities, L2 solutions are emerging that provide significant benefits such as faster transaction speeds, lower fees, and greater flexibility and functionality.

A number of ecosystems based on EVM-enabled blockchains are rapidly emerging (Binance Smart Chain, Huobi ECO Chain, and others). Because there are so many competing blockchains, cross-chain transfers are required.

In such transactions, stablecoins are widely used. These assets exist on various blockchains and do not experience significant price fluctuations. Stablecoins are useful for storing value for extended periods of time.

Cross-chain bridges are becoming increasingly popular in comparison to traditional exchanges due to the significant development of the DeFi field. The technology is in high demand in the market, and more and more new projects are being launched, indicating the potential of this direction.

In terms to track the updates, subscribe to our Medium feed. Stay tuned!
You can also try your hand at working with cryptocurrency on our platform
Sunflower Corporation.

Take part in our tournament and challenge your trading skills! Don’t wait for the right time. Move on now! Click here.

--

--

Sunflower Corporation
sunflowercorporation

A deep liquidity ecosystem focused on crypto derivatives. We offer BTC/USDT perpetual futures with up to x100 leverage, as well as most trending instruments.