Linea Documentation

repository·main·Indexed 19 days ago

https://github.com/consensys/doc.linea

Technical guidance for the Linea Layer 2 network and the Lineth open-source ZK-rollup stack. Includes documentation for the Lineth SDK (@lfdt-lineth/sdk-viem and @lfdt-lineth/sdk-core), bridging assets, claiming messages, and Linea smart contract interfaces such as IMessageService, IPauseManager, IPermissionsManager, and IRateLimiter.

Tokens
162.4K
Snippets
420
Records
713
Agent score
66%

What's inside Linea

  1. Overview of Linea Yield Boost

    main

    Linea Yield Boost is a protocol-level mechanism that converts idle bridged ETH into ecosystem incentives. It works by programmatically staking a portion of ETH held in the LineaRollup using Lido v3 stVaults on Ethereum Mainnet.

    Key Benefits:

    • Replaces temporary emission-based rewards with sustainable, Ethereum-native yield.
    • Reduces reliance on mercenary liquidity.
    • Strengthens the Linea ecosystem by redirecting staking rewards to a distributor contract on L2 to incentivize liquidity providers and DeFi protocols.

    Note on Status: Yield Boost is in a phased rollout. Initial infrastructure (including YieldManager and StakingVault) has been deployed on mainnet, but some components may not yet be active.

  2. Understand Lineth deployment architecture

    main
    Lineth is an Ethereum-equivalent network utilizing a dual-layer architecture that separates consensus from execution. This modular design supports client diversity and operational flexibility. When designing a deployment, you must consider core components, data availability (DA) strategies, finality design, and access control mechanisms.
  3. Locate Lineth and Linea source repositories

    main
    Lineth and Linea are open source. The core components, including the sequencer, prover, smart contracts, and coordinator, are located in the lineth-monorepo. Specific sub-modules within that monorepo handle arithmetization, tracer constraints, and the Linea Besu plugin. Supporting libraries like gnark (proving library), shomei (state manager), and maru (consensus layer client) are maintained in separate repositories.
  4. Ways to bridge tokens to Linea

    main

    The Linea bridge app (https://linea.build/hub/bridge) offers three primary methods for moving funds onto the Linea network:

    1. All bridges (Bridge aggregator): Powered by Li.Fi, this is the best option for most users. It supports numerous EVM chains and Solana. It automatically selects optimal routes based on your priority (speed or price) using DEXs and bridges. It is generally faster than the native bridge but may have slightly higher costs.
    2. Native bridge: Built by the Linea team to interface with the canonical token bridge. It is best suited for tech operators, protocols, or moving large liquidity, and is the only option for testnet bridging.
    3. Buy: A fiat onramp aggregator provided by Onramper, allowing you to purchase funds directly onto Linea.
  5. Understand Lineth protocol capabilities

    main

    Lineth provides several core protocol guarantees and features:

    State transition correctness

    Lineth utilizes zk-SNARK proofs to verify that state transitions are valid. A valid proof ensures that an operator cannot finalize an invalid state transition through the normal proof path. Note that proofs verify correctness but do not inherently guarantee transaction privacy; privacy is determined by the deployment's data availability and access model.

    EVM-compatible execution

    Lineth supports EVM-compatible contract execution, allowing existing Solidity contracts and Ethereum tooling to be used. Compatibility is subject to the specific deployment configuration and inherent differences between the deployed chain and Ethereum.

    QBFT consensus

    For multi-validator deployments, Lineth supports Quorum Byzantine Fault Tolerance (QBFT), which provides:

    • Fault tolerance: Can tolerate f faulty validators given 3f+1 total validators.
    • Single-slot finality: Achieved under the deployment's specific QBFT safety assumptions.
    • Distributed block production: Occurs when sufficient validator participation is met.

    Note: Single-validator deployments do not use QBFT and instead rely on the operator's trust model.

    Dual-layer architecture

    Lineth employs a dual-layer architecture that separates consensus from execution. This separation allows operators to scale consensus and execution independently and choose different client configurations for each.

  6. What is Linea Yield Boost?

    main

    Linea Yield Boost is a protocol-level mechanism on the Linea Public network designed to automatically stake a portion of the ETH held in the LineaRollup contract.

    How it works:

    1. Users bridge ETH from Ethereum (L1) to Linea (L2) via the LineaRollup.
    2. This ETH remains on L1 and is programmatically deposited into a Lido v3 StakingVault on Ethereum Mainnet.
    3. The resulting beacon chain staking rewards are distributed back into the Linea ecosystem to incentivize liquidity providers (LPs) and support DeFi protocols.

    Note: As of the current documentation, Yield Boost is not yet live and describes an intended design.

  7. What is the Linea Tracer and how does it function?

    main

    The Linea Tracer is a plugin for Linea Besu that runs as part of the Linea sequencer. Its primary purpose is to generate the execution data required by the prover to create Zero-knowledge (ZK) proofs.

    Core Responsibilities:

    • Execution Trace Generation: During block processing, the tracer captures granular data (traces) representing the operations performed by the Ethereum Virtual Machine (EVM) for each transaction.
    • Batch Size Calculation: It provides trace counts used to calculate the size of batches.
    • Prover Input Preparation: It creates conflated trace files which serve as the direct input for the prover to generate execution proofs.
  8. What is the Lineth Stack?

    main

    Lineth (formerly the Linea Stack) is a collection of protocol components, onchain contracts, and operational capabilities designed for operators to deploy and run their own Layer 2 or Layer 3 networks. It inherits a Zero-knowledge proof (ZK proof) system and provides an Ethereum-compatible execution environment.

    Key capabilities include:

    • Cost and Speed: Reduced transaction costs compared to Ethereum L1 and near-instant soft finality via 1s block times.
    • Interoperability: Ethereum-anchored interoperability using rollup and bridge components to access Ethereum liquidity and the DeFi ecosystem.
    • Customization: Flexible deployment models allowing for specific privacy, compliance, and data availability (DA) requirements.
    • Operational Control: Clearly defined components and failure boundaries for managing risk, uptime, and compliance.
  9. What is Linea Mainnet?

    main

    Linea Mainnet is a public, permissionless zkEVM Layer 2 (L2) network built on Lineth.

    Key Characteristics:

    • Security: Inherits Ethereum's security and decentralization while increasing throughput and reducing fees.
    • ZK Proof Technology: Uses ZK proofs instead of fraud proofs, removing the seven-day lockup period and allowing for instant, cost-free withdrawals.
    • EVM Equivalence: Fully compatible with the Ethereum Virtual Machine (EVM), allowing Ethereum-based projects and assets to be deployed without code changes.
    • Fast Finality: Provides soft finality within 1s due to short block times and a lack of L2 transaction reorgs.
    • Predictable Pricing: Offers clarity on transaction costs and how L1/L2 costs are accounted for.
    • Recoverable State: Supports reconstructing Linea's state at the last point of finalized data via a dedicated plugin.
  10. Overview of the Lineth protocol transaction lifecycle

    main

    The Lineth protocol processes transactions through a four-stage lifecycle to ensure deterministic state transitions and zero-knowledge validity:

    1. Execute transactions: Transactions are processed in an Ethereum-compatible execution environment where smart contracts run against the current state.
    2. Batch and trace blocks: Executed blocks are grouped into batches, and the protocol records execution traces to prove the correctness of each state transition.
    3. Generate validity proofs: The proving system uses the recorded traces to generate zero-knowledge proofs, allowing a verifier to validate the batch without replaying every transaction.
    4. Submit for data availability and finalization: The protocol submits necessary data for availability and verification to a finalization layer. The specific path depends on the deployment (e.g., Linea Mainnet finalizes to Ethereum, while other Lineth-based networks may use different paths).