> ## 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.

# Gasolina Overview

> Learn about Gasolina, a DVN implementation that separates security functions from operational complexities, allowing DVN operators to focus on verification.

Gasolina is a DVN implementation approach that separates the security function (verification and signing) from operational complexities (gas management and transaction submission). This allows DVN operators to focus purely on security while LayerZero's infrastructure handles transaction delivery.

## The Challenge

Traditional DVN operation requires significant infrastructure:

* Maintaining funded wallets on every supported chain
* Acquiring and managing native tokens across diverse blockchains
* Building and maintaining reliable transaction submission systems
* 24/7 monitoring of gas balances, transaction failures, and chain-specific issues

For organizations focused on providing verification services, this operational burden can be a significant barrier to entry.

## The Gasolina Solution

Gasolina introduces a separation of concerns:

| Responsibility         | Traditional DVN | Gasolina DVN        |
| ---------------------- | --------------- | ------------------- |
| Message verification   | DVN Operator    | DVN Operator        |
| Signature generation   | DVN Operator    | DVN Operator        |
| Gas management         | DVN Operator    | LayerZero (Essence) |
| Transaction submission | DVN Operator    | LayerZero (Essence) |
| Signer key security    | DVN Operator    | DVN Operator        |
| Contract control       | DVN Operator    | DVN Operator        |

With Gasolina, operators maintain full control over the security-critical aspects while delegating gas logistics to LayerZero's Essence service.

***

## Architecture

The Gasolina system consists of three components working together:

### 1. DVN Contract (Onchain)

The smart contract deployed on each supported blockchain:

* Maintains the list of authorized signer addresses
* Enforces multisig quorum requirements
* Validates signatures before accepting verifications
* Grants ultimate control to the signer quorum

**Reference source code:** [DVN.sol](https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/packages/layerzero-v2/evm/messagelib/contracts/uln/dvn/DVN.sol)

### 2. Gasolina Service (Offchain)

A lightweight REST API that operators deploy:

* Connects to RPC providers for each supported chain
* Verifies source chain events independently
* Waits for required block confirmations
* Signs verification payloads with secure keys
* Returns signatures to requesting parties

**Infrastructure as Code:**

