Layer-2

What Is a Layer-2

Layer-2 is a separate blockchain that is built on top of the existing Layer-1 blockchain (i.e., Ethereum, Polygon) to extend its capabilities and improve scalability while inheriting the security guarantees of the Layer-1 blockchain. Here, inheriting the Layer-1 blockchain’s security guarantee means deriving security and data availability from it. 

Layer-2 chains are essential for the Layer-1 blockchains because they address the scalability issue inherent in its current architecture. For example, one of the most representative examples of Layer-1, the Ethereum mainnet, provides decent security (Gasper protocol) and decentralization (more than $100B of total stake) but can only handle about 15~30 transactions per second which leads to network congestion and high transaction fees during periods of high demand.

Layer 2 solutions enhance scalability by processing transactions off-chain, thereby increasing transaction throughput without compromising the decentralization and security of the underlying Layer-1 blockchain. This allows for a more efficient and cost-effective user experience, accommodating a larger number of transactions and reducing fees, making Ethereum accessible to a broader range of users.  

Types of Layer-2 Solutions

There is still ongoing debate about which scaling solutions can be included in Layer-2, but the current consensus is forming around the idea that “Layer 2 means Rollup.” In other words, to be considered a true Layer-2, it must provide unconditional security assurance, ensuring that users can always withdraw their assets even if the network is compromised (censorship resistance and failure fallback). To achieve this, the data availability layer should not rely on external sources. According to this criterion, Validium, which stores transaction data outside Ethereum Layer-1, cannot be considered Layer 2. This criterion is currently supported by the Ethereum Foundation and Vitalik Buterin, although some Ethereum community members disagree, so the classification debate continues. Here, we reflect the mainstream opinion by defining only Rollups as Layer-2 and explaining this in detail.

Rollups

Rollups are classified into two main types: Optimistic Rollups and Zero-Knowledge (ZK-rollups)

Optimistic rollups enhance scalability by batching numerous off-chain transactions and posting compressed data onto the Layer-1 blockchain, spreading fixed costs across multiple transactions to reduce user fees. They rely on a fraud-proving mechanism, wherein transactions are presumed valid unless challenged within a designated challenge period. During this period, anyone can submit a fraud proof if they detect incorrect transaction calculations. If a fraud proof is validated, the erroneous transactions are re-executed, the rollup’s state is corrected, and the responsible sequencer is penalized. If no challenges arise, the batch is confirmed as valid, allowing subsequent transactions to build upon it with the understanding that any future discovery of fraud will necessitate state reversals.

Zero-knowledge rollups (ZK-rollups) submit a summary of transactions, accompanied by cryptographic validity proofs, to a base Layer-smart contract, ensuring the correctness of state changes without posting all transaction data on-chain. This state is maintained by on-chain contracts that verify the validity proofs submitted by ZK-rollup nodes, ensuring seamless and fast finality of transactions with fewer delays. ZK-rollups also use data compression techniques to minimize transaction data in calldata, reducing user fees. The ZK-rollup operates on a separate virtual machine off-chain, while the base Layer-1 chain manages deposits, rollup blocks, and proof verification.

Related content

  • Layer-1

    Refers to the foundational blockchain architecture that directly processes and records all transactions in a network.

  • Zero-Knowledge Rollups (ZK-Rollups)

    A Layer-2 scaling solution designed to enhance the throughput and efficiency of Layer-1 blockchain.