What is LayerZero?
LayerZero is an open-source, immutable messaging protocol designed to facilitate the creation of omni-chain, interoperable applications.
Developers can easily send arbitrary data, external function calls, and tokens with omni-chain messaging while preserving full autonomy and control over their application.
LayerZero V2 is currently live on the following Mainnet and Testnet Chains.
LayerZero is an immutable, censorship-resistant, and permissionless smart contract protocol that enables anyone on a blockchain to send, verify, and execute messages on a supported destination network.
Before LayerZero, to send anything to a new chain, most dApps used some type of monolithic bridge:
- Centralised Provider: a centralised entity, that manually delivers messages to the destination chain.
- Collection of Signers: a collection of different signers who verify the message before delivering.
- Middlechain Bridge: a blockchain which routes all messages through the hub chain, inheriting the security of the middlechain.
While each verifier network came with trade-offs, all suffered from one common problem: a single verifier network determined which messages would be delivered on the destination chain.
What is the Benefit of Using LayerZero as an Omni-chain Bridge?
Here are the advantages that LayerZero can offer in its product:
- LayerZero does not use the ‘Wrapping Asset’ mechanism, so assets originating from their original blockchain will arrive on the target blockchain intact without the need for a ‘Wrapping System’
- Many projects have already adopted LayerZero’s technology, increasing the confidence of users who are looking to use LayerZero protocol for the first time
- The network security level provided by LayerZero so far remains reliable, as there hasn’t been anyone able to breach the LayerZero network fully
Protocol of LayerZero
To send a cross-chain message, a user must write a transaction on both the source and destination blockchains.
A successfully deployed Omnichain Application (OApp) communicates with the LayerZero Endpoint contract to seamlessly send messages via the protocol from a source to a destination chain.
The OApp Contract Standard abstracts away the core Endpoint interfaces, allowing you to focus on building your application’s implementation and features without the need to implement functions at the protocol level.
How LayerZero Works?
- A user calls the _lzSend method inside the OApp passing an arbitrary message, a destination LayerZero Endpoint, the destination OApp address, and other protocol handling options. This call invokes the Endpoint’s send method on the same chain.
The Endpoint uses an on-chain Message Library (MessageLib) configured by the OApp owner to determine how to generate the Message Packet. The MessageLib ensures that the correct OApp Configuration specified by the contract owners will be used by the protocol.
After generating the packet using the correct configuration, the Endpoint emits the message packet as an event containing information about the target blockchain, the receiving address, message handling instructions, and the message itself.
- The Security Stack (as configured by the OApp) listens for the event emitted, awaits a specified number of block confirmations, and then verifies the payloadHash of the packet in the destination chain’s MessageLib. This payloadHash confirms that the contents of the Message Packet on the destination blockchain match the packet emitted on the source.
After the configured threshold of DVNs verifies the payloadHash on the target chain, the message’s nonce can then be committed to the Endpoint’s messaging channel by any caller (e.g., Executor) for execution.
- Finally, a caller (e.g., Executor) invokes the receive function in the destination Endpoint contract, triggering message execution.
It is impossible to use the Message Options interface to extend the verification scope to include additional data, but OApps can use it to detect and filter out verified yet malicious messages (e.g., buggy messages that would trigger OApp-level faults). We introduce our novel off-chain application-level security mechanism called PreCrime, which provides an additional layer of application-specific packet filtering on top of the existing LayerZero protocol.
Conclusion
LayerZero provides intrinsically secure cross-chain messaging with universal semantics to enable a fully connected omni-chain mesh network that connects all blockchains within and across compatibility groups. By isolating intrinsic security from extrinsic security, LayerZero guarantees long-term stability of channel integrity and gives OApps universal network semantics across the entire mesh network. LayerZero’s universal network semantics and intrinsic security guarantees enable secure chain-agnostic interoperation.
LayerZero’s isolation of execution features from packet verification allows a near-unlimited degree of freedom to implement additional features without affecting security. In addition, the separation of execution and verification in LayerZero reduces engineering costs, and attack surfaces, and improves overall protocol liveness.
Together, these components create a highly extensible protocol that can provide universal messaging semantics across existing and future blockchains. LayerZero is the protocol that brings consistency and simplicity to a landscape of scattered, ad-hoc messaging services and lays the foundation for the fully-connected omni-chain mesh network of the future.
Good News from LayerZero
- LayerZero is officially announcing its partnership with Monad!
- LayerZero has so many blockchain networks that connected to the protocol
- Airdrop is coming?!?!?!!?
Writer of the Article: Lydicius