BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

The battle of cross-chain bridge protocols: LayerZero and Chainlink, who is the king?

Moni
Odaily资深作者
This article is about 7678 words, reading the full article takes about 11 minutes
In-depth comparison of LayerZero and Chainlink
AI Summary
Expand
In-depth comparison of LayerZero and Chainlink

This article comes fromsubstack, by Pickle and Aylo

Odaily Translator |

Odaily Translator |

Stargate Finance is an emerging cross-chain bridge project based on LayerZero. Since the launch of its cross-chain token bridge, two different voices have appeared on Twitter at the same time, and they have had a heated debate on the cross-chain communication protocol LayerZero.

Many of my articles (on IBC, Axelar and Thorchain) have been put on hold in order to avoid sending out some misinformation and being too subjective.

This article analyzes and summarizes the white papers of the two protocols, LayerZero and CCIP, as well as the content they have published on major social media platforms, hoping to share with readers, and on the other hand, it can explain some doubts from the outside world.

Of course, my purpose of publishing this article is not to publicly criticize or attack the above-mentioned agreements and individuals, and of course not to regard this as a kind of censorship. My opinion will be given at the end, note that this is just my personal opinion, you can have your own judgment. If there are places in which I am not sure or my understanding, I will mark it; if there are any inaccuracies after the article is published, we will also correct it.

Next, the article will elaborate on the following points:

1. Introduction: What is Layer Zero?

2. An emerging protocol layer on the blockchain: LayerZero

3. How does LayerZero work?

4. CCIP, a cross-chain interoperability protocol released by Chainlink

5. Some related controversies

7. Some final thoughts

secondary title

Introduction: What is LayerZero?

The ability to achieve cross-chain operations is very important for any DeFi user across multiple chains. LayerZero is the latest attempt at infrastructure. In addition, there are two other well-known cross-chain protocols in this field - Polkadot and Kusama. These two ecosystems are built using their own blockchain networks. In addition, there is a cross-chain communication protocol IBC currently only operating in the Cosmos ecosystem. I really appreciate IBC, it has the potential to become a leader in Layer 0, but if the protocol is to be expanded to non-Cosmos chains (regions), there may still be a long way to go, so I won’t go into details in this article today. In addition, there is also an emerging cross-chain protocol Axelar that is also running in the Cosmos ecosystem. The main network has been released, and we will discuss it next time.

secondary title

An Emerging Protocol Layer on the Blockchain: LayerZero

LayerZero was developed by Primo, Ryan Zarick, and notable ex-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 on which various cross-chain applications can be built. With this new primitive, developers can build Seamless cross-chain applications, such as cross-chain DEX or multi-chain revenue aggregation platform, without relying on trusted custodians or intermediary transactions.”

The "trustless" mentioned here means that users do not have to trust any person or organization, but can conduct honest operations. As part of the agreement, smart contracts and codes will ensure that the executed transactions will not be used by bad actors. , nothing other than your original goal can be accomplished. This we will discuss later.

Note that LayerZero is not a blockchain but a protocol, which mainly runs off-chain through "ultra-light clients". These "ultra-light clients" are actually smart contracts built on chains that can be interconnected. These chains include L2 and L1, and later non-EVM as well as EVM.

The first and simplest use case that LayerZero brings is cross-chain bridging. Bridging is a very difficult thing to do well because of the risks involved and other issues, and the LayerZero bridging infrastructure (which Stargate is using now) greatly reduces these problems.

"Bridging" usually doesn't give a good impression - going from one EVM chain (such as Ethereum) to another chain (such as Fantom) is often difficult. This is mainly due to the fact that some current chain bridges often suffer from transaction freezes, lack of liquidity, slippage and high fees, not to mention smart contract risks or hacking attacks. Although CEXs are sometimes used as an alternative, this is not a long-term solution, and it is obviously not very secure (because "if you don't have the key, the tokens don't belong to you").

The recently released Stargate Finance, built on top of LayerZero, really puts the spotlight on this area of ​​blockchain development. Its white paper reads:

“Existing DEXs implement the conversion of user tokens into tokens of a specific protocol, and these tokens achieve transaction consensus through an intermediate consensus layer. Although the intermediate consensus layer is usually safer, it still requires users to trust the side chain to achieve transfer of tokens."

Currently, bridging protocols with their own blockchain and intermediate tokens include Synapse (n<token> pool, such as nETH-ETH, nUSD-stablecoins), Thorchain (RUNE pair), AnySwap/Multichain, etc. These protocols do provide part of the solution for users.

However, existing DEX solutions are not ideal because two intermediate transactions are involved - one to convert the sender's token to an intermediate token, and the other to convert the intermediate token to the recipient's on-chain "Real" tokens. In addition to this, users must fully trust the intermediate consensus layer that 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 comes at the expense of increased complexity and cost.

So, is there any good workaround? In fact, we do have an alternative solution, which is wrapping assets. A good example is Avalanche, which implements a native token bridge from Ethereum to Avalanche. The user experience is very fast, there is no slippage or high fees, and the gas fee is very low. So how is this possible? Assets that users transfer from Ethereum to Avalanche will be encapsulated - the original assets are kept in the smart contract of Ethereum, and the encapsulated assets are issued on Avalanche. For example, the conversion of USDC → USDC.e can be realized.

