Introduction
The need for Layer 2 chains came because of the age old blockchain trilemma.
We can only have two at a time, in case of ethereum that is decentralization and security. But ethereum isn't scalable. To give context, ethereum has a max TPS (Transaction per second) as 60 which usually stays at 12-15. On the other hand Visa has max TPS of 1600.
So if we are building an alternate decentralized economy, we need users and to onboard users we need the system to have high throughput.
Hence, layer 2 scaling solutions were born.
What are L2s?
Layer 2 chains are blockchains built on top of a parent blockchain, that helps in optimizing and expanding capabilities of the base layer network. Layer 2 chains inherit security and decentralization from ethereum and they offer scalability and optimization.
L2 chains process transaction in batches rather than one at a time, which enable faster and cheaper transaction for the users. Thus enhancing overall scalability of blockchain.
Types of L2 scaling solutions
Validiums
Rollups
Optimistic Rollups
Zero knowledge rollups
State channels
Plasma
Sidechains
1. Validiums
Validiums keep transaction data outside ethereum (e.g., on a different server or decentralized storage). Although this lessens the strain on mainnet, it creates a presumption of trust about the availability of data.
Validium doesn’t post the transaction data on the main Ethereum chain. Instead, it uses Zero-Knowledge Proofs (ZKPs) to verify these off-chain transactions without revealing specific details.
Validium can handle a lot of transactions (up to 10k per second) without overloading the main network.
2. Rollups
Rollups process transactions away from the main (off-chain) chain but maintain the transparency by posting the transaction data on the main chain. Rollups fully inherit security from the layer 1 chain, i.e. ethereum in this case.
There are two different types of rollups :
Optimistic rollups
Zero knowledge rollups
2.1 Optimistic rollups
The smart contract “optimistically” assumes that all transactions are valid until proven otherwise.
A 'fraud-proof' approach is employed to identify transactions that are deemed invalid. The incorrect transaction is nullified and re-executed to update the rollup's state if a fraud-proof is valid.
If the optimistic rollup batch is unchallenged during the dispute period, the transaction data are successfully added to the Ethereum main chain.
Examples : Optimism, Arbitrum, Base
2.2 Zero knowledge rollups
ZK-Rollups, are rollups where validators prove a transaction’s authenticity without revealing any transaction details.
In contrary to optimistic rollups, ZK-Rollups assume all transactions are false until proven valid through Zero-Knowledge Proofs (ZKPs).
ZK rollup nodes have to provide validity proofs for all transactions to ensure that the transaction data on the Ethereum chain is valid.
Examples : ZKSync, Polygon zkEVM
3. State channels
A state channel is a type of Layer 2 scaling solution on a blockchain, allowing two parties to conduct transactions directly with each other off-chain.
They permit rapid, off-chain exchanges that eventually settle on the Ethereum mainnet, ensuring the core network doesn’t get congested.
Essentially they act as private payment channel between participants.
4. Plasma
Plasma chains are independent child chains that are deployed and managed on top of the main blockchain( like Ethereum).
The main idea behind Plasma chains is to produce a hierarchical ecosystem of connected blockchains, where each chain is responsible to manage its own agreement and security system.
5. Sidechains
They’re similar to parallel blockchains to Ethereum, operating independently but can sync up when required.
They have their own consensus mechanisms, meaning mainnet won’t be affected in case of security breach.
[!note] Validiums, Rollups, and Sidechains each warrant their own detailed blog. This blog aims to provide a broad overview of the Layer 2 ecosystem.
Why there are so many L2 chains?
Simple answer to that would be - different use cases. No single solution works for all.
Plasma — Optimized for more complex smart contracts and applications involving fund pooling.
Sidechains can be built for faster and more customized blockchains for enterprise use cases.
If one is building a de-fi product like games or social media applications, validium would be a better option to choose. Because there is mass micro txs.
If one is building a complex de-fi product like lending protocol/ staking protocol it might be a better option to use rollups because they are more secure. As we can see every solution has it's own use cases.
Benefits
Layer 2 solution provide a wide range of benefits what address scalability problems faced by blockchains :
Higher throughput
Cheaper transaction cost
Faster transaction finality
Limitations
Every solution comes with it's set of limitations, so are L2s some of them are :
Increased complexity
Liquidity fragmentation
Cross chain interoperability problems
Increased dependence on L1 which leads to network congestion.
My views
Every piece of technology comes with its own advantages and limitations. The web3 ecosystem is still in its early stages, with new products and innovations emerging almost every week. Ethereum revolutionized the industry by unlocking the potential for decentralized and secure applications. However, it also faces inherent scalability and performance constraints.
To address these challenges, Layer 2 scaling solutions such as rollups, validiums, plasma, state channels, and sidechains have been developed, each offering a unique set of features tailored to specific use cases.
From an end-user perspective, the myriad of Layer 2 solutions introduces interoperability challenges. To bridge these gaps, cross-chain bridges were created, enabling seamless interaction between different chains. This adaptability showcases the beauty of web3—when one door closes, the community quickly develops a key to open it.
With continuous iteration and experimentation, we move closer to addressing every major challenge in the ecosystem. As with any technology, there are trade-offs, but the pace of progress in web3 ensures these are tackled head-on.