header-langage
简体中文
English
Scan to Download the APP
Partnered With:

In-depth interpretation of how LayerZero achieves full-chain interoperability

Read this article in 12 Minutes
How does LayerZero implement functions such as cross-chain state sharing, bridging, lending, swap, and governance?

Original title: "LayerZero - An Omnichain Interoperability Protocol"
Original author: Ryan Zarick, Layer Zero Official
Original compilation: ETH Chinese station


For cross-chain bridging and communication, basically every existing solution is One of the large categories: the first is to verify and forward messages between different chains through an intermediate chain that forms a consensus; the second is to run a light node on the chain. Let's discuss it.


Middle Chain


Intermediate chains receive, verify and forward messages between chains. In this mode, the intermediate chain has full signing rights to all messages, and this design makes it a single point of failure. In the event of a consensus breach, all on-chain liquidity is instantly stolen. The current intermediate chain is only bound to hundreds of millions of dollars of assets, but needs to ensure the security of tens of billions of dollars of assets. As these chains become more and more decentralized, the problem becomes serious when this giant honeypot is exploited.


On-Chain Light Node


< /p>


The light nodes on the chain receive and verify the block header of the opposite chain. Proofs of transactions containing messages are forwarded and verified on-chain against block headers. This is the safest way to transfer messages between chains. Unfortunately, it's also the most expensive. Running an on-chain light node on Ethereum costs tens of thousands of dollars per day per opposing chain.


Ultra Light Node


The light nodes on the chain are extremely secure, but at the same time extremely expensive. Intermediate chains are less expensive, but less secure.


< /p>


Next is Ultra Light Node (ULN), which has the security of light nodes and the low cost of intermediate chains. Ultralight nodes do this by performing the same validation as light nodes on-chain; but instead of keeping all block headers in order, they are distributed on-demand by a decentralized oracle.


LayerZero


LayerZero is an on-chain endpoint of a User Application (UA) structure running an Ultra Light Node (ULN ). LayerZero relies on two parties to transmit messages between on-chain endpoints: oracles (Oracles) and relayers (Relayers). When a UA sends a message from chain A to chain B, the message travels through an endpoint on chain A. The endpoint then notifies the UA-specified Oracle and Relayer of the message and its destination chain. The Oracle will forward the block header to the endpoint of the B chain, and then the Relayer will submit the transaction proof. The proof is verified on the target chain and the message is forwarded to the target address.


< /p>


Security attributes


In splitting responsibilities between Oracle and Relayer, LayerZero leverages the security of established oracles (Chainlink and Band) feature, adding a layer of security through an open relay system. While this may seem like a small difference at first glance, its implications are quite profound. First, it means that this new network is only as secure as an oracle in the worst case. If you use Chainlink as your oracle, any malicious behavior in the system is still premised on being able to defeat Chainlink DON in the first place (not an easy task). Even if the oracle's consensus is broken, the active collusion of the Relayer is required. For example, in the most extreme case, the consensus of Oracle A is broken, and Relayer A colludes. All these risks are only borne by those user applications that receive messages from Oracle A and Relayer A. All user applications using Relayer B-Z (running their own Relayer), or all user applications using Oracle B-Z remain completely unaffected. In terms of risk model, this is a drastic change from the previously described midchain system.


< /p>


Use Cases


As far as the current ecology is concerned, cross-chain messaging is synonymous with bridging. But what you can do with LayerZero goes far beyond simply bridging assets. LayerZero can realize cross-chain state sharing, bridging, lending, swap, governance and more functions.


Status Sharing


SushiSwap exists on 12 different chains, each instance running in an isolated ecosystem. If they want to sync state with SushiSwap's main Ethereum instance, they will have to write code that uses Wormhole, Rainbow bridge, Polygon Network bridge, and Avalanche bridge. The end result is that there will be 11 sets of code, that is, 11 independent interfaces and 11 different security attributes. As the bridging and L1/L2 ecosystem is constantly changing, this makes the system increasingly difficult to manage.


< /p>


With LayerZero, SushiSwap will only need to have a single interface and code base for all cross-chain pairs. They only need to implement the "send" and "receive" functions. "Sending" consists of forming a message for the target chain, while "receiving" simply interprets that message.


The bridge of unified mobility


The current bridges are competing to attract Liquidity Providers (Liquidity Providers, LPs), in the bridge and their independent pairing Decentralized distribution of liquidity between fund pools. LPs must choose to connect to a single pool of a chain, rather than having one pool that provides liquidity to all connected chains. LayerZero solves the bridging problem by unifying liquidity across all chains by ensuring finality on the source chain. This means that when a user transfers assets from chain A to chain B, the user will be guaranteed that the assets are on chain B, and then LP will charge fees from all transactions entering chain B, regardless of the source chain.


< /p>


Swaps


Existing AMM can be encapsulated to perform cross-chain swap (no need to modify any existing code to conversion of one asset into another). Users only need to make a transaction on the source chain to convert ETH on Ethereum to SOL on Solana.


Borrowing


Now, if a user has assets on the A chain, but wants to carry out liquidity mining on the B chain, Then ta must mortgage and borrow on the A chain-> bridging assets (generate handling fees)-> swap (generate handling fees)-> carry out liquidity mining on the target chain-> swap back to the original assets (generate Fees) -> Bridge back to the original chain (generate fees) -> Repay the loan -> Propose mortgage assets. Using LayerZero, you can mortgage assets on the A chain, then directly borrow on the target chain, perform liquidity mining, repay the loan, and then the mortgage assets of the A chain are unlocked. The four handling fees for bridging and swap are omitted.




Original link


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit