What are crosschain bridges?
These are decentralized applications that allow you to transfer the same asset between different blockchains.
Crosschain bridges allow you to move tokens of different standards (ERC-20, BEP-20 and others) between blockchains. There are also cross-line bridges that allow you to transfer funds between blockchains built on different technologies (bitcoin, Ethereum, Litecoin, Dogecoin), as well as between second-level scaling solutions (Arbitrum, Optimism).
To make transfers between blockchains, wrapped assets can be created, liquidity pools in several ecosystems can be used. Also, the transfer of funds can be carried out by relay nodes that have liquidity in different blockchains.
To use a crosschain bridge, you need to connect to it using a Web3 wallet, such as MetaMask. After sending funds through a decentralized application, they will go to the sender’s address, but in a different blockchain. At the same time, the crosschain transfer operation is not significantly different from the swap within one blockchain using non-castodial exchanges.
Why are crosschain bridges difficult to implement?
An exchange operation between users, one of whom wants to buy asset A, and the other to sell it for asset B, in the absence of trust between them, requires the presence of a third party (guarantor). The guarantor will receive asset A from the seller, as well as funds from the buyer (asset B). After receiving funds from both users, the guarantor will transfer funds to each of them, completing the exchange operation.
Such an algorithm can be used for any exchange operations. The exchange can act as a guarantor. When exchanging assets within one blockchain, a smart contract can act as a guarantor.
The smart contract provides asynchronous blocking of each user’s funds, and after sending them, they are unlocked and the required assets are transferred to each user. Until recently, this method of exchange was not widespread, since it required the simultaneous presence of a seller and a buyer who are ready at the current time to exchange funds in the same amount.
In existing non-castodial exchanges, liquidity providers (LPs) are required to exchange funds. When performing exchange operations, the user’s funds enter the liquidity pool in one asset, in return the user receives funds in another asset. All these operations are carried out using smart contracts and do not require a guarantor.
But smart contracts can only be executed within one blockchain (e.g., Ethereum). If it is necessary to move assets to another ecosystem, such an algorithm will not work, since the smart contract does not allow you to interact with it.
Cross-line transfers require special algorithms that allow you to interact with several blockchains. Liquidity providers are also required in different systems. To implement these algorithms, second-level scaling solutions are widely used.
Smart contracts of L2-solutions allow you to get information from other ecosystems, including information about transactions conducted in the blockchains of Bitcoin, Ethereum, Binance Smart Chain (BSC) and others. They can also interact with external data, obtaining information from analytical Internet resources through oracles.
How to use wrapped tokens for cross-line transfers?
One solution to move assets between blockchains requires the use of wrapped tokens. Assets are moved using two paired operations: blocking coins – issuing wrapped coins and burning coins – unlocking coins,as well as combinations of these operations.
A similar approach is implemented in the Renproject. It is well suited for moving assets between different blockchains. Let’s take a closer look at the crosschain bridge between Bitcoin and Ethereum in the Ren project.
For cross-line transfer, the user sends BTC to a bitcoin address generated by a decentralized application, indicating his address in the Ethereum blockchain. The sent funds are blocked, and in return, the user receives wrapped Ethereum tokens renBTC. The latter are coins of the ERC-20 standard and are tied in value to the price of the underlying asset. They can be freely exchanged and transferred to any other user.
Any renBTC holder can get the underlying assets in the source blockchain (in this case, bitcoin) for them. To receive funds in BTC, the user needs to send renBTC to the address generated by the application. After that, the coins will be burned, and the user will be transferred funds to his address in the bitcoin blockchain.
Using wrapped assets to transfer stablecoins between EVM-compliant blockchains is not advisable due to the existence of more progressive solutions. The implementation of the usdC transfer from Ethereum to BSC by issuing renUSDC will not be in demand, since the USDC token already exists on this network.
How does a blockchain intermediary allow you to implement a crosschain bridge?
A promising way to transfer assets between different networks is the use of a specialized blockchain.
A similar mechanism is implemented in the THORChainproject, which uses the native RUNE token. The technology requires liquidity providers who deposit their funds into the pool and generate income from it.
The algorithm involves depositing funds into liquidity pools in two blockchains, one of which is THORChain. At the same time, most of the funds are deposited in RUNE tokens and act as collateral, and the other part is used to perform exchange operations. The project allows the exchange of assets from different blockchains, differing in value.
The exchange operation takes place in two stages using a decentralized application. First, an asset is exchanged from the source blockchain for the RUNE token, using funds from the first liquidity pool.
In the second stage, the RUNE token is exchanged for an asset in the destination blockchain, using a second pool of liquidity.
Let us consider in more detail the exchange of BTC for ETH. For this operation, two liquidity providers are needed, one of which provides BTC and RUNE, and the other – ETH and RUNE.
All operations are carried out through a decentralized application. After submitting an application for the transfer of funds by the user and specifying the address in the Ethereum destination blockchain, he needs to transfer BTC to the address specified by the application.
BTC go to the first liquidity provider, which transfers the corresponding value amount in RUNE to the second LP. The second liquidity provider, having received funds in RUNE, transfers ETH in the Ethereum blockchain to the address specified by the user.
These operations are carried out by liquidity providers in automatic mode, and the guarantee of the honesty of the LP is collateral funds that exceed the value of the funds used for exchange operations. The presence of two pools of liquidity allows you to exchange assets in the forward and reverse directions.
THORChain allows you to transfer stablecoins (USDT, USDC and others) between EVM-compatibleblockchains – Ethereum, BSC, Huobi ECO Chain (HECO), etc. There are no restrictions on the types of assets and blockchains between which exchange operations can be carried out. The only requirement is the availability of appropriate liquidity pools.
How is the transfer between EVM-compliant blockchains performed?
To transfer assets between EVM-compliant blockchains, it is advisable to use L2 solutions. Interacting with the main networks using smart contracts, they can provide a quick transfer of assets, as well as exchange between systems of both the first and second levels.
L2 solutions allow you to create a universal algorithm for transferring funds between blockchains. If there are liquidity providers in the source blockchain and destination blockchain, assets are transferred only between these systems, using the funds of the same liquidity provider.
In the absence of a single LP with assets in the source blockchain and the destination blockchain, one or more intermediate chains can be used. The blockchain of the first and second levels can act as an intermediary. In each of them, channels for the transfer of assets will be formed.
As a generalized example, consider the algorithm for transferring funds using an intermediate blockchain using the cBridge crosschain bridge from the Celer Network.
Node A is a user who owns funds in chain 1 who wishes to transfer these funds to node D in chain 3 (to transfer assets, the same user must be represented by address A in chain 1 and in chain 3 by address D).
In the absence of a liquidity provider with assets in chains 1 and 3, the decentralized application selects two relay nodes B and C. Relay node B owns the asset in chains 1 and 2 and is the liquidity provider when conducting exchange operations between these chains.
Relay node C similarly connects circuits 2 and 3. To implement cross-chain transfer, smart contracts are used, which unfold in three chains and form three asset transfer channels connecting nodes A, B, C and D.
Relay nodes B and C are liquidity providers and also provide routing of payments. They are rewarded for providing these services.
Unlike the traditional model of interaction with liquidity providers used on non-castodial exchanges, the funds provided by the relay nodes are not blocked for a long time. They will be blocked only during the exchange operation in the amount required for its implementation.
To implement this algorithm, cBridge uses smart contracts with a temporary blocking of funds – Hashed Time Lock. When making cross-line transfers, funds are transferred from the user to the liquidity provider using a smart contract that provides for the blocking of assets for a certain period of time. During this time, the relay node needs to transfer assets to the user in the destination blockchain.
If the node does not complete the transfer during this time, the blocked funds will be returned back to the user.
The Celer Network architecture is implemented using open source software, which allows anyone to create such a relay node. But the considered algorithm based on smart contracts provides protection to the user from losing money in the event that the relay node turns out to be malicious.
What crosschain bridges are there?
Following the rapid development of DeFi and non-castodial exchanges, decentralized applications that implement cross-line transfers began to appear. Most have a similar interface, but the algorithms of their work can differ significantly. The most popular crosschain bridges are:
- cBridge. A project specializing in an L2 solution using smart contracts for cross-line transfers. Provides the ability to move stablecoins, as well as a limited number of tokens based on Ethereum, BSC, HECO and other ecosystems, as well as between various second-level networks (Arbitrum, Polygon, etc.).
- Hop Exchange. This L2 solution uses smart contracts to transfer assets between second-level blockchains (Arbitrum, Polygon, etc.). Operations are carried out in stablecoins.
- xPollinate. Crosschain Bridge uses smart contracts to transfer stablecoins between BSC and second-tier solutions (Arbitrum, Polygon, etc.).
- THORChain. The project is a blockchain intermediary and 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 tokens of ERC-20, BEP-20 standards, including native coins, are also available for exchange.
- AnySwap. The project uses several cross-line translation technologies. Provides the ability to exchange a large number of tokens in the blockchains of Ethereum, BSC, HECO, OKExChain, as well as between various L2-solutions.
- Ren. The crosschain bridge allows you to transfer BTC, BCH, DOGE, ZEC and other assets from the relevant blockchains by creating wrapped tokens, as well as perform reverse transfers. Blockchains are for use: Ethereum, BSC, Polygon, Arbitrum and others.
How do I use the cBridge crosschain bridge?
Moving an asset between two blockchains is a lot like swapping within a single blockchain. Consider as an example the transfer of the USDC token from Arbitrum to Binance Smart Chain using cBridge.
In the case of swaps in one blockchain, you need to connect to the crosschain bridge using a Web3 wallet like MetaMask. After that, the selected blockchain and your address will appear in the upper right corner.
The interface that allows cross-line translation is quite simple. It is necessary to specify the blockchain source and the blockchain destination, as well as the asset itself.
In our case, we will choose Arbitrum as the source and Binance Smart Chain as the destination, the asset is USDC.
Before the exchange, it is necessary to make sure that there is enough liquidity to conduct the operation. The latter may be absent in some areas or it may not be enough.
After selecting the main parameters, enter the amount of the transfer (for example, 50 USDC). If the direction is active (there is a relay node for this direction) and there is enough liquidity for the transfer, you will see in the bottom window the amount to be received (49.6 USDC) and the commission (0.39 USDC). If all the parameters are fine, you can click Transfer.
The next step is to confirm the use of the USDC token from MetaMask. This step needs to be done only once, subsequent USDC transfers from Arbitrum will not require confirmation. Next, you need to send a request for cross-line translation.
The application will ask to confirm the interaction with the smart contract, for which a commission is charged. After confirmation in MetaMask, you need to wait for some time until the transaction is confirmed at the blockchain level.
After you send a translation request to the relay site, you must wait a while for the relay node to respond. After that, you need to transfer funds by clicking the appropriate button and confirming the operation in MetaMask.
After the funds are transferred, the relay node will send the assets to your account on the destination blockchain. When the exchange is complete, you will see information about the successful crosschain transfer.
It remains only to switch the blockchain in MetaMask to the destination blockchain and verify the account. You can find out the details of the transaction using the blockchain browser.
What are the prospects for crosschain bridges?
Current trends show that a scenario in which one of the blockchains will become dominant and supplant other solutions is unlikely. Despite the wide possibilities of Ethereum, L2 solutions are emerging that allow you to get significant advantages – high transaction speed, lower commissions, greater flexibility and functionality.
A number of ecosystems based on EVM-compatible blockchains (Binance Smart Chain, Huobi ECO Chain and others) are developing rapidly. The existence of many competing blockchains necessitates cross-line transfers.
In such operations, stablecoins are widely used. These assets exist on different blockchains, they are not subject to significant price fluctuations. In stablecoins, it is convenient to store the cost for a long time.
Due to the significant development of the DeFi sphere, crosschain bridges are becoming increasingly popular in comparison with conventional exchanges. Technologies are in demand on the market, there are more and more new projects, which indicates the prospects of this direction.