How does LayerZero break data "islands" and create a multi-chain universe?
Author: Nianqing
When we look back at the history of the internet's development, we can more clearly recognize the importance of data transmission. In the Web 1.0 era, we had computers and then invented the internet. The internet allowed data to be transmitted via the TCP/IP protocol, connecting these independent computers to each other.
The emergence of data transmission protocols has truly realized the interconnectivity of networks. In the Web 3.0 era, the widespread use of blockchain provides developers with various platforms to run smart contracts based on the functionality of applications and the requirements for throughput, security, and cost. However, the consequence of this freedom is severe fragmentation. Each chain is isolated, forcing users to be unable to transfer assets and data between these networks, limiting the flow between walled ecosystems.
To make an inappropriate analogy, the emergence of various L1 and L2 chains is akin to the invention of computers; now we need a more fundamental infrastructure to connect these data islands in a more convenient and secure manner.
Thus, we begin to return to the more fundamental Layer 0 (data transmission layer) to discuss how to provide cross-chain interoperability communication facilities for blockchains from the top layer to different layers.
From the very beginning, protocols like Cosmos and Polkadot have focused on a multi-chain future, creating a network ecosystem with cross-chain interoperability through decentralized networks of independent parallel blockchains, and have thus been classified as Layer 0 from "public chains." However, the cross-chain communication of these two protocols is currently limited to their own ecosystems.
At the same time, ordinary cross-chain bridge protocols frequently experience security incidents and are designed in a very redundant and complex manner. Therefore, the entire blockchain network urgently needs a more innovative, secure, and unified inter-chain data transmission protocol.
In addition to the user perspective, some "super applications" also have an "absolute need" to enhance cross-chain experiences, such as Uniswap. Currently, Uniswap v3's cross-chain method is to gradually deploy to new networks through cross-chain bridges, relying on trusted cross-chain bridges or multi-signatures to handle governance updates each time, which may affect the existing security of the protocol. Uniswap mentioned in a blog earlier this year: "Few networks provide general trust-minimized bridges that support arbitrary messaging," highlighting the scarcity of general information layer cross-chain protocols.
LayerZero, as a fully interoperable protocol built from the ground up, has been "hot" this year.
At the end of March this year, LayerZero secured $135 million in Series A+ funding led by FTX Ventures, Sequoia Capital, and a16z, with participation from top venture capital firms such as Coinbase Ventures, PayPal Ventures, Tiger Global, and Uniswap Labs. Subsequently, it was reported that LayerZero Labs is raising funds at a valuation of $3 billion, with FTX Ventures committed to leading the round.
The name of this cross-chain protocol is very straightforward, clearly conveying its vision: to provide the foundational network structure for the future full-chain ecosystem and a universal information layer, where "universal" means the technology can be used for any cross-chain communication needs of any decentralized application.
Currently, LayerZero is expanding into the Asia-Pacific region, and next, the team will focus on developing this region and plans to support local teams and projects . Additionally, LayerZero Labs CEO Bryan Pellegrino and CTO Ryan Zarick have confirmed their attendance at the upcoming TOKEN2049 crypto event in Singapore, where Bryan Pellegrino and the LayerZero team will welcome industry professionals for on-site discussions.
So, what makes LayerZero special compared to other cross-chain communication protocols, and why is it attracting capital's keen interest? This article will analyze LayerZero's innovations in terms of security, interoperability, and more.
1. How does LayerZero ensure cross-chain security?
Among many cross-chain bridge protocols, LayerZero is the only cross-chain communication protocol that is not subject to attacks from intermediate chains, validator sets, or contract upgrades.
Currently, most heterogeneous cross-chain bridge solutions in the market adopt a notary mechanism. This mechanism essentially involves the "mapping" of assets; when assets are transferred across chains, there is no need to actually move the assets or reissue them on the destination network. Instead, the assets are first deposited into an immovable address, and then corresponding 1:1 mapped assets are issued on the destination network based on the amount of assets.
This process is very complex and faces multiple stages, such as asset issuance, cross-chain monitoring, asynchronous verification, and even the need to issue an independent intermediate consensus layer, facing risks like replay attacks, malicious multi-signature managers, and downtime.
This model is also referred to as the intermediate token model. Besides being insecure, this intermediate token adds unnecessary overhead and complexity, especially when users end up with an intermediate token like abcUSD due to errors or insufficient liquidity on the target chain. For example, AnySwap relies on an intermediate token ANY based on Fusion's distributed control authority management. Using native tokens from the start would save a lot of trouble.
Moreover, many cross-chain bridge protocols currently choose to utilize a not fully decentralized intermediate consensus layer. This is either because the validators are permissioned and very few in number, or the cross-chain bridge is protected by multi-signatures. This poses significant risks because the target chain implicitly trusts the intermediate chain, which has full signing authority over the target chain. This means that any hacker attack on the intermediate chain could potentially drain all liquidity locked in the target chain's pool. Additionally, the use of an intermediate consensus layer appears to be more redundant and insecure.
For example, in early August, the cross-chain bridge Nomad suffered a loss of $190 million due to a low-level error during a contract upgrade, allowing ordinary people to participate in the attack by finding previously successful transactions, changing the address, and rebroadcasting. In March, during the Robin hack incident, hackers gained control over most of the validator nodes securing the network, stealing $625 million. In February, the Wormhole hack occurred due to a lack of verification checks, allowing attackers to create a fake signature and steal assets.
In contrast to the aforementioned cross-chain bridge models, LayerZero removes intermediate tokens and intermediate consensus layers to achieve direct communication between all chains, enabling direct trading of native assets across different chains.
In summary, LayerZero's cross-chain solution simplifies the trustless communication issue between blockchains into the independence problem between two entities: oracles and relayers. As long as the oracle and relayer operate independently of each other, it is impossible to successfully send invalid messages. The benefit of this modularity is that if any vulnerabilities arise, they will only affect the applications of the affected oracle and relayer pair.
LayerZero's security model draws on the advantages of both Polkadot and Cosmos in cross-chain communication.
Polkadot achieves cross-chain communication through relayers and parachains, allowing parachains and relayers to share a security model. However, if consensus is compromised, liquidity across all chains can be immediately stolen, which does not guarantee the security of all blockchains. Cosmos, on the other hand, designed the IBC (Inter-Blockchain Communication) protocol based on TCP/IP, consisting of two different layers: the transport layer and the application layer. The former provides the necessary infrastructure to establish secure connections between chains and authenticate data packets, while the latter accurately defines how the sending and receiving chains should package and interpret these data packets.
LayerZero, through its "Ultra Light Node," connects every contract on one blockchain while also connecting every contract on any other blockchain. It establishes a security layer through an open relayer system and the security properties of established oracles to achieve both security and cost-effectiveness.
The specific working steps of oracles and relayers are as follows:
LayerZero deploys an endpoint on each chain, consisting of a series of smart contracts, which runs an Ultra Light Node (ULN). It then streams block headers containing cross-chain information on demand via oracles (instead of sequentially transmitting all block headers to reduce costs) and transmits proof information through relayers, with both verifying each other to ensure the correctness of the information.
Oracles and relayers operate independently. In theory, anyone can run their own relayer or use their own oracle, but currently, Chainlink is used as the default oracle. This design allows users to ensure that relayers do not collude with oracles, achieving trustless verification delivery.
- Security Upgrade: Pre-Crime Mechanism
To further ensure the security of the protocol, in April of this year, LayerZero introduced the Pre-Crime mechanism, which operates by forking the target blockchain and running transactions locally before passing messages. After the transaction runs, the relayer can define a specific set of states on the locally forked blockchain based on the user application (UA), which the relayer must verify. If these states are not verified, the relayer will not relay the transaction.
Currently, LayerZero Labs' relayers are running a lightweight version of Pre-Crime, and the team will continue to optimize this version in the coming months. It has already ensured the security of its ecological DEX Stargate, and the next phase will open Pre-Crime to all applications.
Along with the launch of Pre-Crime, LayerZero also announced a security vulnerability bounty program with a maximum reward of $15 million. In just the past year, the total audit fees for top auditors such as Quantstamp, Zokyo, Zellic, and Trail of Bits have exceeded $3.5 million, and audit #20 is currently underway; the latest audit is publicly available on GitHub.
2. LayerZero Ecosystem
LayerZero currently supports Ethereum, Binance Smart Chain, Polygon, Avalanche, Fantom, Arbitrum, Optimism, Moonbeam, Harmony, Swimmer, and DFK. Additionally, LayerZero will deploy on more than a dozen testnets and mainnets, including Moonbeam, Gnosis Chain, Aptos, Sui, and Solana, for testing or auditing. According to the team, LayerZero will deploy an endpoint on the Solana mainnet this quarter.
According to Ryan Zarick, co-founder and CTO of LayerZero Labs, the number of smart contracts on LayerZero's parallel testnets continues to grow, with over 7,000 smart contracts deployed as of August.
- Stargate
Based on LayerZero's full-chain interoperability, its ecosystem can create more super applications, such as its first full-chain cross-chain bridge protocol, Stargate. Stargate primarily focuses on cross-chain assets like USDC, USDT, and ETH, featuring unified liquidity and fast transaction finality. It is a demonstrative ecological project created by the founding team of LayerZero based on the LayerZero full-chain interoperability protocol, with a total TVL of approximately $500 million.
- Gh0stly Gh0st
Additionally, LayerZero's omnichain ambition also supports full-chain NFTs, leading to the launch of the Omnite protocol based on smart contracts, allowing users to convert any NFT token into the ONFT standard, which supports transferring NFTs from one network to another.
This protocol supports tokens created using the quick launch version of Omnite (hereinafter referred to as "native tokens") as well as all other NFT tokens created under the ERC721 standard since the establishment of the blockchain network. The Omnite protocol addresses four major issues affecting the transfer of NFT tokens between the internet: centralization, complex token transfer processes, excessive transaction fees, and long wait times. The process of transferring tokens between networks is entirely based on smart contracts, requiring no additional steps from the user's perspective, although this is not the case when transferring NFT tokens within the same network.
Currently, the first full-chain NFT project in its ecosystem is Gh0stly Gh0st.
Gh0stly Gh0st was launched in April this year, supporting releases on seven different blockchains (Ethereum, Polygon, Arbitrum, Optimism, BSC, Avalanche, Fantom) from the very beginning. The 7,710 ghosts will actually be distributed across seven different chains, and can be minted and transferred on any of the seven chains. The original chain (i.e., the mint chain) and the current chain will affect the background color and border color of the NFT, while its actual floor price will depend on the market conditions across all seven chains.
Since the launch of Gh0stly Gh0sts based on LayerZero's Omnichain NFT, other projects like Holograph, Tiny Donos, and Yakuza Pandas have also launched Omnichain NFTs based on LayerZero.
- Full-Chain DEX SushiXSwap
SushiXSwap is the "upgraded" decentralized exchange launched after LayerZero's integration with SushiSwap.
SushiXSwap is built on Stargate, allowing users to swap DAI on Ethereum for AAVE on Polygon without leaving the Sushi interface. Users can pay gas fees for both the source and destination chains in one go and provide additional assets for future gas fees on the target chain in a single transaction. Stargate is built on LayerZero's universal messaging protocol. Cross-chain composable bridges can directly integrate with any dApp on any chain.
- Angle Protocol
Angle is a decentralized, capital-efficient, and over-collateralized stablecoin protocol pegged to the Euro, launched in November 2021, aimed at establishing a decentralized monetary layer to power a fully open financial ecosystem and support DeFi users on every chain. In August this year, it integrated with LayerZero to upgrade agEUR through LayerZero's full-chain OFT standard, allowing agEUR holders to seamlessly transfer agEUR between Ethereum, Polygon, Optimism, and Arbitrum without leaving the Angle interface.
In addition to full-chain DEXs and full-chain NFTs, LayerZero also has greater imaginative potential and more anticipated applications, such as full-chain yield aggregators, cross-chain lending, and full-chain NFT cross-chain bridges.
3. Latest Developments
- On September 8, LayerZero launched the full-chain (omnichain) block explorer LayerZero Scan, allowing users to view their transactions based on the LayerZero protocol without having to check multiple block explorers.
- Updated the developer-friendly ULNv2 library. ULNv2 includes necessary support for upcoming non-EVM compatible chains, LayerZero Scan, and gas efficiency improvements of over 20%, while also patching ULNv1 security issues related to potential chain path problems.
- Since the launch of the mainnet in April, LayerZero has sent over 468389 full-chain messages, and the ecosystem is gradually deploying DeFi projects, including the decentralized exchange Hashflow.
- In August, integrated with protocols like Moonbeam and Clearpool.
- LayerZero is expanding into the Asia-Pacific region, and the team is focusing on developing this region and plans to support local teams and projects .
4. Conclusion
Currently, Web 3.0 and blockchain need a data transmission layer similar to the TCP/IP protocol to continue deepening the network revolution. LayerZero has the ambition to connect and link all networks and blockchains. Although it is challenging, LayerZero may become the definitional standard bearer for the Layer 0 data transmission layer and even an important infrastructure for the entire blockchain industry.