What Are Layer 2 Scaling Solutions?

Understand Layer 2 scaling solutions: how rollups, state channels, and sidechains reduce costs and increase throughput while inheriting security from the main blockchain.

What Are Layer 2 Scaling Solutions?

Layer 2 scaling solutions are blockchain networks that process transactions outside the main chain (Layer 1) while relying on it for security and data availability. They exist because L1 blockchains like Ethereum face a fundamental constraint: every node must process every transaction, limiting throughput to roughly 15–30 transactions per second.

This throughput bottleneck creates high gas fees during periods of demand. Simple token transfers can cost $5–50, and complex DeFi interactions — like managing a collateralized borrowing position — can cost $50–500 on Ethereum mainnet. Layer 2s solve this by moving execution off-chain while preserving the security guarantees that make L1 valuable.

The Scaling Trilemma

Blockchain design involves a trilemma between three properties:

  • Security: Resistance to attacks and censorship.
  • Decentralization: Many independent nodes validating the chain.
  • Scalability: High throughput and low transaction costs.

L1 blockchains prioritize security and decentralization at the expense of scalability. Layer 2s are the primary strategy for achieving all three: the L1 provides security and decentralization, while the L2 provides scalability.

Types of Layer 2 Solutions

Rollups

Rollups are the dominant L2 architecture. They execute transactions off-chain, compress the results, and post data back to the L1. There are two varieties:

Optimistic Rollups assume all transactions are valid by default. They post state roots to L1 and open a challenge window (typically 7 days) during which anyone can submit a fraud proof demonstrating that a state transition was invalid. If a fraud proof succeeds, the invalid batch is reverted and the malicious sequencer is penalized.

Key optimistic rollups include:

  • Arbitrum: The largest L2 by TVL, running a full AVM (Arbitrum Virtual Machine) compatible with the EVM.
  • Optimism (OP Mainnet): Uses the OP Stack, which has become the foundation for many L2s through the Superchain vision.
  • Base: A Coinbase-incubated L2 built on the OP Stack, growing rapidly in users and TVL.

ZK-Rollups generate cryptographic validity proofs (zero-knowledge proofs) for each batch of transactions. The L1 smart contract verifies these proofs mathematically, providing immediate certainty that the state transition is correct. No challenge period is needed.

Key ZK-rollups include:

  • zkSync Era: EVM-compatible ZK-rollup using LLVM-based compilation.
  • StarkNet: Uses zk-STARKs and the Cairo language for provable computation.
  • Scroll: Aims for bytecode-level EVM equivalence.
  • Polygon zkEVM: Open-source ZK-rollup with EVM equivalence.

For a deeper technical comparison, see our guide on zero-knowledge proofs.

State Channels

State channels allow two or more parties to transact off-chain, only settling on the L1 when the channel opens and closes. Between those events, participants exchange signed messages representing state updates — infinitely and at zero cost.

Lightning Network on Bitcoin is the most prominent state channel implementation. For Ethereum, state channels are less common because rollups offer more general-purpose scalability. State channels work best for specific use cases: repeated payments between the same parties, gaming, or micropayments.

Limitations include requiring participants to be online, capital lockup in channels, and difficulty supporting general-purpose smart contract interactions.

Sidechains

Sidechains are independent blockchains with their own consensus mechanisms that connect to the L1 via a bridge. They do not inherit L1 security — they are secured by their own validator set.

  • Polygon PoS: Originally a sidechain (now evolving toward a ZK-based architecture), it processes transactions with its own proof-of-stake validators.
  • Gnosis Chain: A community-owned sidechain focused on decentralized applications.

Sidechains offer high throughput and low costs but with weaker security guarantees than rollups. If the sidechain's validators collude, they could theoretically steal user funds — a risk that does not exist with properly implemented rollups.

Validiums and Volitions

Validiums use ZK proofs like ZK-rollups but store data off-chain rather than on L1. This dramatically reduces costs but introduces a data availability risk: if the off-chain data becomes unavailable, users cannot reconstruct the state and may not be able to withdraw funds.

Volitions let users choose per-transaction whether to store data on-chain (rollup mode, more expensive, more secure) or off-chain (validium mode, cheaper, less secure). StarkEx supports this hybrid model.

How Rollups Work in Practice

Sequencer Operation

Most rollups currently use a centralized sequencer — a single entity that:

  1. Receives transactions from users.
  2. Orders and executes them off-chain.
  3. Produces L2 blocks.
  4. Submits compressed transaction data and state roots to L1.

The centralized sequencer provides fast transaction confirmation (often sub-second "soft confirmations") but introduces trust assumptions. Most rollups plan to decentralize their sequencers over time.

Transaction Lifecycle on a Rollup

  1. Submission: User sends a transaction to the L2 sequencer (directly or through an RPC endpoint).
  2. Soft confirmation: The sequencer includes the transaction in an L2 block and provides a receipt. This happens in seconds but is not yet final.
  3. L1 posting: The sequencer batches transactions, compresses them, and posts the data to L1 (as calldata or EIP-4844 blobs).
  4. Finality: For optimistic rollups, finality comes after the 7-day challenge window. For ZK-rollups, finality comes when the validity proof is verified on L1 (minutes to hours).

Data Availability

Data availability is critical for rollup security. Users must be able to reconstruct the L2 state from L1 data alone. If the sequencer disappears, anyone should be able to:

  • Read all transaction data from L1.
  • Reconstruct the complete L2 state.
  • Submit a valid state root.
  • Allow users to withdraw their funds.

EIP-4844 (Proto-Danksharding), implemented in Ethereum's Dencun upgrade, introduced blob transactions — a new data type specifically designed for rollup data. Blobs are cheaper than calldata and are pruned after approximately 18 days, reducing long-term L1 storage costs while maintaining short-term data availability.

