> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerzero.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Decentralized Verifier Networks (DVNs) Overview

> Learn how DVNs work in LayerZero V2, including verification methods, implementation types, and the X-of-Y-of-N security model for cross-chain messaging.

LayerZero is an **interoperability protocol** that enables secure and seamless communication between different blockchain networks. At the core of LayerZero's security model are **Decentralized Verifier Networks (DVNs)**.

## What are DVNs?

DVNs are independent entities that **validate the authenticity and integrity of messages** sent across blockchains within the LayerZero ecosystem. They ensure that a message sent from a source chain arrives untampered at its destination.

In the context of the LayerZero protocol, DVNs provide:

* **Verification**: Verifying the hash (a unique digital fingerprint) of a LayerZero message emitted on a source chain.
* **Customizable Security**: Applications built on LayerZero can select any number or type of DVNs to achieve their desired level of cross-chain security. This flexibility allows for tailored security postures.

## How DVNs Work

A DVN is essentially a **smart contract** paired with off-chain infrastructure that provides its own inherent trust mechanism. When a message is sent via LayerZero:

1. The message is picked up by the chosen DVN(s) via the `PacketSent` event.
2. The DVN(s) independently verify the message hash using their unique security logic.
3. Upon successful verification, the DVN calls `verify` on the destination chain's Message Library.
4. Once all required DVNs have verified, the message can be committed and executed.

```mermaid wrap theme={null}
sequenceDiagram
participant OApp as Source OApp
participant SendLib as Send Library
participant DVN as DVN (Off-chain)
participant ReceiveLib as Receive Library
participant Executor

    OApp->>SendLib: _lzSend()
    SendLib-->>SendLib: Emit PacketSent
    SendLib-->>DVN: DVNFeePaid event
    DVN->>DVN: Wait for confirmations
    DVN->>DVN: Verify message hash
    DVN->>ReceiveLib: verify()
    Note over ReceiveLib: All required DVNs verified
    Executor->>ReceiveLib: commitVerification()
```

LayerZero is **agnostic to how a DVN is implemented**. This design allows for diverse verification approaches that can be tailored to specific security requirements.

## DVN Implementation Types

DVNs can use various verification methods to confirm message authenticity including, but not limited to:

| Implementation Type       | Description                                             | Example                   |
| ------------------------- | ------------------------------------------------------- | ------------------------- |
| **Multisignature**        | Requires multiple parties to sign off on a message hash | Custom multisig contracts |
| **Zero-Knowledge Proofs** | Uses cryptographic proofs to verify message validity    | Polyhedra                 |
| **Decentralized Oracles** | Leverages existing oracle networks for verification     | Chainlink                 |
| **Protocol Adapters**     | Wraps existing interoperability protocols               | Axelar, Wormhole          |
| **Light Clients**         | Verifies using blockchain consensus proofs              | Native bridge adapters    |

## DVN Operator Responsibilities

Regardless of implementation approach, DVN operators are responsible for:

1. **Chain Coverage**: Deploying DVN contracts on every chain they want to support
2. **Event Monitoring**: Listening for `PacketSent` and `DVNFeePaid` events on source chains
3. **Verification Logic**: Implementing secure verification of message hashes
4. **Transaction Submission**: Submitting verification proofs to destination chains
5. **Gas Management**: Maintaining sufficient gas tokens across all supported chains (unless using Gasolina)
6. **Fee Configuration**: Setting appropriate fees via `DstConfig` for each destination chain

## Implementation Paths

When building or operating a DVN, you have two primary implementation paths:

### Traditional DVN Implementation

The traditional approach gives you **full control** over your DVN but requires managing wallets, gas tokens, and transaction infrastructure across all supported chains. This path is ideal for organizations that need complete control over every aspect of their DVN operation.

**Best for:**

* Organizations with existing multi-chain infrastructure
* Custom verification logic requirements
* Full operational autonomy

<Card title="Build DVNs" icon="wrench" href="/v2/workers/off-chain/build-dvns">
  Learn more about building a traditional DVN implementation
</Card>

### Gasolina DVN

LayerZero Labs offers a simplified DVN implementation using **Gasolina**. This approach separates the security function (verification and signing) from the operational complexities (gas management and transaction submission), allowing DVN operators to focus purely on security while LayerZero's Essence service handles transaction delivery.

**Best for:**

* Security providers without multi-chain infrastructure
* Rapid deployment scenarios
* Teams wanting to focus on verification rather than operations

