Skip to content
Search
Crypto Informa

Prices USD · 24 h

  • BTC$61,581.00+1.62%
  • ETH$1,720.66+1.25%
  • XRP$0.9755+2.61%
  • BNB$563.35+2.19%
  • SOL$73.15+3.35%
  • DOGE$0.0588+3.59%
  • ADA$0.1533+2.96%
  • TRX$0.3043+0.33%
Data by CoinGecko

Learning pathAdvancedStep 11 of 15

Layer 2 and scalability: Lightning and rollups

How blockchains process more transactions without sacrificing security. Differences between Lightning, optimistic rollups and zero-knowledge rollups.

By Redacción Crypto Informa
Published:
Reading time: 3 min
Share
La mascota de Crypto Informa patina por un carril rápido de una autopista de varios niveles que representa las capas 2.
Illustration: Crypto Informa · Original illustration

Layer 1 networks (L1s) optimize security and decentralization, limiting throughput: the scalability trilemma means security, decentralization and capacity cannot all be maximized simultaneously. Layer 2 networks (L2s) execute transactions outside L1 and inherit its security by publishing data, state commitments or proofs on it.

The essentials

  • Lightning scales Bitcoin payments with state channels; rollups scale Ethereum by executing off-chain and publishing data and state on L1.
  • Optimistic rollups assume validity and allow fraud proofs within a challenge window; ZK rollups demonstrate validity with cryptographic proofs.
  • An L2's actual security depends on data availability, who can upgrade contracts and whether you can force an exit to L1.
  • Bridges, sequencers and administration keys are the most common risk surfaces.

State channels: Lightning Network

Two parties lock funds in a 2-of-2 multisignature output and exchange signed commitment transactions off-chain, updating balance allocation. Only opening and closing are recorded on L1.

  • HTLC (hash time-locked contract): a payment condition fulfilled only if the recipient reveals a secret (a hash preimage) before a deadline. Chained HTLCs make payments across several channels atomic: all hops complete or none do.
  • Old-state penalty: if a party publishes an earlier state, the other can claim all channel funds with a justice transaction. The node must therefore stay online or delegate monitoring to a watchtower.
  • Inbound and outbound liquidity: receiving requires capacity on your neighbor's side. Fees depend on route and available liquidity.

Rollups: execution outside L1, data and state on L1

A rollup executes transactions, batches them and publishes batch data and a commitment to the resulting state (state root) on L1. An L1 contract validates or accepts that commitment. Published data let anyone reconstruct state and force an exit even if the operator fails.

  • Optimistic: accept new state and open a challenge window (typically around 7 days for canonical bridges), during which anyone can submit a fraud proof reexecuting the disputed transaction on L1. This explains official-bridge withdrawal delays.
  • Zero-knowledge (ZK): each batch includes a validity proof (SNARK or STARK: short, verifiable cryptographic proofs of correct computation) checked by the contract. Finality follows acceptance, but proof generation is costly and the technology more complex and newer.

Data availability

Data availability (DA) guarantees that data needed to reconstruct state were public. Since March 2024 (Dencun, EIP-4844), rollups publish in blobs: cheaper, temporary L1 data space retained by nodes for a few weeks. Schemes storing data outside Ethereum through a committee or external DA layer (validium, or alternative-DA rollups) lower costs in exchange for another trust assumption: if the committee withholds data, users may be unable to prove balances.

Technical risks

  • Centralized sequencer: one operator orders transactions and may fail or censor. Forced inclusion mitigates this by submitting through an L1 contract so the sequencer must include it.
  • Upgradeable contracts: if a security council (multisignature) can change code immediately, security depends on those keys. Assess the signature threshold and timelock (mandatory delay before changes).
  • Immature proof system: bugs in circuits or fraud proofs. Many L2s have “training wheels”: safeguards permitting committee intervention.
  • Bridges: concentrate locked value. Third-party bridges rely on multisignature arrangements, oracles or light clients with their own assumptions and have suffered major attacks.
  • MEV and transaction ordering: whoever orders can extract value, for example by front-running your transaction.

How to evaluate an L2

L2BEAT classifies rollups into stages: stage 0 depends entirely on operators; stage 1 has a functioning proof system with limited safeguards; stage 2 permits intervention only for demonstrable code failures. Check:

  • Where data are published and for how long.
  • Whether permissionless forced exit to L1 exists.
  • Who can upgrade contracts, with what threshold and delay.
  • Whether fraud or validity proofs are active and open.
  • Fee components: L2 execution costs plus L1 data publication costs.

Brief technical glossary

  • State root: cryptographic commitment to the L2's entire state at a given moment.
  • Fraud / validity proof: demonstration that a state transition is invalid (optimistic) or valid (ZK).
  • Forced inclusion: mechanism for submitting a transaction through L1 without the sequencer.
  • Validium: execution validated by ZK proofs but with data outside L1.
  • Timelock: mandatory delay before applying a contract change.

Next step: decentralized finance (DeFi).

Tags

This is information, not financial advice. Before deciding, compare sources and consider your own situation.