Author: Tommywong.eth, Chasey, 菠菜菠菜
01/ Why Cross-chain is Needed
02/ Five Stages of Cross-chain Development
03/ Three Main Operation Principles of Cross-chain Bridges
04/ Three Types of Verification Mechanisms
05/ Mainstream Analysis Dimensions of Cross-Chain Bridges
06/ Security Analysis of Cross-Chain Bridges
07/ Third Party Cross-Chain Bridge Representative Projects
08/ Hacking Incidents Analysis
09/ Summary and Outlook
The existence of cross-chain bridges is based on the core assumption of a future multi-chain ecological landscape under which the flow of assets and information across different blockchains facilitated by cross-chain bridges would be instrumental.
Due to the design of Ethereum Network, applications and protocols built on it inevitably compete for the underlying resources and restrict the performance of each other, resulting in high gas fees and the slow transaction speed. As Ethereum 2.0 still needs some time to complete development and launch, it allowed for a window for several “Ethereum killers” public chains, such as Avalanche and Solana, to attract funds/build up their ecosystem in 2021. While the multi-chain ecosystem’s taking off and sharing the pressure on Ethereum to some extent, it is actually also eroding its leadership.
Although the return of the relatively reasonable gas fees and transaction speed of Ethererum Network under the bear market has weakened the momentum of capital outflows, according to the July data from Defi Llama, which counted the market share of each public chain in terms of TVL lockups, Ethererum (in blue) dropped from 98% market share at the beginning of 2021 to 62% in July 2022. Although its market share rebounded from a low of 55% to 64% in May due to Terra’s meltdown, Ethereum’s market share is still gradually declining. In the short term, it seems that the multi-chain ecosystem is still an irreversible trend. Among all the chains, Tron is worth further attention as it was able to grab the market share in the bear market with the JustLend protocol.
In the medium to long term, where users flow to is closely linked to the overall quality of each blockchain ecosystem. Ultimately, users will vote with their capital to make the competition between chains relatively balanced. It is not simply the number of projects that determines the prosperity of the multi-chain ecology, but the users’ activeness and the sustainability of funding need to be considered comprehensively.
The Five Stages of Cross-chain Development
Composable Finance
Composable Finance proposes the five stages of the cross-chain interoperability development:
Atomic swaps
When User A has a cross-chain demand, the cross-chain bridge will match/seek another User B’s corresponding opposite need on the target chain, so that the two sides can have peer-to-peer matching and asset exchange through Hash Time Lock Contract (HTLC) with their funds‘ security guaranteed.
The following is an example of exchanging 1 BTC of User A with 20 ETH of User B. Specific steps are illustrated as below:
Pros:
Cons:
Lock + Mint / Burn
The cross-chain bridge locks the user’s assets in the original chain, mint/destroy an equal amount of composite tokens on the target chain and transfer them to/from the user’s account on the target chain, thus completing the cross-chain transfer. A typical example would be Wrapped Bitcoin(wBTC) on the Ethereum Network.
Pros:
Cons:
Liquidity pool
Cross-chain bridge deploys smart contracts of the source chain on the target chain and transfers the target chain into a side chain of the source chain to communicate information between the two sides. The project owner will establish liquidity pools on different chains, through which users can, on one hand, directly exchange the native assets of the other chains; and on the other hand, by providing liquidity for the tokens and becoming liquidity providers, they can also earn a portion of the cross-chain transfer fees or APY(The annual percentage yield) revenue.
Pros:
Cons:
Each blockchain has its own communication protocol, consensus rules, governance model, and native assets. The core of cross-chain lies in reaching consensus, allowing one blockchain to access the state of another blockchain, and to promote the flow of information and assets between blockchains. Nowadays, there are three main validation mechanisms, namely external verification, local verification, and native verification
External Verification
It relies on a single/multi-point external verifier(s) to reach consensus and sign off on the transaction.
The signing methods are typically multi-sig and multi-party computation (MPC). The multi-sig mechanism requires the verifiers to have a complete private key to sign the transaction. Multi-party computing eliminates the concept of a single private key and requires the verifiers jointly form a private key to complete the transaction verification.
To ensure the security of the users’ assets, some cross-chain bridges require a pledge from the verifier to run the node to provide services for transaction verification. There are two types of pledge models, insured and bonded, between which insured cross-chain bridges are more secure for users, as the funds pledged by the verifier will be compensated to the users if the node commits fraud. While for the bonded cross-chain bridge, for the same scenario, funds pledged by the verifier will only be destroyed, rendering less guarantee for the users’ fund.
External verification has security concerns, which requires users to have confidence in the project owner, and the external verifier not being evil. In June 2022, Harmony Horizon Bridge was hacked to steal \(100 million, primarily because the hackers stole the private keys of 2 of the multi-signature participants and used the stolen private keys to complete the signatures and create the transactions that withdrew \)100 million.
Local Verification
On the relevant blockchains, only the parties involved in the cross-chain behavior are involved in verification. Local verification turns the complex multi-party verification into two-party verification where both parties verify each other’s transactions.
Native Verification
The underlying verifiers of the target chain and the source chain are responsible for verification. The cross-chain bridge deploys a light node smart contract of the source chain on the target chain to transform the target chain into the side chain of the source chain and realize the information flow between both sides. The Relayer transmits the information from the source chain to the light client of the target chain, and the native validation node will verify the correctness of the information and trigger the corresponding smart contract.
The recently discussed Layer Zero projects introduced Ultra light node and Oracle on top of the native verification, in which the Oracle and Relayer work independently to improve the security and reduce the cost of the whole system.
When a user wants to send a message from blockchain A to blockchain B, the message is sent from the terminal of blockchain A, notifying the user program’s oracle (Block ID and the smart contract identifier of blockchain B), and the relayer (which notifies the full message). The oracle forwards the block header to the terminal of blockchain B. The relayer then submits the proof of transaction. After the proof of transaction is verified on the blockchain B, the message is forwarded to the destination address. The user finally acquires the native assets on the destination chain through the liquidity aggregator pool built by Stargate Finance.
Block headers are forwarded on demand by a decentralized oracle instead of being kept in whole to reduce costs.
The oracle and the relayer work independently, and the oracle uses an independent third-party provider, Chainlink, which increases the difficulty and cost of hacking it. Even if the oracle is hacked, there is still a relayer to verify it, which increases the security level.
In line with blockchains, cross-chain bridges are also limited by the classic “impossible triangle”: security, interoperability, and decentralization. The current cross-chain bridges make trade-offs in different performance dimensions to solve their respective user pain points. The current mainstream analysis of cross-chain bridges examines the below dimensions. The following definition is from Zonff Partners, Lewis.
Among the various dimensions, security is the most important. Cross-chain bridge security vulnerabilities have resulted in the theft of billions of dollars in assets, as detailed in Section 4 of this article. The main vulnerabilities lie in the smart contract, followed by the use of multi-signature technology when adopting external validation technology where hackers have access to more than half of the validation nodes and their private keys. The overall project owner needs to audit the smart contract and improve the technology to ensure the security of the smart contract.
The overall design of the cross-chain bridge has the following security ranking:
For example, Wormhole’s cross-chain bridge applies the approach of lock-in + mint/burn. Users’ locking of assets on the original chain is equivalent to collateralizing for the new on-chain wrapped asset, but if the original chain asset is stolen, then the user’s new on-chain wrapped asset may lose its value.
In addition, although Insured’s cross-chain bridge releases the funds pledged by the malicious verifier to the user as compensation, if the security of the cross-chain bridge is at risk, the pledged tokens, which generally are the bridge’s native tokens, would have a sharp drop in its price that still brings significant impact on the users.
In the actual cross-chain operation, it is better to choose a different cross-chain strategy according to the size of your capital. For large sum of capital, out of security concerns, it is advisable to exchange to the native assets of the corresponding chain on Binance or OKCoin exchanges, and then withdraw to swap on the target chain to the target coins.
For cross-chain needs with small capital volumes, consider a cross-chain bridge with lower Gas fees, faster speeds, and no previous risks for transactions. The cross-chain aggregator can assist users in filtering out the optimal cross-chain path at the minimal cost for service.
(Data are collected from Defi Llama in July 2022.)
Multichain
Introduction: The bridge is currently with the deepest liquidity pool of funds and the largest number of supported blockchains
Consensus mechanism: Multi-point external verification mode, verified by a multi-party computing system (MPC) with threshold signature
Cross-chain model: Non-target chain native tokens → source chain lock in, target chain mint/burn; native tokens → liquidity swap (liquidity pool deployed on multiple chains in V3 version)
Security: Need to fully trust the external verifier(s), currently 30+ nodes; no pledge mechanism introduced, medium-level security
Speed: <30min
Cost: Source Chain Gas fee +0.3% processing fee
Scalability: Scalable, currently supports 36 blockchains, can apply to the project owner for NFT cross-chain contract deployment
CBrigde
Introduction: CBridge 1.0 uses peer-to-peer transactions with atomic swap, which ensures security while causing gaps in liquidity, resulting in its poor scalability; after upgrading to 2.0, it switched to liquidity swap mode to improve scalability.
Consensus mechanism: Multi-point verification mode, verification conducted by nodes of the sidechain Celer State Guard Network (SGN)
Cross-chain model: Liquidity swap
Security: need to fully trust the verification nodes; SGN uses DPoS verification; currently relatively secure with a large number of pledges
Speed: <20min
Fees: Source chain Gas fee +0.04% processing fee; when the source chain is L2Rollup source chain, the processing fee is increased to 0.1%~0.5%
Scalability: Scalability becomes stronger after upgrade; currently supports 20 blockchains
Hop Protocol
Introduction: Sacrifices the asset security of liquidity providers, validation nodes and arbitrageurs to safeguard users’ assets; also allows users to pay more fees to incentivize several other roles.
Consensus Mechanism: Multi-point verification model is adopted, with whitelist node Bonder pledging assets and then participating in verification transactions.
Cross-chain model: Liquidity swap.
Security: Rollup technology is used, security depends on the underlying chain, no need to trust anyone, so it is safer.
Speed: min.
Cost: Gas on source and target chains + liquidity provider fees + 0.06% to 0.25% verification node fees
Connext Bridge
Introduction: Based on NXTP liquidity protocol, cross-chain smart contracts have been implemented.
Consensus Mechanism: Using multi-point verification mode, verification completed based on NXTP protocol.
Cross-chain model: Atomic swap
Security: peer-to-peer transactions, NXTP sets up an internal verification architecture, no need to trust anyone, extremely secure
Speed: <5min
Cost: Gas+0.05% processing fee
Scalability: NXTP protocol architecture is scalable, currently supports 16 blockchains and supports smart contract calls across chains
Stargate
Introduction: LayerZero-based bridge for liquidity sharing across blockchains.
Consensus mechanism: LayerZero ultra-light node native verification.
Cross-chain model: Liquidity pool
Security: Triple guarantee from setting up oracle, relayer and target chain UAis achieved, strong security.
Speed: min.
Cost: Gas+about 0.2% processing fee.
Scalability: according to the official description, scalability is strong, currently supports 7 blockchains, only supports stable coins.
Barter Bridge x MAP Protocol
Expected to launch in September 2022.
Introduction: Cross-chain bridge based on the underlying cross-chain infrastructure MAP Protocol
Consensus Mechanism: MAP Protocol Light Node + Relay Chain Native Verification
Cross-chain model: Liquidity pool
Security: Blockchain level security through light node smart contracts deployment on different chains
Speed: < 1min, depending on the block generation time of the target and source chains
Fee: Source Chain Gas + approx. 0.2% processing fee
Scalability: Can cover target chains that support smart contracts
Disadvantages: demanding development work in the early stage, requiring light node smart contract development based on the different structures of different chains
Source
Lee - Co-founder of Barter Network
MAP Protocol core developer
Note: The expected September launch of the underlying cross-chain infrastructure MAP Protocol’s cross-chain bridge focuses on solving the the core solution to the impossible triangle of the cross-chain bridges, if you want more details, please pay attention to BuidlerDAO research report updates.
Hacking Incident Analysis
Among the dimensions, security is the most important. Security vulnerabilities in cross-chain bridges have caused the theft of billions of dollars of assets. They mainly exist in smart contracts, followed by the ones when using the multi-signature technology for external verification where hackers manage to obtain more than half of the verification nodes and their private keys.
We will use the existent representative cross-bridge hacks as examples to analyze how hackers exploit contract vulnerabilities. Project owners need to conduct audits on smart contracts, improve their technology and risk control, as well as open source the contract code to ensure the security of smart contracts.
Poly Network
Time: 2021⁄8
Amount: $610m
Background:
Process: The hacker called the EthCrossChainData contract using EthCrossChainManager and used hash collisions to find the sighash (used to call the target function), replaced the private key with his own, and transferred the coins away from the contract.
The main problem: Poly Network has no mechanism in place to prevent calls to the EthCrossChainData contract.
Ronin Network
Time: March 2022
Amount: $600m
Background: There are 9 verified nodes in the Ronin chain
Process: Hackers controlled 5 nodes and transferred the locked ETH away from the vault
Main problem: 51% attack due to centralized management
Wormhole
Time: February 2022
Amount: $320m
Background:
Process: The hacker created a program with the same instruction set as Sysvar, to which load_instruction_at belongs, and used it to verify the signature, disguising himself as a system account, thus circumventing Guardians’ verification and minting ETH on the Ethereum Network.
Main problem: Failure to verify the validity of the load_instruction_at function in a timely manner
Harmony Horizon Bridge
Time: June 2022
Amount:$100m
Background
Process: Hackers stole the private keys of 2 of the multi-signature participants, created a transaction to withdraw $100 million, and completed the signature with the stolen private keys.
Main problem: 51% attack due to centralized management
Chainswap
Time: July 2021
Amount: $8m
Process: The hacker uses the _receive function to transfer the tokens to his own address and signs it with the generated extra signature.
Main problem: The contract regarding the number of signatures of nodes is not properly initialized and there is no mechanism to check the validity of signatures.
Multichain
Time: July 2021
Amount: $7.8m
Background
Process: The hackers found that AnySwap Multichain Router V3 has two transactions with the same R-value signature under the MPC account on the BSC chain. They then derived the private key of the MPC account reversely.
Main problem: Vulnerability in the design of MPC
Meter Bridge
Time: February 2022
Amount:$4.3m
Background
Process: The hacker retrieved the underlying deposit function of ETH20, filled in the calldata with a number that did not match the value of the cryptocurrency and sent it to the deposit function
Main problem: Lack of validation of the calldata
Summary
Overall at this stage, the cross-chain bridge needs to be further improved due to potential security issues, so that users will be able to have more confidence about the security of their assets when using cross-chain bridges. From the users’ point of view, in addition to security, they also need smoother cross-chain experience, including one-click cross-chain, convenient cross-chain speed, direct native assets swaps, etc. Multi-chain ecology is an irreversible trend for in the future; with cross-chain bridges as the underlying fundamental infrastructure of it, we look forward to the further development of the cross-chain bridges.
Outlook
If solely focusing on providing cross-chain asset swaps, cross-chain bridges projects will likely have a low ceiling. Seeing from the current competition landscape, few of the top 100 projects are only doing cross-chain bridges. It is important for cross-chain bridges to expand its future boundary into spaces such as information cross-chain and NFT cross-chain.
Liquidity pool will become the main asset cross-chain approach for cross-chain bridges. Deploying liquidity pools on each blockchain to provide common assets of the target chain bypasses the lock-in minting mechanism and improves cross-chain speed while mitigating the impact of poor liquidity of the wrapped assets.
Other services be embedded in cross-chain bridges, such as cross-chain + Defi, to improve capital utilization. For example, Aave has proposed a cross-chain + lending solution in V3, and Li.Finance is also implementing a cross-chain + trading solution. Furthermore, cross-chain + NFTfi sends NBA TopShot (NFTs) from the Flow Network to Ethereum’s NFT borrowing marketplace for collateralized loans.
A single application deploys its different parts on multiple chains, so that each part runs on the most efficient chain. The back-end packages of these different chains will communicate with each other to ensure continuity of user experience. Application such as Gamefi, embed cross-chain functionality into the GameFi to allow senselessly smooth user triage and optimize user experience when traffic is heavy/ congestion occurs.
This article is not related to institutional interests and has no investment advice.
Reference
https://www.panewslab.com/zh_hk/articledetails/q03nee18.html
https://www.defidaonews.com/article/6754150
https://zhuanlan.zhihu.com/p/409342805
https://blog.dodoex.io/ 跨链漫谈 - 深度解析 16 个跨链方案权衡 -a4e98d248eb2
https://mp.weixin.qq.com/s/8_KVHvupPKlhnjPFOYUhYg
https://www.defidaonews.com/article/6749182
https://www.coinonpro.com/web3/228616.html
Bridge Documents
cBridge: https://cbridge-docs.celer.network/introduction/sgn-and-cbridge
Stargate: https://stargateprotocol.gitbook.io/stargate/
Multichain: https://docs.multichain.org/
Hop: https://docs.hop.exchange/js-sdk/getting-started
Celer: https://www.celer.network/doc/CelerNetwork-Whitepaper.pdf
Connext: https://wiki.connext.academy
Translation: @Ruofan
Profreading: @Yarui
Layout:@Coucou
【免责声明】市场有风险,投资需谨慎。本文不构成投资建议,用户应考虑本文中的任何意见、观点或结论是否符合其特定状况。据此投资,责任自负。