July 2023 – LayerZero

  1. Introduction
  2. LayerZero
  3. Architecture
  4. Valid Delivery
  5. Transaction Mechanism
  6. Security
  7. Conclusion


Application specific needs has given us a rapid increase in the number of blockchains present in the blockchain industry but making inter-chains transactions has been a long time problem. Each chain is isolated. There have been solutions like using a centralised authority to facilitate the transaction between two chains or a new decentralised chain specifically connecting two different chains. But these come with the problem of centralisation (which defeats the whole purpose of blockchain) and complex processes including high cost respectively. This is making it difficult to adopt and accessible to more users. LayerZero aims to provide the solution to this problem.


To make sure that all blockchains are inter-connected, LayerZero proposes a trustless omnichain interoperability protocol. It can support transactions on both layer 1 and layer 2 chains. LayerZero is like a fabric between two chains assisting the transaction. The chains in the LayerZero library have a LayerZero endpoint which can communicate with each other directly by transferring the transaction or messages directly through the LayerZero fabric. No intermediary is hence required.


The figure explains the architectural advancement that LayerZero provides. The traditional way to do a cross chain transaction involves using a centralised exchange (CEX) or using a decentralised exchange (DEX). The problem with CEX is it defeats the whole purpose of using a blockchain by putting a central authority in charge of the transaction on the different chains.
To counter this we saw the advent of DEX which uses an intermediate chain between the two chains in order to process and complete the transaction. But this means that the user has to do two transactions in order to receive the required token. One between chain A and the intermediate chain and the other between chain B and the intermediate chain. This process is not only complex but it costs more.

The exchanges built on LayerZero solve the problem of high cost and decentralisation. The chains compatible with LayerZero have a LayerZero endpoint built on the chain. They can communicate with each other directly and can verify if the correct transaction has taken place or not. This reduces the complexity and the cost of the transaction. Moreover this is not only reduced to the exchanges, any type of transaction like messaging can be implemented using LayerZero. 

Valid Delivery

For chain B to verify if the transaction has really taken place on chain A, LayerZero uses the idea of valid delivery. This is the fundamental property of trustless inter-chain communication. It enables the cross-chain token transfer by providing the guarantees that every message m sent over the network is coupled with a transaction t on the sender chain and a message m is delivered to the receiver only if the transaction t is valid and has been committed on the sender chain.
In real practice, valid delivery ensures that if the block header and the transaction proof provided by the two independent entities match (Oracle and the Relayer), then the delivery of the transaction is valid. Otherwise the transaction is not valid. This ensures that the mechanism is highly secure as the statistical probability of a transaction proof and blockheader matching without knowledge of others beforehand is low.

Transaction Mechanism 

LayerZero provides trustless valid delivery. LayerZero endpoints are present on the compatible chains. Running a smart contract on layer 1 can be expensive so LayerZero uses the help of Oracle and Relayers to fetch and store the transaction data. The endpoints are implemented as a series of smart contracts that allows the chains to communicate with each other with each chain having its own library in the LayerZero system. Once deployed the endpoints are like smart contracts that cannot be shut down. This allows for an immutable flow of messages.

Then the oracle (here Chainlink) forwards the block header from chain A to chain B, while a separate relayer passes the translation proof from chain A to chain B. If the two match and the proof is valid, then the message is sent to the destination address. Basically, the relayer fetches the proof of a particular transaction. Anyone can be the relayer while using LayerZero. This helps to ensure that it is a decentralised system.

For example consider that a user application wants to send a message from chain A to chain B. The message is routed through the endpoint on chain A. The endpoint then notifies the oracle and relayer of the message and its destination chain. The oracle then forwards the block header to the endpoint on chain B, the relayer submits the transaction proof. The proof is validated on the destination chain, and the message is forwarded to the destination address.

Hence LayerZero allows for the transfer of messages between on-chain endpoints without the need for the full nodes or trusted intermediaries. This makes it a very efficient and scalable way to achieve cross-chain interoperability.


LayerZero breaks down the responsibilities of the oracle and the relayer. This allows LayerZero to leverage the security properties of established oracles (Chainlink and Band) and an additional layer of security through the open relayer system. The user application is free to use its own relayer and the oracle service.

This might look like a small difference but in the worst case the security of the network is as secured as the oracle. The preferred oracle used is Chainlink and any malicious attack in the system will first need to defeat the Chainlink decentralised oracle network (DON), which is not an easy task. Even after taking control of the oracle, the system will require the relayer to be corrupted too.

Let’s say that in the extreme case, the relayer and the oracle are compromised. Then the attacker will only be able to gain access to the funds used by the user application using the corrupted oracle and the relayer. The rest of the user application using different oracles and relayers will still keep running, being completely unaffected.

This is a massive transformation in the risk model from the previously described middle chain systems. LayerZero’s security model is more robust than the previous cross chain interoperability solutions because it relies on multiple independent parties to validate the messages. This makes it more difficult for the malicious actors to attack the network.


With the new requirement, we see some of the specific blockchains coming into the ecosystem. While they are useful to our needs, each blockchain was isolated. With the introduction of LayerZero, chains can now communicate with each other in a trusted, decentralised and cost efficient way.

The LayerZero protocol is simple to implement by the developers too which will just require a send and a receive function. It also uses ultra light nodes which is very efficient and helps in transferring the messages between endpoints quickly and cheaply. 

This basic piece of infrastructure can be utilised by multichain lending protocols,liquidity networks, multi-chain yield aggregators, other DeFi apps and many other dApps to build out unique and interesting multi-chain crypto solutions.