What is Layer 2 - A scaling solution for blockchain
Layer 2

What is Layer 2 - A scaling solution for blockchain

11 min

Published

Beginner

Learn what Layer 2 is, how it works, and how solutions like Optimistic Rollups, ZK Rollups, State Chains, and Plasma scale blockchain networks.

Overview

Key takeaways

  • Layer 2 scales blockchain networks by processing transactions outside the main chain, increasing capacity and reducing costs while relying on Layer 1 for security and finalization.

  • Different Layer 2 designs make different trade-offs, with Optimistic Rollups, ZK Rollups, state chains, and Plasma using different approaches to transaction processing, verification, and data availability.

  • Layer 2 improves scalability but introduces new challenges, including dependence on Layer 1, sequencer centralization, withdrawal delays, bridge risks, and liquidity fragmentation across networks.

As the number of blockchain users and applications continues to grow, Layer 1 networks such as Ethereum and Bitcoin face increasing demand for transaction processing. Limited capacity can lead to congestion, higher transaction fees, longer confirmation times, and a less efficient user experience during periods of high demand. Layer 2 solutions were developed to address these limitations by processing transactions more efficiently while continuing to rely on the underlying Layer 1 network for security and finalization.

This article introduces Layer 2, explains how it works, and examines the main types of Layer 2 scaling solutions currently used in blockchain networks.


What is Layer 2?

Layer 2 is a scaling solution built on top of a Layer 1 blockchain to increase transaction capacity, reduce costs, and improve processing speed. Rather than processing every transaction directly on the main chain, Layer 2 handles most transaction activity on a separate execution layer and periodically sends the necessary data, proofs, or state updates back to Layer 1.

The Layer 1 blockchain remains responsible for verifying the submitted information and providing the underlying security and finality. By moving part of the transaction workload away from the main chain, Layer 2 can increase overall network capacity without requiring Layer 1 to process every transaction individually.

Blockchain can be imagined as a high-rise building with multiple functional floors built on the same foundation.

  • A Layer 1 blockchain serves as the main foundation of the system. Networks such as Ethereum and Bitcoin maintain the underlying security, validate transactions, and preserve decentralization. However, when demand increases sharply, their limited processing capacity can lead to congestion, higher fees, and longer confirmation times.

  • A Layer 2 blockchain functions like additional floors built on top of that foundation. By processing transactions off-chain, Layer 2 can handle activity faster and at lower cost. It then sends the necessary information back to Layer 1 for verification and finalization. In this way, Layer 2 expands the capacity of the underlying blockchain without replacing it.

Types of Layer 2 Networks

Layer 2 is not a single technology. The term refers to a range of Layer 1-based solutions, each using a different approach to process transactions and interact with the underlying blockchain. As a result, Layer 2 networks can differ in their architecture, security models, transaction speeds, costs, and compatibility with developer tools.

Some solutions prioritize compatibility with Ethereum, so existing applications can be transferred more easily. Others focus on generating cryptographic proofs to improve security and shorten finalization times. These trade-offs mean that no Layer 2 model is ideal for every use case.

Rollup

Rollups are currently the most widely used Layer 2 architecture and account for a significant share of the ecosystem's DeFi TVL. According to DeFiLlama data, liquidity is concentrated primarily on networks such as Base, Arbitrum, and OP Mainnet.

Instead of sending each transaction individually to Layer 1, a rollup groups multiple transactions into a single batch and executes them on the Layer 2 network. The transaction data is compressed before being sent to Layer 1 together with the result or proof required for the main chain to verify it. Rollups execute transactions on Layer 2 and periodically submit batches of transactions to Layer 1. Depending on the design, the batch includes compressed transaction data and either a cryptographic proof or information that enables verification of transaction validity.

  • When a user submits a transaction, the sequencer or processing component of the rollup receives and orders it.

  • The transactions are executed on Layer 2, after which multiple results are combined into a batch.

  • The batch is sent to Layer 1 together with compressed data or a cryptographic proof, depending on the type of rollup being used.

Rollups are generally divided into two categories: Optimistic Rollups and ZK Rollups. Both aim to reduce the amount of work performed directly on Layer 1, but they use different methods to verify transaction validity.

Optimistic Rollup

Optimistic Rollup assumes, by default, that the transactions in a batch are valid and does not immediately recheck them. This approach reduces processing costs and simplifies operation. However, if someone discovers that a batch contains a fraudulent transaction, they can submit a fraud proof and request that the network review it. Optimistic Rollup therefore follows a trust-first, verify-when-needed model. It usually includes a challenge period during which participants can identify and dispute invalid data. This waiting period can make withdrawing assets from Layer 2 to Layer 1 take longer.

