Intern Notes #3/ Layer Zero Whitepaper
This post is a little technical because it is a summary of the LayerZero whitepaper, not a podcast/space
You can view the web version here for a more complex sort and filtering Zettelkasten system with a bonus graph view. My notes were originally written for the Zettelkasten, and then copied over here, so there might be formatting issues below.
This is a summary of the whitepaper in the URL above.
Layer Zero - 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 gets to do 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.
Core pillars of blockchain - Decentralization, Transparency, Immutability
Liquidity/developers/users are walled within an blockchain
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
Layer Zero, 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
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
Smart Contracts which implement 4 modules which basically share information with each other:
Libraries - each new chain is an added library 1 Endpoint for each chain.
Can be any oracle to read a block from one chain and send to another
Expected to be Chainlink as industry leader
Off-chain service that fetches proof for a specific transaction
similar to oracle but for proof of transaction)
Simplified Version with less jargon
Person A on Chain A wants to send a
messageto Chain B using an application. Application tells the Communicator A relevant details about where the
messagewants to go
Communicator A tells Validator A that there is a
messageto 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
messageon 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
messagefrom 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
messageand message transaction proof to Validator B
Validator B gets both the
messageand message transaction proof, and checks if the proof and the block header H it received in step 9 matches. If yes, send
Communicator will send
messageto App B.
Cross Chain Bridge (https://stargate.finance/)
Multi-Chain Yield Aggregator
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.
Update: Stargate finance used Layer Zero as to create a cross chain bridge. Seems like there is some time required to get from one token to another. Since it depends on transaction finality, I wonder if it would be faster to go from avax to other chains, since avax has almost instant finality. Let me know!