Layer 2, or second-layer solutions, refer to protocols that operate on top of the base layer of the network. This technology aims to increase speed and scalability on top of the primary blockchain.
One of the main features of Layer 2 solutions is that they must maintain the security of the underlying blockchain. This means transactions should be verified and confirmed by the base layer, not by other nodes.
Blockchains that prioritize decentralization and security over scalability can use Layer 2 solutions. This approach can increase transaction throughput and reduce transaction fees.
Layer 2 solutions are protocols that operate on top of the base layer of the network, increasing the speed and scalability of the blockchain while maintaining its security. Transactions are verified and confirmed by the base layer, allowing for increased throughput and reduced fees.
Layer 1 refers to the basic architecture of the blockchain, where all nodes are combined into a single system with a consensus mechanism. For example, Layer 1 in Bitcoin is the Bitcoin network, and Layer 1 in Ethereum is the Ethereum network.
Layer 2, on the other hand, represents an additional layer that operates on top of the main network. For example, the Lightning Network is a Layer 2 solution for Bitcoin, and Arbitrum and Starknet are Layer 2 networks designed for Ethereum.
The differences between Layer 1 and Layer 2 solutions are as follows:
Layer 1 |
Layer 2 |
Develops blockchain architecture |
Adds third-party solutions on Layer 1 networks |
Can implement scalability solutions with validator consensus |
Uses off-chain services for scalability |
Proven security on the blockchain |
Depends on Layer 2 team and network for efficiency and security |
Since the inception of blockchain technologies, many developers have faced network scalability issues due to increasing adoption. Such limitations have often led to higher transaction fees and longer transaction processing times.
According to the blockchain trilemma, a theorem stating that only two of the three main principles can be achieved simultaneously in any distributed network.
Ethereum is known for its network stability and security. As more companies deploy decentralized applications (Dapps) and use ETH for transaction payments, network load increases.
To address this issue, validators prioritize transactions with higher gas prices. However, these increased costs affect regular network users, raising the minimum gas fee, sometimes exceeding the transaction cost itself.
Layer 2 solutions offer a new approach to solving the primary scalability issue by reducing the load on the blockchain. These tasks include:
Execution – processing transactions and computations;
Data Availability – storing information on nodes;
Consensus – nodes agreeing on the network state and transaction order.
The benefits of Layer 2 solutions include:
Increased Network Throughput: Higher transactions per second and reduced network load;
Reduced Gas Costs: Transactions are batched together, lowering gas fees;
Security Preservation: Layer 2 updates do not affect the base blockchain, maintaining its security;
Application Adaptability: Layer 2 can be optimized for specific applications.
Disadvantages of second-layer solutions include:
Liquidity Drain: Liquidity from the main blockchain may be diverted away;
Potential Vulnerabilities: The security of Layer 2 solutions requires thorough analysis before adoption
Layer 2 technology also extends to the leading cryptocurrency, Bitcoin. Despite the BTC ecosystem's maturity, there are protocols offering new functionality.
The Lightning Network uses state channels for microtransactions on top of BTC. These transactions are executed off-chain, with initial and final balances recorded on the main blockchain, enabling fast and cheap data processing.
Rootstock operates as a sidechain, being one of the first projects to introduce smart contracts on the Bitcoin blockchain. Users can send Bitcoins to the Rootstock network, converting them into locked smart Bitcoins (RBTC), speeding up and reducing transaction costs.
Stacks is a Layer 2 blockchain enabling smart contracts and decentralized applications on Bitcoin. Microblocks and the Proof of Transfer (PoX) consensus mechanism speed up transaction processing by linking them to the Bitcoin blockchain.
The Liquid Network is a second-layer sidechain for Bitcoin, allowing BTC to be transferred using a two-way peg. BTC is converted to Liquid BTC (L-BTC) at a 1:1 ratio. Additionally, the sidechain supports the issuance of other digital financial assets (DFAs).
The Ethereum blockchain supports the majority of decentralized applications (Dapps). This makes the network highly congested, making scalability a particularly acute issue for ETH.
Layer 2 solutions for Ethereum are based on Rollup technology.
Zero-Knowledge Rollups consolidate transactions from the base layer. They then generate a proof of validity, or cryptographic proof, which is the only record added to the main network. This solution reduces the gas fees that users would incur if all data were processed separately.
Pros |
Cons |
Security and decentralization |
Complex computations for small applications with low on-chain activity |
Instant transactions |
Not all ZK-Rollups are compatible with the ETH Virtual Machine |
Transaction ordering may affect the user |
Table 2 - Pros and Cons of ZK-Rollups
Examples of zero-knowledge rollups include: Immutable X (IMX), Starkware.
Optimistic Rollups rely on fraud proofs. Aggregators of the network publish minimal information on the base layer (Layer 1), assuming that all data is correct.
If the transaction is valid, the main blockchain does not need to take any action. Conversely, in the case of fraudulent transactions, Optimistic Rollups perform verification and penalize the sender.
Pros |
Cons |
Low gas fees |
Long withdrawal process |
Increased network throughput |
Possible conflicts of interest and incentives among network participants |
Support for smart contracts |
Censorship of transactions on the base layer |
High level of security |
Table 3 - Pros and Cons of Optimistic Rollups
Examples of Optimistic Rollups: Arbitrum (ARB), Optimism (OP), Cartesi (CTSI)
Any Layer 2 solution uses ETH as the base layer for transaction validation, block creation, and maintaining the final state ledger with a consensus mechanism. This frees projects from having to create their own infrastructure.
Layer 2 solutions on Ethereum are widely used to address scalability issues, offering lower transaction fees and improved throughput. These approaches represent significant efforts to tackle the scalability problems of blockchains.