Arbitrum, Base, and Optimism are common examples of Optimistic Rollups. These networks are highly compatible with existing Ethereum tools and smart contracts, allowing development teams to deploy or move applications to Layer 2 without rewriting the entire system.

ZK Rollup

ZK Rollup uses cryptographic techniques to generate a proof showing that all transactions in a batch were executed correctly. This proof is called a zero-knowledge proof (ZKP). The Layer 2 network sends the ZKP to Layer 1, where it can be verified without reprocessing every transaction in the batch.

The term zero knowledge refers to the ability to prove that a result is correct without revealing all the information used to produce it. In a ZK Rollup, Layer 1 can verify the validity of a batch based on the submitted proof. This reduces the amount of data that must be processed and allows transactions to reach finality after the proof is verified, rather than waiting through a lengthy challenge period as with Optimistic Rollups.

Projects such as zkSync, Aztec Network, and Starknet use this design. ZK Rollups can provide strong security, high performance, and fast finalization. However, building the proof-generation system, developing smart contracts, and maintaining the ZK Rollup infrastructure are more complex. The process may also require more computational resources than Optimistic Rollups. Many ZK projects may also rely on more centralized infrastructure to achieve higher throughput, which can introduce trade-offs in decentralization.

State chain

State chains can be imagined as private transaction channels for a fixed group of participants. Instead of recording every transaction directly on Layer 1, the parties conduct most activity off-chain and record only the initial and final states on the blockchain. This makes state chains suitable for use cases that require frequent and repeated transactions among the same group of users, such as gaming sessions, recurring payments, or regular asset exchanges. One well-known example in the Bitcoin ecosystem is the Lightning Network.

The operation of a state chain generally involves three main phases: opening the channel, conducting transactions off-chain, and closing the channel.

  1. Opening phase: Participants lock assets in a multisig smart contract on the main chain. This deposit can consist of ETH, ERC20 tokens, NFTs, or other blockchain-native assets. The locked assets serve as collateral and help discourage fraudulent behavior during the transaction process.

  2. Off-chain transaction phase: Once the channel is open, the parties can exchange signed state updates without submitting each transaction to the blockchain. Each new state replaces and invalidates the previous state through cryptographic mechanisms. As a result, transactions can be processed almost instantly at very low cost.

  3. Closing phase: When the parties complete their activity, they submit the agreed final state to the smart contract on Layer 1. The contract verifies the signatures, determines each party's balance, and distributes the corresponding assets. If a dispute occurs, the challenge period allows the parties to provide evidence of a newer valid state.

State chains process transactions off-chain among a fixed group of participants and record only the opening and closing of the channel on Layer 1. This model offers fast processing, near-zero fees, and a high degree of privacy. However, because it operates within a fixed group, a state chain is not well suited to open and public interactions such as those supported by Rollups.

Plasma chain

Plasma is a scaling model that creates child chains to process transactions outside the main chain. Instead of publishing all transaction data to Ethereum, Plasma sends only state commitments or periodic summaries to Layer 1. This approach reduces the workload on the main chain and increases throughput, but it also makes asset withdrawals, data verification, and dispute resolution more complex. The process can be divided into four main steps:

  1. Asset deposit: Users send assets to a smart contract on Ethereum, also known as the root chain. The contract locks these assets and creates corresponding representations on the Plasma child chain.

  2. Off-chain processing: Transactions are executed on the Plasma chain with high throughput and low fees. An operator collects the transactions, creates blocks, and builds a Merkle tree containing the activity.

  3. State commitment: The operator periodically posts the Merkle root to the root chain. This creates an on-chain proof of the child chain's state without requiring all transaction data to be posted.

  4. Asset withdrawal mechanism: To withdraw assets, users submit a withdrawal request together with a Merkle proof demonstrating ownership. A challenge period, usually lasting 7 days, allows others to dispute invalid withdrawal requests through a fraud proof.

Plasma operates independent child chains and sends only a Merkle root or state summary to Layer 1. This can provide very high theoretical throughput and allow custom rules to be established. However, the model faces serious problems involving data availability, long withdrawal times, and congestion risks when many users withdraw assets at the same time.

How is Layer 2 different from a Sidechain?

A blockchain with low fees and technical compatibility with a Layer 1, specifically Ethereum in this case, is not necessarily a Layer 2. Many blockchains describe themselves as Layer 2 networks, but in practice they may simply be sidechains. A sidechain is an independent blockchain with its own validators and consensus mechanism. It can connect to Ethereum through a bridge, but its security depends primarily on the sidechain's validator set. If those validators are compromised, Ethereum cannot automatically detect and reverse an invalid state on that network.

A rollup sends data or proofs to Ethereum so the main network can verify its state. The key difference therefore lies in the source of security. Layer 2 inherits its security from Ethereum, while a sidechain does not and instead creates its own security domain.

Some examples of sidechains include

  • Polygon PoS is an Ethereum-compatible sidechain that uses Proof of Stake and its own validator set to process transactions. This allows the network to offer higher speed and lower costs than Ethereum while maintaining an independent security domain.

  • Liquid Network expands Bitcoin's functionality by allowing users to transfer BTC into L-BTC on a separate sidechain. L-BTC can be used for faster and more private transactions and supports additional types of assets.

  • Rootstock brings smart contract functionality to the Bitcoin ecosystem through an EVM-compatible sidechain. Users can convert BTC into RBTC to pay gas fees, deploy applications, and participate in DeFi activities on the network.

Challenges of Layer 2 Blockchains

Layer 2 helps reduce fees and increase processing speed, but it cannot completely remove the limitations of Layer 1 blockchains. Dependence on underlying infrastructure, security risks, and liquidity fragmentation continue to affect user experience and the long-term scalability of Ethereum.

Dependence on Layer 1

Layer 2 must still send data, proofs, or state commitments to Layer 1 for verification and finalization. As a result, congestion or high gas fees on Ethereum can also affect Layer 2 operating costs. These conditions can lengthen asset withdrawal times and reduce the overall responsiveness of the system. During periods of sharply increased demand, Ethereum may process only around 30 transactions per second. More than 98% of Layer 2 security is anchored to Layer 1, which means the operation of these networks remains significantly dependent on Ethereum's infrastructure, processing capacity, and stability.

Security Risks During the Challenge Period

Optimistic Rollup assumes that transactions are valid by default and only checks them again when someone submits a fraud proof. The network therefore needs a challenge period, which can make withdrawing assets to Layer 1 take around 7 days. If no one actively monitors the network, invalid transactions may not be detected and challenged in time.

In addition, many Layer 2 networks still depend on a single sequencer or a limited group of sequencers to order transactions. According to CoinLaw, centralized sequencers affect 45% of the Layer 2 ecosystem. In December 2023, Arbitrum's sole sequencer went offline for 78 minutes, temporarily halting the network. The incident showed how a single point of failure can affect the system's ability to process transactions.

Liquidity Fragmentation

When users move assets from Ethereum to Layer 2, a bridge usually locks the tokens in a smart contract on Layer 1 and creates a corresponding balance on Layer 2. A canonical bridge is integrated with the rollup's system and generally offers stronger security, but withdrawing assets may take longer. A third-party bridge, meanwhile, uses liquidity pools or its own validation network to support faster transfers.

Faster transfers introduce risks related to smart contracts, liquidity, and representative assets. The same token may exist in multiple versions issued by different bridges, but these versions do not automatically have the same level of backing or redemption capability.

The growth of multiple Layer 2 networks also divides liquidity and applications across different ecosystems. An asset on one Layer 2 cannot automatically interact with another network in the same transaction. Users must use bridges to move assets, while developers may need to deploy applications across several networks to reach different liquidity pools.

Conclusion

Layer 2 addresses one of the fundamental challenges facing blockchain networks by increasing transaction capacity without requiring every transaction to be processed directly on the underlying Layer 1. By moving transaction execution away from the main chain while retaining its security and settlement properties, Layer 2 solutions can improve scalability, reduce costs, and support a broader range of applications. However, these benefits come with different trade-offs depending on how each Layer 2 is designed. Factors such as security, transaction costs, finality, data availability, and user experience can vary significantly across different solutions. As blockchain adoption continues to grow, understanding these trade-offs will be essential for evaluating the role and suitability of Layer 2 solutions across different use cases.

Frequently asked questions

What is a Layer 2 blockchain?

A Layer 2 is a scaling solution built on top of a Layer 1 blockchain that processes transactions separately while relying on the underlying network for security and finality.

What is the difference between Layer 2 and Layer 1?

Layer 1 is the base blockchain that provides security, consensus, and settlement, while Layer 2 processes transactions separately to increase capacity and reduce costs before submitting data or proofs back to Layer 1.

What are the main types of Layer 2 solutions?

Common Layer 2 approaches include Optimistic Rollups, ZK Rollups, state channels, and Plasma, each using a different method to process transactions and rely on Layer 1 for verification or settlement.