Skip to main content
LayerZero is an omnichain interoperability protocol that provides a stable, immutable interface for crosschain messaging. By separating interface, verification, and execution into independent layers, LayerZero enables composable crosschain architectures without compromising security.

Architecture: Five Independent Layers


Each layer has one job. They work together but remain independent.

1. Business Logic Interface (OApp)

Omnichain Applications (OApps) are LayerZero’s definition for smart contracts that use LayerZero to send and receive crosschain messages. Building on Module 1’s data messaging concepts, the LayerZero protocol allows applications to define any custom data as bytes and send them as crosschain messages. The OApp standard provides a consistent application interface for invoking the LayerZero protocol with this custom business logic:
The OApp standard acts as a facade that wraps the raw LayerZero protocol interface with developer-friendly methods. Instead of calling endpoint.send() and endpoint.lzReceive() directly, OApps use _lzSend() and _lzReceive() which handle common patterns like fee quoting, message validation, and error handling. Your application code focuses on business logic (encoding/decoding custom data, state transitions, etc.) while the OApp facade manages protocol interaction.

2. Protocol Interface (Endpoint)

The LayerZero Endpoint serves as the single entrypoint and exitpoint for all crosschain messaging on a blockchain. Each chain has one LayerZero Endpoint contract that can send and receive messages between any other LayerZero Endpoint contract on any supported chain. The Endpoint provides the universal, immutable protocol interface:
Because every LayerZero Endpoint is immutable and permissionless to interact with, anyone can use a LayerZero Endpoint for crosschain messaging without requiring authorization, integration approval, or dependency on external bridge operators. This creates a fully independent transport layer that, as we’ll expand on in later sections, serves as the ideal crosschain messaging interface for nearly all crosschain applications. The immutable nature ensures that the interface will never change, providing permanent compatibility for applications built on LayerZero. The permissionless design means no gatekeepers can restrict access or censor transactions, creating a truly open crosschain infrastructure. Key Properties:
  • Universal: Same interface on every supported chain
  • Immutable: Cannot be upgraded or changed
  • Permissionless: Anyone can call (with proper fees)
  • Chain-agnostic: Works across EVM, Solana, Aptos, etc. (see non-EVM sections for specific sister implementations)

Channels: OApp-to-OApp Communication

A channel in LayerZero is uniquely defined by four components:
  • Sender OApp: The contract initiating the message
  • Source Endpoint: The LayerZero endpoint on the source chain
  • Destination Endpoint: The LayerZero endpoint on the destination chain
  • Receiver OApp: The contract receiving the message
Each unique combination creates an independent channel with its own configuration:
Note: Channel 3 shows the pull messaging pattern where data is queried directly from target contracts without involving the destination chain’s LayerZero endpoint. We’ll expand on this lzRead functionality in future modules.

Channel Identification

In practice, each channel can be identified from a source chain using only the destination Endpoint ID (EID) and receiver contract address. The source EID is already known (stored in the local Endpoint) and the caller is the OApp making the request, simplifying pathway management:
Custom Channel IDs: For lzRead pull-messaging, the sender and receiver are the same OApp (request/response pattern). Since we need to distinguish read requests from standard push messages to the same contract, we use arbitrary channel IDs:

Channel-Specific Nonce Tracking

Each channel maintains its own independent nonce sequence, enabling parallel messaging without ordering conflicts: Benefits of Per-Channel Nonces:
  • Parallel messaging: No ordering dependencies between different channels
  • Independent scaling: High-traffic channels don’t block low-traffic channels
  • Replay protection: Each channel has its own sequence for security
  • Channel isolation: Message ordering only matters within the same communication pathway

Message Packet Generation Per Channel

When applications send messages, the Endpoint wraps the raw message data in a standardized packet container with channel-specific metadata. Based on the EndpointV2 implementation:
Key Properties:
  • Nonce: Sequential per channel for ordering and replay protection - each channel maintains its own nonce sequence
  • GUID: Globally unique identifier generated from channel components + nonce
  • Channel identification: (sender, srcEid, dstEid, receiver) uniquely identifies the communication pathway
  • Message isolation: Raw application data separated from protocol metadata

Managing Channel Configuration

The Endpoint provides the interface for managing channel configurations via modular Message Libraries:
Each OApp can configure libraries to define the messaging behavior for its specific channels. These libraries determine how messages are verified, executed, and delivered for that OApp’s communication needs.

3. Configurable Protocol Libraries (Message Libraries)

Message Libraries are onchain rulesets that handle how messages are sent off-chain and arrive onchain between Endpoints. They define the complete workflow: message processing, verification requirements, and delivery coordination while maintaining the universal Endpoint interface.

Message Library Types & Workflows

Message Libraries can define different workflows and have specialized roles, such as Sending, Receiving, or Reading crosschain state:

