Lava Network Documentation

website·Indexed 35 days ago

https://docs.lavanet.xyz/about

A Cosmos-SDK-based blockchain providing a decentralized RPC infrastructure. Documentation covers setting up RPC Node Providers, running a Lava Node as a validator, using the Lava HTTP API, and integrating with web3 libraries like ethers.js, viem, and web3.js. Includes guides on spec proposals, reward mechanisms, and public RPC endpoints for Lava and Starknet.

Tokens
39.1K
Snippets
196
Records
335
Agent score
67%

What's inside Lava Network

  1. Overview of Lava Network and LAVA tokens

    Lava Network is a Cosmos-based protocol that aggregates data providers to route AI agent and dapp traffic to the fastest and most reliable RPC Node Providers.

    LAVA exists in two primary forms:

    1. LAVA on Arbitrum (ERC20): Used for trading on CEXs and DEXs (e.g., Bybit, Uniswap) and compatible with EVM dapps.
    2. Lava Mainnet Token (Native): Powers the protocol and is required for staking, restaking, and earning rewards from incentive pools.

    To participate in staking or restaking, users must bridge their LAVA from Arbitrum to the Lava Mainnet.

  2. Overview of Lava Specifications (Specs)

    In the Lava ecosystem, a specification (or 'spec') is a foundational blueprint that defines the APIs, required methods, compute unit costs, and expected behavior for a specific chain or application. Because Lava is modular, new APIs, additional chains, and indexers can be added via specs without requiring modifications to the core Lava Protocol.
  3. Overview of Lava RPC API

    Lava RPC API provides permissionless, decentralized blockchain RPC data access designed for dapps, wallets, and AI agents. It utilizes a decentralized RPC Routing Engine to abstract infrastructure complexity, focusing on maximum uptime, optimized latency, and data integrity. The API exposes standard low-level RPC interfaces for supported chains.
  4. Overview of Lava Public RPC

    Lava Public RPC provides blockchain projects with a decentralized infrastructure to offer free, high-performance RPC access to dapp developers, wallets, and AI agents. It replaces centralized providers or fragmented community setups by using a network of professional RPC Node Providers who are incentivized via reward pools. The system ensures reliability by routing requests through a Unified RPC Engine that monitors Quality of Service (QoS) metrics like latency, availability, and data freshness.
  5. Overview of Enterprise RPC Smart Router

    The Enterprise RPC Smart Router is an RPC (Remote Procedure Call) aggregation and optimization platform designed for blockchain applications. It optimizes reliability, performance, and cost efficiency by intelligently routing traffic to the best-performing nodes based on real-time metrics. Key features include built-in failover, error recovery, transaction acceleration, double-layered caching, and comprehensive monitoring.
  6. Overview of Lava Network Architecture

    Lava Network is a Cosmos-SDK-based application-specific blockchain that serves as a decentralized coordination layer for blockchain Remote Procedure Calls (RPCs) and APIs. It uses a hybrid model where RPC execution happens off-chain for low latency, while settlement, verification, and incentives are managed on-chain via CometBFT consensus. The blockchain acts as a settlement layer to record reward claims, verify service proofs, and hold RPC Node Providers accountable.
  7. Starknet API Connection and Interface Overview

    LavaNet supports the Starknet Mainnet (STRK) via two primary interfaces: JSON-RPC over HTTPS and JSON-RPC over WebSocket. Depending on the provider, different versioned base paths are supported for API calls.
    HTTPS Base Paths:
    - /rpc/v0_5
    - /rpc/v0_6
    - /rpc/v0_7
    - /rpc/v0_8
    - / (unversioned root)
    
    WebSocket (WS) Paths:
    - /ws/rpc/v0_6
    - /ws/rpc/v0_7
    - /ws/rpc/v0_8
  8. Understand the Lava Blockchain Validator role

    Lava blockchain utilizes a Proof-of-Stake (PoS) consensus mechanism based on Tendermint. Validators are responsible for verifying new blocks to secure the network. In exchange for this service, validators earn rewards consisting of LAVA tokens from new block creation and transaction fees. However, bad actors are subject to 'slashing' (penalty) as enforced by the Tendermint consensus protocol.
  9. Route RPC requests using Dynamic QoS Scoring

    The Enterprise RPC Smart Router uses Dynamic QoS (Quality of Service) Scoring to determine the optimal routing for incoming requests. It continuously probes RPC nodes to monitor health, performance metrics, and block synchronization status. Nodes with higher uptime, lower latency, and better synchronization are assigned higher priority.
  10. Ensure data consistency with Block Tracking and Chronological Validation

    The router maintains awareness of the latest block on each blockchain to prevent stale data. Through Chronological Validation, any response containing outdated block information is automatically rejected and retried on a different node. Nodes providing stale data are penalized with lower QoS scores.
  11. Understand Lava Network Provider QoS Metrics

    The Lava Network evaluates RPC Node providers using three primary Quality of Service (QoS) metrics. These scores are recorded on-chain via relay proofs of service and are aggregated over time with a decay function that prioritizes recent data. QoS metrics primarily affect provider pairings and rewards; poor service can reduce accumulated CU (Compute Units) by up to 50%.

    The three core metrics are:

    1. Availability: Measures the percentage of successful relays. A score of 0 is given for failed relays (timeouts, unsupported chains, or general lava errors).
    2. Latency: Measures response speed relative to a benchmark. A score of 0 is given if a relay takes more than half of the allowed timeout.
    3. Sync/Freshness: Measures how current the provider's data is compared to the fastest provider. A score of 0 is given if the latest block proof is older than the specified block lag limit.