Saturday, December 2, 2023

Join the club

top

LayerZero, now live (in beta)

tl;dr Summary: LayerZero, the world’s first omnichain protocol, is now in beta. The question of interoperability between different chains is an important one, and LayerZero believes it might have the answer. 

The world’s first omnichain interoperability protocol, LayerZero, is now live in beta. According to Ryan Zarick, Co-founder and CTO at LayerZero Labs, “LayerZero will connect all chains seamlessly, having users unaware that they are even using it.”

He believes that LayerZero will usher in a new omnichain revolution paving the way for omnichain dApps (distributed applications). 

But what is LayerZero, and what does an omnichain interoperability protocol mean?

What is LayerZero?

With 115 layer 1 protocols in existence at the time of writing this article, the blockchain ecosystem is fragmented and siloed. Each blockchain is built with a goal in mind making them all different. This is a good thing as it gives application developers options to choose the right chain for their projects. 

This has also created problems. Users find it increasingly difficult to move their tokens/assets across chains, and developers have to grapple with concerns over interoperability between these chains. 

This is where LayerZero comes in. LayerZero is a set of smart contracts that form a communication framework for applications on different chains to talk to each other. 

The architecture of LayerZero enables communication, not only between two chains, but multiple chains simultaneously.

But isn’t LayerZero just a better bridge? Not at all. The LayerZero whitepaper proposes a general communication layer, a messaging protocol wherein the transactions and the assets are native to each chain. Bridges are just a type of application that can now be built on top of LayerZero to utilize its capability. 

So essentially, you have layer 1 chains that maintain the ledger and layer 2 chains that are used as scaling solutions and now you have LayerZero which allows for seamless communication between any chain.

Source: https://layerzero.network/pdf/LayerZero_Whitepaper_Release.pdf

How does LayerZero work?

To understand how LayerZero works, let us first consider a scenario where a user wants to transfer tokens from one chain to another. For example, if a user wants to move ETH tokens from the Ethereum blockchain to AVAX tokens on the Avalanche blockchain. 

To do this at the moment, a user has to either use a centralized exchange like Coinbase or a cross-chain decentralized exchange (DEX) like Uniswap, both requiring a compromise.

For the compromises, in the case of a centralized exchange, the user has to trust the exchange that is contrary to the trustlessness fundamental of a blockchain also, since these exchanges are not done on-chain, they are insecure.

With a DEX the issue of trustlessness is reduced since these exchanges are done on-chain but it involves converting the user token into an intermediate token (the native token of the DEX) and then converting this token back to the desired token. This process adds additional overhead that translates to slow speed and more cost for the user. 

LayerZero, with its novel communication framework, will help dApps like DEXs to remove this overhead.

The components of LayerZero include:

  1. LayerZero Endpoints. An Endpoint is an interface between a dApp and LayerZero. Each blockchain has its own Endpoint. 
  2. The Oracle, which is a third party service (for example, Chainlink)
  3. The Relayer, which is another service required to fetch proof for transactions.

The main point of this architecture is that the Oracle and the Relayer services are two independently working services required to corroborate the transaction. Since these are independent services, the chances of both of them maliciously colluding are also negligible. This makes it secure, and you do not need to worry about trusting LayerZero as the question of trust is simplified to the independent working on these two.

Even if there was collusion between the Relayer and the Oracle, the risk is only borne by dApps accepting messages from the specific Oracle and Relayer pair. This compartmentalization of risk is an important step forward compared to other cross-chain projects. 

Source: https://layerzero.network/pdf/LayerZero_Whitepaper_Release.pdf

Comparison with other cross-chain projects

Let us see how LayerZero compares with some popular cross-bridge projects and protocols: 

  1. Polkadot: There are design differences between the two. Every inter-chain transaction in Polkadot must travel through a backbone called a relay chain. This adds to the cost of that transaction, unlike LayerZero, which provides the same low-level communication without the need for extra transactions.
  2. THORChain: Since this is a DEX, it converts the user token to its native token called RUNE and then back to the required token. These additional transactions add to the complexity and cost for the user, unlike LayerZero.
  3. Cosmos: Cosmos provides communication only between a group of chains called fast-finality chains, whereas, LayerZero, has no such limitation.

Possible applications on LayerZero

LayerZero, being an inter-chain communication protocol, presents countless possibilities. Here are some of the most common ones:

  1. Cross-Chain DEX: As we have seen above, LayerZero provides a much simpler alternative to existing DEXs which use intermediate tokens, bridging, and wrapping. 
  2. Cross-Chain Yield aggregators: Yield aggregators currently work within single-chain ecosystems and so cannot take advantage of opportunities outside this chain, potentially losing on best yields. With LayerZero as the backbone, it will become easy for yield aggregators to hop from one chain to another.
  3. Multi-Chain Lending: Currently, a user must have the native asset on every chain they want to interact with. If, for example, a user with ETH on Ethereum wants to farm on Avalanche, they would have to go through a series of steps involving bridging and swapping of assets between ETH and AVAX. This is not only time-consuming but expensive as every bridge and swap will incur a fee. With LayerZero, there is no need for bridging and swapping, which makes the entire process simpler, faster, and cheap.

Future of LayerZero

With seemingly endless possibilities, it is not a surprise that many see a great future with LayerZero. 

Recently they released Stargate, the first dApp based on LayerZero that allows users to swap any asset between any chain in a single window which showcases the power of LayerZero.

One thing is certain, these are exciting times, and we need innovations like LayerZero for Web3 to be more user-friendly.

Author

Related Articles

Enroll now

Latest Articles