<Card title="Gasolina Overview" icon="gas-pump" href="/v2/workers/off-chain/gasolina-overview">
  Learn more about the Gasolina DVN approach
</Card>

## Protocol Integration

DVNs integrate with LayerZero through standardized interfaces that work across all supported virtual machines.

### EVM Interface

All EVM DVNs must implement the `ILayerZeroDVN` interface:

```solidity wrap theme={null}
interface ILayerZeroDVN {
    struct AssignJobParam {
        uint32 dstEid;
        bytes packetHeader;
        bytes32 payloadHash;
        uint64 confirmations;
        address sender;
    }

    function assignJob(AssignJobParam calldata _param, bytes calldata _options)
        external payable returns (uint256 fee);

    function getFee(
        uint32 _dstEid,
        uint64 _confirmations,
        address _sender,
        bytes calldata _options
    ) external view returns (uint256 fee);
}
```

| Function    | Type    | Description                                                                          |
| ----------- | ------- | ------------------------------------------------------------------------------------ |
| `assignJob` | Payable | Called by the Message Library when a packet is sent, paying the DVN for verification |
| `getFee`    | View    | Returns the fee for verifying a message to a specific destination                    |

### Solana Interface

Solana DVNs use a multi-step CPI (Cross-Program Invocation) based verification flow rather than a single interface. The verification process involves three key instructions:

| Instruction   | Program    | Description                                                             |
| ------------- | ---------- | ----------------------------------------------------------------------- |
| `init_verify` | ReceiveULN | Initializes a confirmations account to store DVN verification state     |
| `invoke`      | DVN        | Executes DVN verification logic (signature validation, multisig checks) |
| `verify`      | ReceiveULN | Finalizes verification and emits `PayloadVerifiedEvent`                 |

The core verification instruction signature:

```rust wrap theme={null}
impl Verify<'_> {
    pub fn apply(ctx: &mut Context<Verify>, params: &VerifyParams) -> Result<()> {
        ctx.accounts.confirmations.value = Some(params.confirmations);

        emit_cpi!(PayloadVerifiedEvent {
            dvn: ctx.accounts.dvn.key(),
            header: params.packet_header,
            confirmations: params.confirmations,
            proof_hash: params.payload_hash,
        });

        Ok(())
    }
}
```

For complete Solana DVN implementation details, see the [Solana Protocol Overview](/v2/developers/solana/technical-overview#verification-workflow).

### X-of-Y-of-N Security Model

OApps configure DVNs as part of their [Security Stack](/v2/concepts/modular-security/security-stack-dvns), using an X-of-Y-of-N model:

```solidity wrap theme={null}
struct UlnConfig {
    uint64 confirmations;        // Block confirmations required
    uint8 requiredDVNCount;      // X - all of these must verify
    uint8 optionalDVNCount;      // N - total optional DVNs
    uint8 optionalDVNThreshold;  // Y - threshold of optional DVNs
    address[] requiredDVNs;      // Addresses of required DVNs
    address[] optionalDVNs;      // Addresses of optional DVNs
}
```

This configuration allows applications to require:

* **All** required DVNs to verify (X)
* **At least Y** of the optional DVNs (N) to verify

***

## Summary

DVNs are LayerZero's flexible and customizable security layer for cross-chain communication. They enable applications to choose their security parameters while maintaining decentralization and trust minimization.

Whether you choose the traditional implementation path for full control or the Gasolina approach for operational simplicity, DVNs provide the critical verification layer that makes secure cross-chain messaging possible.

## Next Steps

### For DVN Operators

* Review the [DVN Contract Reference](/v2/workers/off-chain/dvn-technical-reference) for methods, events, and errors
* See [Build Decentralized Verifier Networks](/v2/workers/off-chain/build-dvns) for full implementation details
* Review the [Gasolina Overview](/v2/workers/off-chain/gasolina-overview) for the simplified approach
* Follow the [Implementation Guide](/v2/workers/off-chain/gasolina-implementation) to deploy Gasolina

### For Application Developers

* Learn how to [configure DVNs](/v2/concepts/modular-security/security-stack-dvns) in your OApp
* Understand [DVN pricing](/v2/concepts/protocol/transaction-pricing) and fee structures
* Explore existing [DVN providers](/v2/deployments/dvn-addresses) available on each chain

<Tip>
  If you're new to operating DVNs, we recommend starting with the Gasolina approach. You can always migrate to a traditional implementation later as your needs evolve.
</Tip>