Also, for the same reason, bridging with native assets (where possible, not all assets on all chains are native, especially those between EVM and non-EVM chains) is a preferable practice. To achieve this, Stargate is gradually rolling out native USDC and USDT via some EVM chains.

secondary title

How does LayerZero work?

LayerZero Endpoint exists on every chain (supported by LayerZero), and any chain with LayerZero Endpoint can conduct cross-chain transactions. Essentially, this creates a fully connected network where every node is directly connected to every other node. Realized the use of a small amount of template code to support any blockchain.

LayerZero refers to their clients on the lightweight chain as "LayerZero Endpoints". They consist of smart contracts with three main functions:

1. Communication

2. Verification

3. Network

For simplicity, I'll refer to the above client as 'endpoint', and here's a simple example:

1. Perform cross-chain operations on Chain A (such as pledged assets in the Ethereum lending agreement, borrow USDC from the same lending agreement Polygon), and send it to the endpoint.

2. The endpoint sends information to the repeater and the oracle - both entities are independent and off-chain.

3. The block header is confirmed by the oracle machine (the oracle machine on the test network is Chainlink).

4. The transaction on chain A is confirmed by the repeater (its function is similar to the oracle machine, but it will look for different data bits).

5. Assuming everything is normal, the rest of the operations on Chain A will be implemented on Chain B (USDC will be received in Polygon’s wallet).

Note that once there is any dispute in the transmission of information between repeaters or oracles, the smart contract will be suspended and will not be submitted to the B-chain. In order to ensure the effective delivery of information, it is required that any relayers and oracles that use the LayerZero protocol to send messages must be independent of each other. Theoretically, the LayerZero protocol itself does not require any specific repeaters, and users can even implement self-sufficient relay services. However, this independent design can make users sure that the oracle will not collude with the repeater to do evil, thus realizing trustless verification delivery.

I will continue to discuss the content of the above white paper and the trustless assumption in a later article.

In fact, every decentralized application has multiple programmable and modifiable parameters. In theory, they could just use LayerZero endpoints, but they could also use relayers different from LayerZero, and oracles different from Chainlink.

Here's a quote from Discord:

There is an argument that LayerZero will eventually become tokenized. Because there is a pledge behavior in the operation of the protocol, those malicious practices from relayers will lose the pledged ZRO tokens. But this is just speculation and has not been confirmed by the team.

secondary title

CCIP, a cross-chain interoperability protocol released by Chainlink

Sergey Nazarov, CEO and co-founder of Chainlink, released the cross-chain interoperability protocol CCIP in August 2021 at SmartCon, the second smart contract summit hosted by Chainlink. At the same time, Chainlink’s official website also released this important information.

Also, Aylo has a great post on twitter that nicely summarizes CCIP and its value proposition.

Since 2017, Chainlink has been building a broader off-chain middle layer infrastructure, and CCIP is a perfect match for that infrastructure, and will leverage off-chain reporting (OCR) and decentralized oracle networks (DONS), among others Some existing innovative technologies to achieve high-throughput off-chain computing, not just simple oracle functions.

Most of what we know about CCIP so far is analyzed in the video below, which not only covers some basics related to the current Chainlink infrastructure.

The cross-chain interoperability protocol CCIP provides developers with a common open standard on which developers can build applications that send messages, transfer tokens, initiate operations, and provide security services across multiple chains.

CCIP features include all of the above plus features related to LayerZero, including a programmable token bridge to build decentralized applications similar to Stargate Finance. In addition, CCIP has another innovation, which is to create a "hybrid smart contract", which enables smart contracts on and off the chain to be executed across the chain at the same time.

The CCIP corresponding to LayerZero Endpoint is called "Message Router Smart Contract", and I will call it MRSC next.

In CCIP, there is no significant difference between the functions of the repeater and the oracle. Both are completed by Chainlink DONS. Before the information is passed from the A chain (via MRSC) to the B chain (via MRSC), the information must be Match and be exact. In my opinion, this may be more secure than LayerZero's design philosophy, which I will discuss later.

In addition to having similar features to LayerZero, CCIP also has anti-fraud features. Those nodes that handle cross-chain transactions are all independent. Once it is detected that the executed transaction message is inconsistent with the A-chain state in the transaction, the smart contract function will be suspended.

This amounts to an additional layer of security compared to the one on LayerZero.

It's worth noting that none of this has been confirmed by the team, and don't forget that they've done things like temporarily aborting a release.

secondary title

some controversies about

Shortly after Stargate was released, there was ongoing controversy on Twitter and Discord about the implementation of LayerZero and the potential vulnerabilities and risks associated with it. Many of these ideas are clearly wrong (some intentional, some unintentional), but it is difficult to cite examples to refute these ideas at the moment.The first and most important thing to be clear: the oracle machine on this chain is not Chainlink (for details, please refer to)。

