Layer Zero Whitepaper
Author(s):
Ryan Zarick,
Bryan Pellegrino,
Caleb Banister
Submitted on:
26-05-2021
Written on:
16-03-2022
URL: https://layerzero.network/pdf/LayerZero_Whitepaper_Release.pdf
This is a summary of the whitepaper in the URL above.
TLDR
LayerZero - a Trustless Omnichain interoperability protocol
- Allows 2 separate blockchains to communicate using 2 independent components
- Basically, you get these two independent components to make sure the transactions are valid from the sender before the receiver decides to anything
- General communication layer, NOT a blockchain
- Touts benefits of being less complex, less overheads, and being able to extend to any blockchain without being hindered by its native SDK.
Introduction
Core pillars of blockchain - Decentralization, Transparency, Immutability
Problem
Liquidity/developers/users are walled within an blockchain
Bandaid measures:
- use of centralized services (such as
Binance)
- Does not align with Trustlessness of blockchain
- use of
Cross Chain Bridges such as
AnySwap or
THORChain
- Relies on protocol specific intermediate tokens or intermediate consensus layers
Solution
LayerZero, a communication primitive, allows transactions between multiple blockchain using
- allows transactions between multiple Layer 1 or Layer 2 chains.
- Intuition: if two independent entities can corroborate the validity of a transaction, then Chain B can be sure the transaction from Chain A is valid
Related Work
- Ethereum - original
Ethereum Virtual Machine chain, but low 15-45tps makes it hard to scale
Polygon - Layer 2 Sidechain - PolkaDot - Parachains are interlinked via a common relay chain. However there is additional cost when using this relay chain
- THORChain - Uses pairwise liquidity pools to bind 3rd party currency to $RUNE. While authors acknowledge it solves the scalability problem, it is cumbersome to use as a simple transaction can be quite complicated
- AnySwap - Decentralized Exchange which relies on intermediate token $ANY , similar to THORChain. Similar issues too
- Cosmos -
Inter-Blockchain Communication built on
Tendermint BFT which allows messaging between chains built on the hub
- Inter-Blockchain Communication requires a full on chain Light node of each chain
- Only provides direct communication between fast finality chains
- Gravity Bridge - AnySwap and Cosmos equivalent
- Chainlink - Framework for building
How does LayerZero Work?
Communication protocol which provides trustless Valid Delivery
Components
Endpoints
Smart Contracts which implement 4 modules which basically share information with each other:
- Communicator
- Validator
- Network
- Libraries - each new chain is an added library 1 Endpoint for each chain.
Oracle
Can be any oracle to read a block from one chain and send to another
Expected to be
Chainlink as industry leader
Relayer
Off-chain service that fetches proof for a specific transaction
- similar to oracle but for proof of transaction)
Steps
Simplified Version with less jargon
- Person A on Chain A wants to send a
message
to Chain B using an application. Application tells the Communicator A relevant details about where themessage
wants to go - Communicator A tells Validator A that there is a
message
to be validated - (step 3 and 4 happen concurrently) Validator A tells Network A that the block header H needs to be sent to Chain B
- (step 3 and 4 happen concurrently) Validator A tells Relayer A that he needs the proof that the
message
on Chain A has been sent. - Network A tells Oracle to send current block header H of Chain A to Chain B
- (step 6 and 7 happen asynchronously) Oracle gets current block header H from Chain A
- (step 6 and 7 happen asynchronously) Relayer gets the message transaction proof of the
message
from Chain A, and stores it off-chain - Oracle confirms that the block referred to by block header H is finalized, then sends H to Chain B
- Network B receives the block header hash, and gives it to Validator B
- Validator B sends the hash to Relayer B
- Relayer B sends the
message
and message transaction proof to Validator B - Validator B gets both the
message
and message transaction proof, and checks if the proof and the block header H it received in step 9 matches. If yes, sendmessage
to communicator. - Communicator will send
message
to App B.
Application
Example transactions
Refer to this
tweet here.
The
Ethereum message was sent at Mar-15-2022 05:46:00 PM +UTC
- Ethereum received message 5 min later at 05:55:16 PM +UTC
- Fantom received message 8 min later at 06:03:19 PM +UTC
- Polygon received message 2 hours later at 07:51:29 PM +UTC
- Optimistic received message 2.5 hours later at 08:27:13 PM +UTC
- Avalanche received message 2.5 hours later at 08:27:19 PM +UTC
- Arbitum received message 2.5 hours later at 08:26:25 PM +UTC
- BNB Chain received message 2.5 hours later at 08:27:19 PM +UTC
Seems like interchain communication still takes some time (up to 2.5 hours). Personally not sure if i would wait 2.5 hours to bridge when there are much faster alternatives. Let me know if i interpreted this wrongly