Push Messaging Workflow (Send/Receive ULN)

Pull Messaging Workflow (Request/Response lzRead)


Different libraries enable OApps to handle different channel types with distinct behaviour, security, and delivery characteristics. Each channel represents a unique communication pathway between specific OApps with configurable message processing rules. LayerZero Labs may deploy new libraries with different workflows, features, or versions to enable developers to opt into new changes per channel.

Channel-Specific Library Configuration

Each channel gets unique settings through a two-step process from the Endpoint:
  1. Library Selection: Use setSendLibrary/setReceiveLibrary to assign specific libraries per channel
  2. Library Configuration: Use setConfig to customize each library’s settings per channel
This creates truly independent channel configurations - the same library type (e.g., SendUln302) can have completely different verification, finality, and execution settings for different channels. Each unique combination creates an independent channel setting with its own library configuration:

What Can Be Configured Per Channel

Message Libraries enable three main types of configuration for each channel:
  • Finality: How many block confirmations are required before verification begins
  • Verification: Which verifier networks must verify messages and in what combinations
  • Execution: Which execution services deliver messages and with what parameters

X-of-Y-of-N Verification Coordination

LayerZero libraries today use an X-of-Y-of-N configuration pattern for verification, where:
  • X: Required verifier networks that MUST always verify (non-fungible)
  • Y: Total verifications needed (required + threshold of optional)
  • N: Total pool of available verifier networks
Example: 2-of-4-of-6 configuration
  • 2 specific networks must always verify (X = required)
  • 4 total verifications needed (Y = required + optional threshold)
  • 6 networks available in the pool (N = total options)
  • Any 2 of the remaining 4 optional networks can provide the additional verifications
Each “verifier network” is an independent verification system that implements one of the verification approaches from Module 1 (ZK proofs, committee consensus, light clients, etc.). This creates a quorum of quorums - each network must reach its own internal verification criteria before contributing to the overall X-of-Y-of-N requirement.

Example: 2-of-2-of-2 Verifier Networks


This simple 2-of-2-of-2 configuration shows two required verifier networks with no optional networks.

1-of-2-of-3 Verifier Networks


This 1-of-2-of-3 configuration shows 1 required verifier network (solid border) and 2 optional verifier networks (dashed borders). Only 1 of the 2 optional networks needs to verify, providing flexibility while maintaining the required verification.

Configuration Per Channel

Message Libraries enable each channel to specify different X-of-Y-of-N configurations based on security requirements:
Each channel’s Message Library enforces these X-of-Y-of-N requirements onchain, ensuring that the specified verification pattern is met before message execution.

Configuration Structures

Message Libraries define specific configuration structures for the three configurable aspects:
Note: The configuration structures reference “DVNs” (Decentralized Verifier Networks) and “Executors”. You don’t need to understand their implementation details yet - just know that DVNs help determine which verifier networks to select, and Executors handle message delivery. Both will be explained in detail in Module 4: Verification & Execution Services.

Push Messaging Configuration (ULN)

Pull Messaging Configuration (lzRead)

Key Insight: Message Libraries are the onchain glue that makes verifier networks and delivery services pluggable while maintaining security guarantees. Different libraries can implement completely different messaging paradigms and verification requirements.

Crosschain Services (Workers)

Message Libraries coordinate two types of off-chain worker services that handle verification and execution:

4. DVNs (Decentralized Verifier Networks)

DVNs are LayerZero’s official term for the “verifier networks” discussed in previous sections. Each DVN is an independent verification service that implements one of the verification approaches from Module 1 (ZK proofs, committee consensus, light clients, middlechains, etc.). Key Properties:
  • Independent operation: Each DVN runs its own verification logic
  • Configurable per pathway: Different DVN sets per channel
  • X-of-Y-of-N coordination: Multiple DVNs work together via Message Library rules
  • Verification diversity: Different DVNs use different trust models and verification methods

5. Executors

Executors are permissionless services that deliver verified messages to destination chains. Anyone can run an executor, making message delivery competitive and censorship-resistant. Key Properties:
  • Permissionless: Anyone can operate an executor
  • Competitive: Multiple executors compete on speed and cost
  • Optional: Applications can opt out and execute manually
  • Separation from verification: Executors deliver, DVNs verify

Worker Service Architecture

Coordination: Message Libraries define the rules, DVNs verify according to X-of-Y-of-N configurations, and Executors deliver once verification requirements are met. This separation enables independent scaling and competitive markets for both verification and execution services. For detailed implementation, configuration examples, and provider information, see Module 4: Verification & Execution Services.

Exit Criteria

Before proceeding to Module 4, you should be able to:
  1. Describe the four layers (application, endpoint, libraries, workers)
  2. Explain what DVNs do and how to configure them
  3. Show how to set different verification per route

See Also