The Battle of Cross-Chain Bridge Protocols: LayerZero vs. Chainlink, Who is the King?
Original authors: Pickle, Aylo
Compiled by: Moni, Odaily Planet Daily
Stargate Finance is an emerging cross-chain bridge project built on LayerZero. Since the launch of its cross-chain token bridge, there have been two opposing voices on Twitter, leading to intense debates about the cross-chain communication protocol LayerZero.
To avoid conveying any misinformation or overly subjective views, many of my articles (related to IBC, Axelar, and Thorchain) have been temporarily shelved.
This article analyzes and summarizes the white papers of LayerZero and CCIP, as well as their content published on major social media platforms, hoping to share with readers and clarify some external doubts.
Of course, the purpose of publishing this article is not to publicly criticize or attack the aforementioned protocols and individuals, nor should it be seen as a form of censorship. My opinions will be provided at the end, and please note that these are merely my personal views; you are welcome to form your own judgments.
If there are areas where I am uncertain or where my understanding may differ, I will indicate them; if there are any inaccuracies after the article is published, we will make corrections.
Next, the article will elaborate on the following points:
Introduction: What is Layer Zero?
Emerging Protocol Layer on Blockchain: LayerZero
How does LayerZero work?
Chainlink's Cross-Chain Interoperability Protocol CCIP
Related Controversies
Which protocol is superior?
Final Thoughts
Introduction: What is LayerZero?
There are various explanations for "LayerZero," one common way to describe it is: "It is a communication protocol that supports the execution of smart contracts across multiple chains, allowing any transaction on the source chain to perform cross-chain operations through (native) token bridges."
The ability to perform cross-chain operations is crucial for any DeFi user operating across multiple chains. LayerZero represents a recent attempt in infrastructure.
In addition, there are two other well-known cross-chain protocols in this field—Polkadot and Kusama, which build their ecosystems using their own blockchain networks. Additionally, there is the cross-chain communication protocol IBC, which currently operates only within the Cosmos ecosystem.
I have a great appreciation for IBC; it has the potential to become a leader in Layer 0, but the protocol has a long way to go before it can expand to non-Cosmos chains (regions), which I will not elaborate on in this article. Furthermore, there is another emerging cross-chain protocol, Axelar, which also operates within the Cosmos ecosystem and has launched its mainnet; we will discuss it in a future article.
Emerging Protocol Layer on Blockchain: LayerZero
LayerZero was developed by Primo, Ryan Zarick, and the well-known former Sushi developer (and Tokemak advisor) 0xMaki. Here are some excerpts from the white paper:
"LayerZero, the first trustless full-chain interoperability protocol, provides a powerful low-level communication primitive upon which various cross-chain applications can be built. With this new primitive, developers can create seamlessly connected cross-chain applications, such as cross-chain DEXs or multi-chain yield aggregation platforms, without relying on trusted custodians or intermediaries."
The term "trustless" here means that users do not need to trust anyone or any organization to operate honestly; as part of the protocol, smart contracts and code ensure that executed transactions cannot be exploited by bad actors, and nothing outside of your original intent can be accomplished. We will discuss this further later.
Note that LayerZero is not a blockchain but a protocol that primarily operates off-chain through "ultra-light clients," which are essentially smart contracts built on interconnected chains. These chains include L2 and L1, as well as the later emerging non-EVM and EVM chains.
The first and simplest use case brought by LayerZero is cross-chain bridging. Due to the risks and other issues involved, getting bridging right is very challenging, and LayerZero's bridging infrastructure (currently used by Stargate) significantly reduces these issues.
The impression left by "bridging" is often not very positive—transferring from one EVM chain (like Ethereum) to another chain (like Fantom) can often be quite difficult. This is mainly due to the fact that many existing bridges frequently suffer from transaction delays, lack of liquidity, slippage, and high fees, not to mention the risks of smart contracts or hacking.
While sometimes CEXs are used as alternatives, this is not a long-term solution and is clearly not very safe (because "if the keys are not in your hands, the tokens do not belong to you").
The recently launched Stargate Finance, built on LayerZero, indeed focuses on the field of blockchain development. Its white paper states:
"Existing DEXs have implemented converting user tokens into tokens specific to a protocol, with transaction consensus achieved through an intermediate consensus layer. Although the intermediate consensus layer is generally secure, it still requires users to trust side chains for token transfers."
Currently, bridge protocols with their own blockchains and intermediate tokens include Synapse (n
However, existing DEX solutions are not ideal, as they involve two intermediate transactions—one to convert the sender's tokens into intermediate tokens, and another to convert the intermediate tokens into "real" tokens on the receiver's chain.
Moreover, users must fully trust the intermediate consensus layer, which confirms transactions on the source chain and communicates the intent to mint tokens to the target chain. While existing exchanges do support cross-chain token transfers, doing so increases complexity and costs.
So, is there a good solution? In fact, we do have an alternative solution, which is asset wrapping. Avalanche is a great example, as it achieves native token bridging from Ethereum to Avalanche. The user experience is very fast, with no slippage or high fees, and gas costs are also very low.
How is this achieved? Assets transferred from Ethereum to Avalanche are wrapped—native assets are held in Ethereum's smart contracts, while wrapped assets are issued on Avalanche. For example, it can achieve the conversion of USDC → USDC.e.
However, if the smart contract controlling the Ethereum assets is hacked and funds are stolen, then the wrapped assets on Avalanche (USDC.e) would become worthless. For this reason, Avalanche now seems to encourage users to transfer native assets to their blockchain whenever possible.
Additionally, for the same reason, bridging with native assets (when possible, as not all assets on all chains are native, especially those between EVM and non-EVM chains) is a more desirable approach. To achieve this, Stargate is gradually rolling out native USDC and USDT through some EVM chains.
How does LayerZero work?
LayerZero Endpoints exist on every chain (supported by LayerZero), allowing any chain with a LayerZero Endpoint to perform cross-chain transactions. Essentially, this creates a fully connected network where each node can directly connect to every other node. It achieves this with a small amount of template code, supporting any blockchain.
LayerZero refers to their lightweight clients on chains as "LayerZero Endpoints." They consist of smart contracts with three main functions:
Communication
Validation
Networking
For simplicity, I will refer to the above clients as "endpoints," and provide a simple example:
Perform a cross-chain operation on Chain A (such as staking assets in an Ethereum lending protocol to borrow USDC in the same lending protocol on Polygon) and send it to the endpoint.
The endpoint sends information to the relayer and oracle—both of which are independent entities and off-chain.
The oracle confirms the block header (the oracle on the testnet is Chainlink).
The relayer confirms the transaction on Chain A (its function is similar to that of the oracle but looks for different data points).
Assuming everything goes well, the remaining operations on Chain A will be executed on Chain B (USDC will be received in the Polygon wallet).
Note that if there is any dispute in the information transfer between the relayer and the oracle, the smart contract will pause and will not submit to Chain B. To ensure effective information transfer, any relayer and oracle sending messages using the LayerZero protocol must be independent of each other.
Theoretically, the LayerZero protocol itself does not require any specific relayers; users can even implement self-sufficient relayer services. However, this independent design allows users to be confident that the oracle will not collude with the relayer to commit fraud, thus achieving trustless verification delivery.
I will continue to discuss the content of the above white paper and the trustless assumptions in later articles.
In fact, every decentralized application has multiple programmable and modifiable parameters. Theoretically, they can use only LayerZero endpoints, but they can also use different relayers from LayerZero and different oracles from Chainlink.
Here is a quote from Discord:
Decentralized applications can specify the number of confirmations they need on Chain A before sending information to Chain B (thereby increasing security/approaching "finality," but this will slow down cross-chain operations).
There is a viewpoint that LayerZero will eventually become tokenized. Because the protocol involves staking during operations, malicious actions from relayers would result in the loss of staked ZRO tokens. But this is merely speculation and has not been confirmed by the team.
Chainlink's Cross-Chain Interoperability Protocol CCIP
Sergey Nazarov, the CEO and co-founder of Chainlink, announced the Cross-Chain Interoperability Protocol CCIP at the second Smart Contract Summit SmartCon hosted by Chainlink in August 2021. At the same time, Chainlink's official website also released this important information.
Additionally, Aylo published an excellent post on Twitter that nicely summarized CCIP and its value proposition.
Since 2017, Chainlink has been building a broader off-chain middleware infrastructure, and CCIP perfectly fits into that infrastructure, leveraging existing innovative technologies such as Off-Chain Reporting (OCR) and Decentralized Oracle Networks (DONS) to achieve high-throughput off-chain computation, rather than just simple oracle functions.
So far, most of our understanding of CCIP has been analyzed in the video below, which also introduces some foundational knowledge related to the current Chainlink infrastructure.
The Cross-Chain Interoperability Protocol CCIP provides developers with a universal open standard upon which they can build applications that send messages, transfer tokens, initiate operations across multiple chains, and provide security services.
CCIP's functionalities include all the aforementioned features as well as those related to LayerZero, including a programmable token bridge for building decentralized applications similar to Stargate Finance. Additionally, CCIP introduces an innovation by creating "hybrid smart contracts," allowing on-chain and off-chain smart contracts to execute across chains simultaneously.
The counterpart of LayerZero Endpoint in CCIP is referred to as "Message Routing Smart Contract," which I will call MRSC.
In CCIP, the functions of relayers and oracles are not significantly different; both are performed by Chainlink DONS. Before information is transmitted from Chain A (via MRSC) to Chain B (via MRSC), the information must be accurate and match. In my view, this may be more secure than LayerZero's design philosophy, which I will discuss later.
In addition to having similar functionalities to LayerZero, CCIP also has anti-fraud features. Nodes handling cross-chain transactions are separate, and if any inconsistency is detected between the executed transaction message and the state of Chain A in the transaction, the smart contract functionality will be paused.
Compared to the security layer on LayerZero, this serves as an additional security layer.
Of course, since CCIP has not yet been launched, my understanding is limited to this, and the rest is speculation and conjecture. I believe that the anti-fraud network nodes will have a highly decentralized characteristic similar to the current DON (acting as traditional oracles and relayers for cross-chain transactions).
Another speculation is that staking will be launched simultaneously with CCIP. This would provide economic incentives for node operators while restraining bad actors.
It is worth noting that all of this has not been confirmed by the team, and let’s not forget that they have previously abandoned releases at the last minute.
Related Controversies
Shortly after the launch of Stargate, debates about LayerZero's implementation and potential vulnerabilities and risks associated with it have not ceased on Twitter and Discord. Many of these viewpoints are clearly incorrect (some are intentional, some are unintentional), but it is difficult to provide examples to refute them at the moment.
The first and most important thing to clarify is: the current oracle on the chain is not Chainlink (see this article for details).
Since the current oracle is not decentralized and has not been tested in real-world scenarios, this means it is highly susceptible to hacking. However, the good news is that, as confirmed by one of the LayerZero developers, Primo, Chainlink will soon become the preferred oracle, just like on the testnet. But until then, LayerZero will bear certain risks.
Next, let's talk about the relayers.
Relayers are independent entities separate from oracles. The white paper states that relayers can ensure trustless and more secure transactions, but I believe this point is debatable.
First, it is difficult to ensure that relayers are independent entities. Since decentralized applications can choose their own oracles and relayers (permissionless), malicious attacks are possible, such as collusion between the chosen oracle and relayer. Imagine an asset pretending to bridge: minting assets on Chain B while still retaining them on Chain A, so such collusion is quite likely.
In reality, this risk is similar to that present in any decentralized application. Furthermore, it is almost certain that every decentralized application will use Chainlink as its oracle. In this case, if the relayer engages in malicious behavior (gets hacked or does not work as expected), the Chainlink oracle will intercept and prevent any significant losses occurring on the original chain.
Some assumptions must also be made here; assuming Chainlink can be an effective and realistic alternative for fulfilling both functions (oracle and relayer), the following situations may arise:
Chainlink nodes are prone to errors (no system is perfect, and when a well-established protocol makes an obvious mistake, it is not the oracle's fault but rather human error: in February 2020, the oracle incorrectly fed prices for silver and gold, and the team filled in a small amount of lost funds).
Chainlink nodes lack sufficient incentives to prevent malicious actors from providing incorrect oracle data (the DONs system means that in a large collection, most nodes must collude against their own interests, while mature participants would suffer significant reputational damage from such behavior).
Compared to Chainlink nodes, a relayer system independent of the oracle system (for obvious reasons, Chainlink is adopted in all major decentralized applications) can be more trustworthy (or "trustless").
In point 3, compared to Chainlink nodes, the relayers proposed by LayerZero need to be more decentralized, have better economic incentive mechanisms, and have backup systems in place when they fail (similar to the functions of Chainlink DON).
For most protocols, it seems unrealistic for decentralized applications to directly create and operate relayers, as most decentralized applications today choose Chainlink rather than building their own oracles for price feeds—they are unwilling to build such infrastructure to protect themselves.
This is mainly because they cannot produce anything better or more decentralized than existing products. Therefore, I suspect that most will choose LayerZero's own relayers or rely on Chainlink to fulfill both functions. Ultimately, only obtaining a relayer that can compete with Chainlink DON would justify separating this function from the oracle.
I believe having an independent relayer can significantly reduce reliance on Chainlink, not just from a security perspective but also to differentiate it from CCIP, providing more value to LayerZero (this is just my personal opinion).
Which Protocol is Superior?
Frankly speaking, this question is truly subjective, as everyone can draw their own conclusions. To reiterate, since the white paper for CCIP has not yet been released, most of the information related to CCIP currently comes from my conversations with its developers and references to some information about Chainlink CCIP online.
In summary, I believe that separating relayers and oracles is not particularly important; unless done exceptionally well, it may cause unnecessary complications. In this regard, I think LayerZero at least has an advantage in shard security.
Returning to the debate between the two factions, assuming LayerZero and CCIP are equally excellent in terms of relayer and oracle functionalities, what else can be used to determine the winner?
On-chain smart contracts that implement their functionalities (LayerZero endpoints vs. CCIP MRSC)
CCIP's anti-fraud network
Reputation
Regarding points 1 and 2, we do not yet have more detailed information, but I hope that both mainnets will undergo rigorous testing and auditing to ensure they run smoothly. Assuming the on-chain smart contracts on both protocols are comparable, whether the anti-fraud network can provide an additional security layer for CCIP (rather than just complexity) is crucial. If the answer is yes, then CCIP could be a better protocol for decentralized applications and users.
As for point 3, the reputation issue, Chainlink has provided secure and reliable middleware infrastructure for some time, while LayerZero is a newly emerging protocol developed by a group of smart and innovative individuals. Ultimately, whether their reputation is good or bad will be proven over time.
It is worth mentioning that the developers of CCIP include Christian Catalini and Dan Boneh. It is no exaggeration to say that these two are among the best in the fields of cryptoeconomics and cryptography.
Final Thoughts
Performing better does not necessarily mean being more successful.
Although my views above lean towards supporting CCIP, this does not mean that CCIP will definitely be more successful. Generally, the first to enter the market, with better marketing, better network effects, and doing "well enough," will have their technology widely adopted. A good example of this is the battle between VHS and Betamax video mechanisms.
Perhaps the entire decentralized space is not yet truly ready for cross-chain decentralized applications, and if a completely different, more optimized solution emerges, it might win out. Here, I must mention IBC (Inter-Blockchain Communication Protocol)—a true competitor that could very well become a terminator (LayerZero and CCIP may not think so).
In fact, there has long been dissent in the community regarding the widespread adoption of CCIP by some DeFi 1.0 lending protocols on Ethereum. I believe that some DeFi protocols may choose LayerZero next, and other decentralized applications will follow suit. Once they choose LayerZero, it will be difficult for CCIP to catch up.
While chain bridges are very important, there is no real technology to provide protection at the decentralized application level. They can fork like DEXs but need to rely on emerging technologies or network effects to ensure long-term effectiveness. Since both LayerZero and CCIP have basic token bridging infrastructure, supporting multi-chain bridges.
Therefore, I suspect there will be a price war to lower fees, along with incentives to boost liquidity and reward holders of their respective tokens (similar to vePTP, veCRV, or veJOE models). Those who merely bet on Stargate Finance (STG) may need to be cautious.
In summary, I believe that Chainlink and LayerZero are not just in competition but can also promote each other. Currently, CCIP has been silent for 9 months, focusing on development, while the launch of LayerZero may put some pressure on the Chainlink team to expedite the release of their protocol. Conversely, the competitive pressure from CCIP can also motivate LayerZero to innovate and improve continuously to maintain its leading edge.
Frankly speaking, healthy competition is a good thing, as it promotes mutual progress. I believe that most blockchain developers, regardless of which company they serve, are working to advance technological progress, which is a blessing for all of us.