A Comprehensive Look at LayerZero's Ecological Projects and Multi-Chain Ambitions
Author: Tiga, W3.Hitchhiker
*Revision: * Evelyn, W3.Hitchhiker
LayerZero Technical Analysis
LayerZero is a cross-chain communication protocol that can transmit "information" from one chain to another. LayerZero completed a $2M seed round financing in April 2021, followed by $6.3M and $135M in financing in September 2021 and March 2022, respectively. Participating institutions include Binance Labs, Multicoin, Delphi, A16Z, Uniswap, Polygon, Coinbase, and many others, making the investment lineup top-notch.
LayerZero achieves decentralized cross-chain information services by deploying a series of smart contracts (Endpoints) on-chain. The Endpoint runs ultra-light nodes, where "ultra-light" means that this node only provides the Block header of the specified block. During the transmission process, the validity and security of the information sent are ensured through Oracles and Relayers.
The Endpoint is a contract deployed on-chain responsible for sending and receiving messages. The functions of the Relayer and Oracle are consistent, both serving as oracles, but the content transmitted differs, and they operate independently. The receiving chain's Endpoint verifies and matches the information sent by the Relayer and Oracle, enhancing LayerZero's security redundancy.
Specifically, LayerZero divides the Endpoint into three parts: Communicator, Validator, and Network:
Communicator: An interface for Dapps,
Validator: Responsible for verifying information on the receiving end,
Network: An interface for sending or receiving information to/from other chains.
The specific steps are as follows:
Step 1: A Dapp on chain A interacts with the Endpoint on chain A to generate a transaction TTT, producing four parameters that will be sent to the Communicator via LayerZero. The four parameters are:
t: The unique transaction proof of transaction T (transaction proof)
dst: The identifier of the target chain Endpoint
payload: The data that the Dapp on chain A wants to send to chain B
relayer_args: The Relayer parameters that A wishes to use
Step 2: The Communicator packages these parameters into a Packet(dst,payload) and sends it along with t and relayer_args to the Validator.
Step 3: The Validator passes t and dst to the Network.
Step 4: The Validator sends Packet(dst,payload), t, and relayer_args to the Relayer. Steps four and three occur simultaneously.
Step 5: The Network sends dstdstdst along with the ID of the current transaction block (curblkid) to the Oracle.
Step 6: The Oracle retrieves the block header from chain A.
Step 7: The Relayer retrieves the transaction proof t of transaction T from chain A and stores it off-chain.
Step 8: After the Oracle confirms that transaction T has been submitted on chain A, it sends the block header to the Network of chain B.
Step 9: The Network of chain B sends the received block hash (denoted as blkhdrhash) to the Validator of chain B.
Step 10: The Validator sends blkhdrhash to the Relayer.
Step 11: After the Relayer receives the blkhdrhash sent from chain B, it returns the data that matches blkhdrhash to the Validator of chain B.
Step 12: The Validator of chain B matches the blk_hdr obtained from the Oracle with the transaction proof t obtained from the Relayer. If the match is successful, it sends Packet(dst,payload) to the Communicator. If the match fails, the transaction is ignored.
Step 13: The Communicator sends the Packet(dst,payload) data to the Dapp on chain B, completing the cross-chain information transfer.
In simple terms, the Dapp on chain A tells the LayerZero deployed on chain A's Endpoint: "I want to send a XXX message to chain B." The process of sending the message can also be seen as a transaction. When this transaction is recorded on chain A, the Oracle will directly check whether it has indeed been recorded on chain A, and the Relayer will also retrieve the proof of this transaction from chain A. The Oracle and Relayer will send the content they obtained to the Endpoint of chain B. If the contents match, the message from chain A is sent to chain B. Conversely, if the contents obtained by the Oracle and Relayer do not match, the transaction is ignored.
In terms of security, LayerZero distributes security defenses across four points: Endpoint, Oracle, Relayer, and the chain itself. They are inter-coupled, and this decentralized structure makes LayerZero more secure.
When any part suffers a malicious attack, the other parts will block the LayerZero process and isolate the maliciously supplied part. Among these four parts, the weakest links are the Oracle and Relayer, as the difficulty and cost of a 51% attack on mainstream chains are very high, and 51% attacks are not something LayerZero considers or defends against. The Endpoint is essentially a smart contract, which can minimize security risk points through security audits. If the Oracle and Relayer are not attacked simultaneously, LayerZero can guarantee its security.
In the worst-case scenario, if both the Oracle and Relayer are hijacked and collude with each other, the Oracle provides a malicious block header, and the Relayer provides a malicious transaction proof, with both contents matching. This situation is very unlikely from a probabilistic standpoint because the Oracle and Relayer are independent components, and the oracle service used by LayerZero is provided by Chainlink, which is quite secure. Furthermore, without knowing a specific block header, it is impossible to verify a transaction proof against a block header. Conversely, a block header cannot be deduced from a transaction proof. This is the fundamental guarantee of the security of the Oracle and Relayer, and also the assurance of LayerZero's security.
LayerZero Ecosystem Overview
Stargate
Stargate is the first project built on LayerZero, dedicated to creating a fully composable native asset cross-chain bridge protocol. Currently, Stargate supports Ethereum, BSC, AVAX, Matic, Arbitrum, Optimism, and Fantom chains, and only supports four tokens: USDC, USDT, ETH, and STG.
Stargate's cross-chain method differs from other cross-chain bridges, adopting an OTC-like approach for cross-chain transactions. Liquidity pools are established on each chain, where users "stake" assets in the liquidity pool on chain A and "redeem" assets in the liquidity pool on chain B, without the need for intermediary assets. The communication between chains A and B is achieved through LayerZero.
As LayerZero's "child," Stargate's role goes far beyond that of a cross-chain bridge. From Stargate's documentation, it is evident that Stargate aims to serve as a technical provider for asset cross-chain solutions, enabling more projects to easily utilize Stargate to achieve cross-chain functionality. Therefore, Stargate's business needs to be divided into two parts: 2B and 2C, with the 2B business model having far more imaginative potential than the 2C model, allowing for the construction of more complex Dapps on top of Stargate.
Hashflow
Hashflow is a cross-chain DEX that emphasizes zero slippage and MEV protection, utilizing LayerZero for cross-chain message passing. Hashflow currently supports Ethereum, BSC, AVAX, Polygon, Arbitrum, and Optimism chains.
As a DEX, Hashflow does not use the AMM model; instead, it employs a request-for-quote (RFQ) method for token exchanges, which is very similar to order book trading. Its specific mechanism is as follows: a trader quotes to exchange 1 ETH on chain A for 1000 USDC on chain B, the market maker sends the trader's 1 ETH from chain A to the liquidity pool on chain A, and then triggers the contract on chain B to deposit 1000 USDC into the trader's wallet on chain B.
RadiantCapital
Radiant is a multi-chain lending project based on LayerZero/Stargate deployed on Arbitrum, currently supporting only five tokens: USDC, USDT, DAI, BTC, and ETH. Users can choose to collateralize the aforementioned five assets on Arbitrum to borrow other assets. Currently, Radiant only supports cross-chain lending of USDT and USDC, meaning users can collateralize assets on one chain and borrow USDT or USDC on another chain.
SushiXSwap
SushiXSwap is a cross-chain DEX launched by SushiSwap, the world's first cross-chain AMM. Built on LayerZero's Stargate protocol, it currently supports ETH mainnet, Arbitrum, AVAX, Polygon, Fantom, BSC, and Optimism networks. The trading process of SushiX is shown in the figure below, utilizing Stargate's cross-chain functionality to achieve cross-chain DEX with Sushiswap's multi-chain liquidity.
Other LayerZero Ecosystem Projects (Some Not Yet Launched)
@OmniBTC: A three-in-one DEX+Lend+Bridge built on Sui and Aptos
@rage_trade: Decentralized contracts on Arbitrum
@MugenFinance: RealYield based on LayerZero
@InterSwap: Swap based on LayerZero
@CashmereLabs: Full-chain DEX
@holographxyz: Mint and Bridge protocol for full-chain NFTs
@OmniX_NFT: Full-chain native NFT platform and marketplace
Moonbeam: Integrated LayerZero
Clearpool: Will integrate with LayerZero
Angle Protocol: Integrated with LayerZero
The projects listed here are not exhaustive; readers are encouraged to explore the remaining projects on their own.
LayerZero Outlook
What can be cross-chain is not just tokens, but also the functionalities and services of various protocols. With the development of crypto, the current blockchain world has a plethora of commendable truly innovative projects/protocols that have mature mechanisms and stable operations, which can serve as underlying "components" for other protocols.
These protocols themselves are programmable, composable, and interactive, and web3 is far more open and inclusive than web2. Smart contracts inherently expose APIs; if we can break down the barriers between chains and allow liquidity and users to freely and conveniently traverse between various protocols and chains, developers can create more imaginative "things," and DeFi can evolve further, continuously expanding the boundaries of crypto/web3.
What will the future blockchain world look like? What changes will LayerZero bring to the blockchain, and what impact will it have? I don't know, but one thing is certain: the future development of blockchain will definitely move towards interconnectedness, making it convenient for users and developers alike. Tim Berners-Lee, the inventor of the World Wide Web, once said about design principles: "Simplicity and modularity are the cornerstones of software engineering; distribution and fault tolerance are the lifeblood of the internet." By modularizing and interconnecting mature protocols across chains, the future will surely give rise to the killer apps of web3. Geniuses need a stage, as well as hammers and nails; LayerZero can serve as the hammer and nails for the geniuses of web3.
A reasonable and conservative estimate is that the gas fees of future blockchains will decrease by several orders of magnitude, and the number of DeFi users will also grow by several orders of magnitude, with massive market demand giving rise to "ocean freighters" between chains, and the costs of cross-chain transactions approaching zero due to marginal effects. Lowering costs is a necessary condition for scaling, just as the price of power batteries has decreased tenfold over the past decade, leading electric vehicles to households everywhere.
202209: LayerZero updates to version V2:
Will support non-EVM chains
Launch LayerZero Scan
Reduce gas fees by 20%
Security patches
Reference: