laitimes

LayerZero V2 is officially unveiled, what are the updates in the new version?

author:MarsBit

Yesterday evening, Beijing time, LayerZero released the V2 version update and said that it will deploy the V2 version "endpoint" on more than 40 chains supported by the V1 version. In a blog post about the V2 release, LayerZero wrote:

LayerZero enables developers to create and configure unified applications, tokens, and data primitives through the transmission of arbitrary messages, regardless of the chain. As with TCP/IP standardized internet development, LayerZero's goal is to standardize all on-chain application development. This unified concept of cross-chain development is summarized as "omnichain" and is LayerZero's vision for the future of cryptocurrency.

LayerZero is a protocol designed to connect blockchains while adhering to the following basic principles:

No permissions: Anyone can run the infrastructure needed to authenticate and execute messages. Anyone can build and interact with LayerZero.

Censorship-resistant: None of the messages can be executed until all previous messages have been verified, which means that none of the messages can be censored in any way.

Immutable: The endpoint on each chain exists in the form of a smart contract. New verification libraries can be added as add-only updates. These libraries are not upgradeable and will exist permanently.

Until now, LayerZero has been criticized for its centralization, but how does the latest V2 version optimize for this common skepticism in the market?

What is LayerZero V2

LayerZero is a messaging protocol, not a blockchain. LayerZero leverages smart contracts deployed on each chain, combined with a decentralized verification network (DVN) and executors to enable different blockchains to interact with each other.

In LayerZero V2, message validation and execution are split into two distinct phases, giving developers more control over application security configuration and independent execution. Combined with improved processing, message throughput, programmability, and other contract-specific improvements, LayerZero V2 provides a more flexible, performant, and future-proof messaging protocol.

New ways of security and enforcement

LayerZero V2 provides immediate improvements to existing applications deployed on Endpoint V1, while also providing new features that enhance the creativity and scalability of full-chain applications deployed on new Endpoint V2. Apps deployed on Endpoint V1 can get two major improvements in application security and enforcement by migrating their app's message library to Ultra Light Node 301. Please refer to the Migration Guide for more information.

「X of Y of N」消息验证

The new Ultra Light Node 301 (V1) and Ultra Light Node 302 (V2) allow app owners to configure a custom security stack to select a different set of DVNs to validate the payload hash on the destination MessageLib. A subset of all of these DVNs (X) must validate the payload hash, while a threshold (Y) for an optional set of DVNs (N) must also validate the same payload hash before the packet can be delivered. Now, OApp owners can leverage multiple validation models to achieve the required security and cost-effectiveness, depending on their application needs. You can select the following DVNs at startup, or you can create them without a license:

LayerZero Labs(默认):由 LayerZero Labs 维护的默认 DVN。

Google Cloud (default): The default DVN powered by Google Cloud.

Nethermind: An elastic DVN hosted by Nethermind that enables businesses and developers around the world to access and develop on a decentralized web.

Delegate: A DVN maintained by Delegate, the development team behind trusted on-chain security tools used by projects such as Azuki, BAYC, Squiggles, and RTFKT.

Tapioca: Pearlnet is a DVN built for the TapiocaDAO ecosystem, enabling OApps to control their own modular verification network.

Animoca: DVN maintained by Animoca Brands, a leader in gamification and blockchain.

Blockdaemon: A DVN maintained by Blockdaemon that utilizes the team's unique monitoring and alerting system to ensure optimal uptime. Blockdaemon's infrastructure guarantees institutional-grade security and is ISO27001 certified.

Gitcoin: A DVN run by Gitcoin, an Ethereum-native public product development team.

Polyhedra zkLightClient: Using Polyhedra's zkBridge, message data can be retrieved and validated so that application developers can secure messaging with zero-knowledge proofs.

P2P: DVN powered by P2P.org, P2P.org is a continuous PoS validator and RPC node provider since 2018.

Obol: A DVN maintained by Obol, the team that drives the development and adoption of composable, Ethereum-aligned, distributed validator middleware through the Obol network.

StableLab: DVN operated by StableLab, a leader in professional empowerment, governance framework design, and DAO product development.

Axelar DVN Adapter:将 DVN 适配器接入 Axelar 进行身份验证。

CCIP DVN Adapter: A DVN adapter that uses CCIP for message authentication.

Independent message execution

In LayerZero V1, the relayer handles both the validation and execution of messages:

Oracles: Handle the validation of message block headers.

Repeater: Handles the verification of tx-proofs and the execution of messages.

In LayerZero V2, the validation of messages is now handled by the security stack, while execution is performed by the executor:

Security Stack: The (X of Y of N) DVN selected by your app.

Executor (optional): Applies the selected automatic invoker to receive messages.

For new apps deployed on Endpoint V2, the caller is completely permissionless.

New Protocol Contract

In addition to the new message library, LayerZero V2 also includes improvements to the core protocol architecture.

Developers can deploy applications using the Endpoint V2 contract standard to gain higher message throughput, better programmability, and more simplified contracts.

Optimized message processing

Because the V2 protocol separates the validation and execution of messages, it is now possible to execute message nonces out of order while still remaining censorship resistant:

Verified: The nonce of the message bundle has been successfully verified and is waiting to be executed.

Delivered: The message was successfully executed and received by the destination app.

In V1, by default, if a message sent fails to be executed at the destination, the path will be blocked by a "storedPayload" event, temporarily stopping the execution of all subsequent messages.

By default, subsequent message flows now continue to be delivered and executed even if the previous message failed to execute.

By configuring Ordered Message Delivery, you can still enable ordered execution at the app level.

Higher information throughput

This Unordered Message Delivery improves on-chain nonce tracking by using Lazy Inbound Nonce and Inbound Nonce as a guide to where to attempt to execute the message, providing the highest possible message throughput (i.e., the chain itself).

Lazy Inbound Nonce: The highest execution rate of the nonce in the system.

Inbound nonce: The latest verified message nonce, all previous nonce have also been verified.

Because nonces must be validated before they can be executed, the system enables LayerZero V2 to validate and non-losslessly execute out-of-order packets, simplifying the information execution process without compromising censorship resistance.

Improved programmability

LayerZero V2 also significantly improves programmability in several ways:

Simplified Protocol Contract Interface: The improved contract interface in LayerZero V2 simplifies message routing and processing, reducing the complexity of sending and receiving messages through the protocol. Developers can work more confidently and efficiently.

Path-specific libraries: The path-specific libraries in Endpoint V2 enable developers to configure different MessageLibs for specific paths, from source to destination, providing greater flexibility and customization for their apps.

Horizontal composability: The new sendCompose and lzCompose interfaces translate external calls into new message packets, allowing applications to maintain a clear separation between the logic that processes message reception (lzReceive) and the logic of the external calls themselves (lzCompose). This ensures that each step is executed correctly and independently of the others, allowing for strong cross-chain interactions.

Simplified contracts

LayerZero V2 introduces several improvements to improve gas efficiency for developers and users when interacting with LayerZero contracts. These improvements include:

Optimized the base contract: All LayerZero contract standards have been restructured to reduce the gas cost of the base contract.

Compiler efficiency: Improvements to the contract allow for better compiler optimization, which in turn reduces gas costs for deployment and execution.

Chain compatibility

V2 also greatly improves chain compatibility, further enhancing the ability of developers to develop versatile, efficient full-chain applications on a wider range of blockchains.

"Chain-agnostic" design: The protocol defines the isolation between the composition contract calls (compositionSend is used to store data, lzCompose is used to compose the contract). This enables developers to build more uniform application designs on blockchains with different environmental assumptions, such as a lack of runtime scheduling. This is important to achieve broad compatibility with non-EVM chains and to unify the OApp interface on each chain.

Improved Gas payment options: During deployment, terminals can now specify alternative gas tokens on a given chain. This flexibility applies to blockchains that may have unique gas mechanisms or charging models.

Specific library defaults: Endpoints now support a different default library for each chainpath. This capability enables leaner and more efficient message processing based on the specific characteristics and unique requirements of each chain pair.

These improvements provide a more on-chain approach to message processing, helping OApp developers design a single application architecture that can be unified across EVM and non-EVM chains.

Consistent safety standards

Application-level control: While app contracts can choose from predefined default settings, LayerZero gives you the option to configure your app's settings for each path, providing unmatched flexibility and security.

Immutable Core Contracts: LayerZero only uses immutable core contracts. This provides developers with a connection that can interact in a stable, predictable manner over the long term, ensuring that security and reliability are not compromised by external updates.

Backward compatibility: LayerZero's on-chain message base is immutable and can never be removed or discarded. LayerZero is always backwards compatible with previous versions of MessageLib.