The Economics of Layer 2s

Fee Structure

L2 transaction fees have two components:

  1. L2 execution fee: Covers the cost of executing the transaction on the L2 (computation, state storage). This is typically very small.
  2. L1 data fee: The L2's share of the cost of posting compressed data to Ethereum. This is usually the dominant cost component.

Post-EIP-4844, L1 data fees dropped dramatically — by 90% or more on most rollups. Transactions that cost $0.50–2.00 on rollups pre-Dencun now cost $0.01–0.10.

Cost Comparison

OperationEthereum L1Optimistic RollupZK-Rollup
ETH transfer$2–20$0.01–0.10$0.01–0.10
Token swap$10–100$0.05–0.50$0.05–0.50
Lending deposit$15–150$0.05–0.50$0.05–0.50
Complex DeFi$50–500$0.10–1.00$0.10–1.00

Approximate ranges; actual costs vary with L1 gas prices and network congestion.

For DeFi borrowing operations on Borrow, moving to L2s means the difference between paying $50+ to manage a position and paying pennies. This makes active position management, frequent collateral adjustments, and multi-protocol strategies economically viable for a much wider range of users.

DeFi on Layer 2s

Lending and Borrowing

Major lending protocols are deployed across L2s:

  • Aave V3: Live on Arbitrum, Optimism, Base, Polygon, and more.
  • Compound V3: Available on Arbitrum, Base, Optimism, and Polygon.
  • Morpho: Deployed on Base with growing L2 presence.
  • Spark: Available on multiple networks.

These deployments mean that platforms like Borrow can aggregate lending rates across not just multiple protocols but multiple networks, finding users the optimal combination of rate, collateral type, and chain.

Liquidity Fragmentation

The proliferation of L2s creates a liquidity fragmentation challenge. Instead of all DeFi activity concentrated on Ethereum mainnet, liquidity is split across dozens of L2s. This can result in:

  • Less depth in individual liquidity pools.
  • Price discrepancies across chains.
  • Difficulty moving assets between L2s (bridging delays and costs).

Cross-chain bridges, bridging solutions, and intent-based protocols are working to solve this fragmentation. Aggregators like Borrow play a key role by abstracting away chain complexity — finding the best rates regardless of which L2 the protocol lives on.

Interoperability

The L2 ecosystem is working on seamless interoperability:

  • Shared sequencing: Multiple L2s sharing a common sequencer for atomic cross-chain transactions.
  • Superchain (Optimism): A network of OP Stack-based L2s with native interoperability.
  • ZK-based bridges: Using zero-knowledge proofs for trustless cross-chain verification.
  • Shared provers: ZK-rollups sharing proof generation infrastructure to reduce costs.

Choosing a Layer 2

Factors to Consider

When choosing an L2 for DeFi activities, consider:

  • Security model: Rollups (inheriting L1 security) vs. sidechains (independent security).
  • Finality time: How long until transactions are irreversibly confirmed.
  • DeFi ecosystem: Which protocols and liquidity pools are available.
  • Bridge options: How easily you can move assets to and from the L2.
  • Cost: Transaction fees and bridge costs.
  • Decentralization: How decentralized the sequencer and prover infrastructure is.

L2 Comparison

FeatureArbitrumOP MainnetBasezkSync EraStarkNet
TypeOptimisticOptimisticOptimisticZK-RollupZK-Rollup
EVM compatibilityHighHighHighModerateCustom (Cairo)
DeFi TVLHighest among L2sStrongGrowing fastModerateGrowing
Withdrawal time7 days7 days7 daysHoursHours
Gas costsVery lowVery lowVery lowLowLow

The Future of Layer 2 Scaling

L3s and App-Specific Rollups

Layer 3s are rollups that settle to L2s instead of directly to L1. They enable:

  • Application-specific chains: A DeFi protocol running its own rollup optimized for lending operations.
  • Even lower costs: Amortizing L2 costs across another layer of batching.
  • Customized execution environments: Specialized VMs for specific use cases.

Based Rollups

Based rollups use Ethereum L1 validators for sequencing instead of a centralized sequencer. This maximizes decentralization and censorship resistance, aligning L2 sequencing with L1 security, though it trades off some performance.

Full Danksharding

Ethereum's roadmap includes full danksharding — massively expanding blob space to support hundreds of rollups posting data simultaneously. This would reduce L2 data costs by another order of magnitude, making rollup transactions nearly free.

The Rollup-Centric Roadmap

Ethereum has explicitly adopted a rollup-centric roadmap: the L1 focuses on being a secure, decentralized settlement and data availability layer, while rollups handle execution and scaling. This means the future of Ethereum DeFi — including borrowing and lending — will primarily take place on L2s.

Key Takeaways

Layer 2 scaling solutions are the primary path to making blockchain applications fast, cheap, and accessible without sacrificing security. Rollups — both optimistic and ZK — are the dominant L2 architecture, executing transactions off-chain and posting data or proofs back to Ethereum.

For DeFi users, L2s transform the economics of participation. Operations that cost $50–500 on L1 cost pennies on L2s. This is especially impactful for borrowing and lending, where active position management (collateral adjustments, refinancing, liquidation avoidance) becomes practical at L2 gas fee levels. Platforms like Borrow are positioned to leverage multi-chain L2 deployments, aggregating rates across protocols and networks to find users the best borrowing terms wherever they exist.

Common Questions

A Layer 2 (L2) is a separate blockchain or execution environment that processes transactions off the main chain (Layer 1) while inheriting its security guarantees. L2s submit compressed transaction data or cryptographic proofs back to the L1, enabling much higher throughput and lower costs without sacrificing the security and decentralization of the underlying chain.

Related Questions