This article

Since current oracles are not decentralized or battle-tested, this also means that there is a high chance of being hacked. The good news, however: Chainlink, like the testnet, will soon be the oracle of choice, as confirmed by Primo, one of the LayerZero developers. But until then, LayerZero will take some risks.

Next, let's talk about repeaters.

Relays are separate entities from oracles, and the white paper states that they can ensure trustless and more secure transactions, although I think this is open to debate.

First, it is difficult to ensure that repeaters are separate entities. Since dapps can choose their own oracles and relayers (permissionless), malicious attacks are possible, such as chosen oracles and relayers colluding to do evil. Imagine an asset pretending to be bridged: minting assets on chain B can still keep them on chain A, so such collusion is very possible.

In fact, this is the same risk that exists on any decentralized application. Furthermore, it is almost certain that every decentralized application will use Chainlink as its own oracle. This way, in the event of a repeater acting maliciously (hacked or not working as expected), the Chainlink oracle will intercept it, preventing any significant loss from occurring on the original chain.

Some assumptions must also be made here, assuming that Chainlink can be a valid and realistic alternative for both functions (oracles and relayers), then the following scenarios would emerge:

1. Chainlink nodes are error-prone (no system is perfect, and this obvious error in the proven protocol is not a problem with the oracle, but caused by humans: in February 2020, the oracle was right The silver and gold prices were misfed, and the team has filled it with a small amount of lost funds).

2. Chainlink nodes do not have enough incentives to prevent malicious actors from providing false oracle data (DONs system means that in a huge set, most nodes must collude with each other against their own interests, while those mature Participants suffer significant reputational damage as a result of such actions).

3. Relay systems independent of oracle systems (Chainlink is used in all important decentralized applications for obvious reasons) can be more trusted (or "trustless") than Chainlink nodes ).

In point 3, LayerZero's proposed relayers need to be more decentralized than Chainlink nodes, have better economic incentives, and have a backup system in case they fail (similar to what Chainlink DON does).

I think having an independent relayer can greatly reduce the dependence on Chainlink, not just from a security point of view, but it can differentiate it from CCIP and provide more value to LayerZero (this Just my personal opinion).

secondary title

Which agreement is better?

Frankly speaking, it is really a matter of opinion on this issue, because everyone can draw their own conclusions. To reiterate, since the white paper of CCIP has not been released, most of the current information related to CCIP comes from my communication with its developers and some information about Chainlink CCIP on the Internet.

All that said, I don't think it's really important to separate repeaters and oracles, and unless it's done really well, it might cause unnecessary trouble. At this point, I think LayerZero still has an advantage, at least in terms of sharding security.

Let's go back to the debate between the two factions, assuming that LayerZero and CCIP are equally good in terms of repeater and oracle functions. So what else can be used to decide the winner?

1. On-chain smart contracts that realize their functions (LayerZero endpoints and CCIP MRSC)

2. CCIP's anti-fraud network

3. Reputation

Regarding items 1 and 2, we haven't got more detailed details, but I hope that the mainnets of both can pass strict tests and audits to ensure that they are running well. Assuming comparable on-chain smart contracts on the two protocols, whether anti-fraud networks could provide CCIP with an additional layer of security (rather than just complexity). If the answer is yes, then CCIP is a better protocol for decentralized applications and users.

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 the two best people in the field of cryptoeconomics and cryptography.

secondary title

final thoughts

Better performance does not mean more success.

Although my above point of view tends to support CCIP, it does not mean that CCIP will definitely be more successful. Oftentimes, whoever gets to market first, has better publicity, better network effects, and does it “good enough” gets the most widespread adoption. In this regard, you can look at the next good example-the battle between VHS and Betamax video recorders.

Perhaps, the entire decentralized field is not really ready for cross-chain decentralized applications. At this time, if there is a completely different and more optimized thing, it may win. Here I have to mention IBC (Inter-Blockchain Communication Protocol Inter-chain communication protocol) - a real competitor, and it is likely to become the terminator (LayerZero and CCIP may not think so).

In fact, the community has already had objections to the general adoption of CCIP in some DeFi 1.0 lending protocols on Ethereum. I think that in the future, some DeFi protocols may choose LayerZero, and other decentralized applications will follow suit. And once they choose LayerZero, it will be difficult for CCIP to catch up.

Although the chain bridge is very important, there is no real technology to protect it at the decentralized application level. They can be forked like DEX, but need to rely on some emerging technologies or network effects to ensure long-term effectiveness. Since both LayerZero and CCIP have basic token bridging infrastructure, supporting multi-chain bridges, I suspect there will be a fee war to drive down prices, while there will be incentives for liquidity and rewards for holding their respective tokens (something like based on vePTP, veCRV or veJOE models). And for those betting solely on Stargate Finance (STG), caution may be in order.

Frankly, healthy competition is a good thing because it fosters mutual progress. I think most blockchain developers, no matter what company they work for, are working hard to push the technology forward, which is a boon for all of us.

Related Reading:Related Reading:

Chainlink
Cross-chain
Welcome to Join Odaily Official Community