* AWS: [gasolina-aws](https://github.com/LayerZero-Labs/gasolina-aws)
* Google Cloud: [gasolina-gcp](https://github.com/LayerZero-Labs/gasolina-gcp)

### 3. Essence Service (Gas Abstraction)

LayerZero's infrastructure that:

* Monitors for cross-chain messages requiring verification
* Requests signatures from Gasolina nodes
* Aggregates signatures to meet quorum requirements
* Submits verified transactions onchain
* Handles all gas payments across chains

***

## Message Flow

When a message is sent through LayerZero with a Gasolina DVN configured:

```mermaid wrap theme={null}
sequenceDiagram
participant OApp as Source OApp
participant Essence
participant Gasolina
participant DVN as DVN Contract
participant Dest as Destination

    OApp->>OApp: Emit PacketSent
    Note over Essence: Detect message

    Essence->>Essence: Wait for confirmations

    Essence->>Gasolina: Request signatures
    Gasolina->>Gasolina: Verify event via RPC
    Gasolina->>Gasolina: Confirm block finality
    Gasolina->>Gasolina: Sign payload
    Gasolina->>Essence: Return signatures

    Essence->>DVN: Submit verification tx
    DVN->>DVN: Validate signatures
    DVN->>DVN: Check quorum met
    DVN->>Dest: Mark as verified
```

**Key steps:**

1. OApp emits `PacketSent` event on source chain
2. Essence monitors for messages requiring Gasolina DVN verification
3. Essence waits for required block confirmations
4. Essence calls Gasolina API with message details
5. Gasolina verifies the event via its own RPC providers
6. Gasolina signs the payload after confirming finality
7. Essence submits signatures to DVN contract on destination
8. DVN contract validates signatures against registered signers

***

## Signer Sovereignty

A key design principle of Gasolina is that **signers maintain ultimate control** over the DVN. This is enforced through the contract architecture:

| Entity            | Control Level | Capabilities                                 |
| ----------------- | ------------- | -------------------------------------------- |
| **Signer Quorum** | Ultimate      | Change admins, modify signers, adjust quorum |
| **DVN Contract**  | Enforcement   | Validates signatures, executes instructions  |
| **Gasolina**      | Verification  | Produces signatures (requires valid keys)    |
| **Essence**       | Operational   | Submits transactions (delegated privilege)   |

### Key Guarantees

* **Signer set is sovereign**: The signer quorum has complete control over the DVN, including the ability to change admins, modify the signer set, and adjust quorum thresholds.

* **Admin role is delegated authority**: While Essence typically holds the admin role for gas-efficient operations, this is a revocable privilege. Signers can use `quorumChangeAdmin` to reassign this role at any time.

* **No external dependencies for control**: The DVN cannot be held hostage by any party, including LayerZero. If Essence becomes unavailable, signers can immediately take over transaction submission.

* **Quorum prevents single-key compromise**: An attacker would need to compromise more than the configured threshold of signer keys to control the DVN.

### Emergency Takeover

If signers need to take direct control:

1. Generate a signed `quorumChangeAdmin` instruction
2. Submit directly to the DVN contract (no Essence required)
3. Assign admin role to an operator-controlled address
4. Resume operations with full control

***

## Security Model

The Gasolina architecture ensures security through separation of concerns:

### Gasolina Operator Responsibilities

| Area                | Controls                                          | Does NOT Control           |
| ------------------- | ------------------------------------------------- | -------------------------- |
| Signer keys         | Private keys that produce verification signatures |                            |
| RPC providers       | Which providers verify source chain events        |                            |
| Confirmations       | How many blocks to wait before signing            |                            |
| Verification logic  | Optional additional verification rules            |                            |
| Gas costs           |                                                   | Handled by Essence         |
| Transaction timing  |                                                   | Determined by Essence      |
| Contract deployment |                                                   | Coordinated with LayerZero |

### Essence Responsibilities

| Area                   | Controls                             | Does NOT Control          |
| ---------------------- | ------------------------------------ | ------------------------- |
| Transaction submission | When and how to submit verifications |                           |
| Gas optimization       | Efficient batching and gas pricing   |                           |
| Retry logic            | Handling failed transactions         |                           |
| Signature generation   |                                      | Cannot forge signatures   |
| Signer modifications   |                                      | Cannot add/remove signers |
| Quorum changes         |                                      | Cannot adjust thresholds  |
| Admin role             |                                      | Delegated and revocable   |

***

## Benefits

### For Security Providers

| Benefit                    | Description                                 |
| -------------------------- | ------------------------------------------- |
| **Simplified operations**  | No need to manage gas wallets across chains |
| **Lower barrier to entry** | Start with just RPC access and signing keys |
| **Enhanced key security**  | Signing keys never need to hold value       |
| **Predictable costs**      | No variable gas expenses to manage          |
| **Focus on security**      | Concentrate on verification, not operations |

### For OApp Developers

| Benefit                   | Description                                         |
| ------------------------- | --------------------------------------------------- |
| **More DVN options**      | Lower barriers mean more security providers         |
| **Reliable verification** | Professional gas management ensures timely delivery |
| **Diverse security**      | Combine multiple Gasolina DVNs easily               |

***

## When to Choose Gasolina

### Ideal Use Cases

* Professional security providers entering the DVN space
* Organizations without existing multi-chain infrastructure
* Teams wanting to focus on verification quality over operations
* Multi-signature security models requiring distributed trust
* Rapid deployment and proof-of-concept scenarios

### Consider Traditional DVN When

* You need complete control over every operational aspect
* Custom gas optimization strategies are required
* Regulatory requirements mandate full infrastructure control

***

## Getting Started

### Prerequisites

1. **Cloud provider account**: AWS or Google Cloud
2. **RPC providers**: Reliable endpoints for each chain you'll support (2+ per chain recommended)
3. **Development tools**: Node.js, Git, cloud CLI tools

### Quick Setup Overview

1. Clone the infrastructure repository ([AWS](https://github.com/LayerZero-Labs/gasolina-aws) or [GCP](https://github.com/LayerZero-Labs/gasolina-gcp))
2. Configure your signer type (mnemonic or HSM-backed)
3. Add RPC providers for supported chains
4. Deploy using CDK (AWS) or Terraform (GCP)
5. Share your Gasolina URL with LayerZero for contract deployment
6. Receive DVN contract addresses for OApp configuration

For detailed instructions, see the [Implementation Guide](/v2/workers/off-chain/gasolina-implementation).

***

## Repository Links

| Resource         | Description                  | Link                                                                                                                              |
| ---------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **gasolina-aws** | AWS CDK infrastructure       | [GitHub](https://github.com/LayerZero-Labs/gasolina-aws)                                                                          |
| **gasolina-gcp** | GCP Terraform infrastructure | [GitHub](https://github.com/LayerZero-Labs/gasolina-gcp)                                                                          |
| **DVN Contract** | Reference implementation     | [GitHub](https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/packages/layerzero-v2/evm/messagelib/contracts/uln/dvn/DVN.sol) |

***

## Next Steps

* [Implementation Guide](/v2/workers/off-chain/gasolina-implementation) - Step-by-step deployment instructions
* [DVN Technical Reference](/v2/workers/off-chain/dvn-technical-reference) - Contract methods, events, and errors
* [DVN Overview](/v2/workers/off-chain/dvn-overview) - General DVN concepts
* [Security Stack DVNs](/v2/concepts/modular-security/security-stack-dvns) - How OApps configure DVNs

<Tip>
  The [Implementation Guide](/v2/workers/off-chain/gasolina-implementation) walks you through deploying Gasolina on AWS or Google Cloud Platform.
</Tip>
