What are Layer 2 (L2) Blockchains?
Things to know:
Layer 2 blockchains can handle more transactions than layer 1 blockchains and they can also settle them much quicker. However, they don’t all achieve this speed in the same way. Let’s dive into what layer 2 blockchains are and how they work.
Blockchain networks are always at the mercy of three fundamental properties: security, decentralization, and scalability. This problem is called the “blockchain trilemma”.
It means that if a blockchain focuses on security and decentralization, it has to compromise on scalability. This very problem is why the Ethereum network moved from proof-of-work to proof-of-stake: the network had to scale. However, even with a proof-of-stake network, keeping it sufficiently secure can be challenging.
The most popular solutions so far: Layer 2 networks!
But what are Layer 2 blockchains? How do they work and which one is best?
In this blog post, we’ll explain what a Layer 2 blockchain is, its types, how Layer 2 blockchains work, and how you can use these Layer 2 networks.
What is a Layer 2 (L2) blockchain?
A Layer 2 (L2) is a blockchain built on top of another blockchain (typically a layer 1) that handles part of the transaction process that would otherwise burden the underlying chain. This allows them to handle more transactions much faster than layer 1 networks.
However, they inherit the underlying layer 1 chain’s security.
So, layer 1 chains provide security through their distributed nodes while Layer 2 networks provide an off-chain framework for faster transactions and computation.
You can imagine Layer 1 blockchains as congested highways while Layer 2 networks as alternate pathways that help clear traffic.
Consider the payments network Visa, which can handle 65,000 transactions per second. Instead of micro-managing every transaction, Visa groups them into batches on its end and sends them to the bank at once for final settlement.
What are Layer 2 blockchains for?
While there are other chains with Layer 2 solutions, the Ethereum network’s community is the most active. That’s because Ethereum has the largest dApp ecosystem and can only offer up to 15 transactions per second, leading to crippling congestion in peak times and failed or extremely slow transactions. To combat this problem, layer 2 blockchains offer a few core benefits:
Faster transactions
Layer 2 networks such as Polygon, Optimism, and Arbitrum are designed to manage high transaction volumes. They offer transaction speeds of up to 65k, 2k, and 40k per second respectively.
Cheaper Transactions
As Layer 2 networks can handle higher transaction volumes, users don’t need to pay higher gas fees to get their transactions executed before others. As a result, gas prices remain optimal.
More Transactions, all at once
Layer 2 blockchains can offer higher throughput, meaning they can process multiple transactions at once—and they can do it without impacting the speed of the transaction to the levels of a layer 1 blockchain.
Maintaining high security
Although transaction processing happens on Layer 2 networks, the underlying Layer 1 chain verifies and settles the transaction data. Since L2 networks inherit the main blockchain’s security, it makes all transactions secure.
In short, layer 2 (L2) blockchains offer speed and scalability. This makes it possible for developers to create diverse apps that have higher computation demands or attract high usage volume. This is particularly important for blockchain games and decentralized social networks which may need to handle multiple small transactions at once—without interrupting the user experience.
What can I expect to be better on a L2 Network?
Blockchain Gaming
The last thing you want when playing a blockchain game is to be interrupted by slow transaction speeds. If you want to buy an in-game item, you want to buy it then and there. With L2 blockchains, transactions are much quicker, meaning you get more time to spend playing. Plus, transactions on layer 2 networks are also much cheaper and can be settled simultaneously, meaning playing your favorite game doesn’t become increasingly expensive when more people start playing.
See how thirdweb can help you connect your web3 game to l2 blockchains!
Marketplaces
NFT marketplaces rely on quick and cheap transactions too, but the Ethereum network’s gas fees get pretty high for buying and selling NFTs when it’s busy. Layer 2 blockchain networks make this much cheaper and easier, greatly facilitating the buyer, the seller and the marketplace.
See how thirdweb can help you connect your NFT marketplace to l2 blockchains.
Web3 Social Media platforms
Web3 social media platforms rely on sending information instantaneously, and hopefully, without charging more than anyone could afford. Web3 social media platforms rely on having multiple users interacting with the app at the same time—and they need to be fast. Layer 2 networks are perfect for providing web3 social media networks with that infrastructure whilst staying secure.
Learn more about web3 social media platforms!
How does a Layer 2 blockchain work?
Layer 2 blockchains deploy multiple techniques but the common factor that binds all Layer 2 networks is how they settle the transactions on the main chain. The settlement happens by furnishing a cryptographic ‘proof’ to determine the integrity of the state change.
For Layer 2 blockchains, cryptographic proofs offer verifiable and tamper-proof evidence that a transaction is true and the proposed state change is valid. The main chain’s smart contract depends on the proof to finalize transactions and settle disputes.
The most widely-used proofs are fault proofs and validity proofs, used for optimistic rollups and zero-knowledge rollups respectively.
Other layer 2 scaling solutions have their own independent mechanisms to finalize transactions and state changes.
To understand more about how L2 blockchains work, let’s dive into the different types and how they aim to scale their parent crypto network.
What are the different types of Layer 2 blockchains?
Layer 2 is a collective term that encompasses a wide variety of scaling solutions.
The most popular types of Layer 2 networks are optimistic and zero-knowledge rollups. But there are also other types like sidechains and validiums that offer scalability similar to L2's but don’t depend on the mainnet for security.
Let’s dive into the different types of Layer 2 blockchains that help scale the Ethereum mainnet.
Rollups
Rollups execute transactions off-chain and bundle (roll up) multiple transactions into batches before submitting them on Layer 1. There are currently two types of rollups: optimistic rollups and zero-knowledge rollups.
Optimistic rollups
Optimistic rollups ‘optimistically’ assume that all layer 2 transactions are valid until challenged and proven wrong by a network validator.
During the dispute period, i.e. before transactions reach finality on Layer 1, anyone can propose a fault proof to challenge the transaction data and state change. A valid proof nullifies the faulty transaction and charges a penalty for the malicious validator that approved the transaction.
That means, for an optimistic rollup to function legitimately, there should always at least be one honest node to challenge invalid state changes.
Arbitrum One and Optimism are examples of layer 2 networks using optimistic rollups.
Zero-knowledge rollups ( Validity Rollups)
Zero-knowledge rollups are layer 2 blockchains that assume all transaction computation data are invalid until proven true through zero-knowledge proofs or validity proofs.
ZK proofs can prove with cryptographic certainty if a transaction is correct or not without revealing any transaction details. Thus the name ‘zero-knowledge’.
ZK-rollups come in 2 main types, ZK-STARKs or zk-SNARKs. While similar, these approach security of publishing the proofs slightly differently.
Good examples of layer 2 networks leveraging ZK-rollups include zkSync and ZKSpace.
What is the difference between optimistic and zero-knowledge rollups?
Optimistic rollups assume all transactions are valid until challenged by a validator and proven wrong through fault proof. Zero-knowledge rollups rely on validity proofs to verify the transactions before adding them on-chain.
For more details, check out our article that explains ZK vs Optimistic rollups!
zkEVMs
zkEVMs are a solution for those needing an EVM-compatible zk-Rollup.
Essentially, the success of ZK rollups posed another problem for both layer 1 and layer 2 networks. Simply the EVM was not designed to handle Zero knowledge proofs. zkEVMs can handle these proofs — they are more modular than any other layer 2 solution so far!
Polygon zkEVM and Consensys zkEVM are examples of zero-knowledge EVMs.
What is a zero-knowledge Ethereum Virtual Machine (zkEVM)?
Sidechains
Sidechains are separate blockchains with independent block parameters and consensus algorithms that don’t inherit the layer 1 blockchain’s security and don’t publish state changes and transaction data back to the mainnet. So technically, some wouldn't include sidechains as part of the layer 2 blockchain ecosystem.
However, sidechains can be EVM-compatible, meaning Etheruem-based smart contracts can easily migrate to these sidechains and interact with Ethereum using blockchain bridges.
Skale and Loom Network are examples of sidechains.
Validiums
Validiums process transactions off-chain and use validity proofs to verify transactions. However, validiums don’t store transaction data on the Ethereum mainnet and rely on an off-chain data availability model.
Limiting on-chain data storage reduces gas fees, particularly the price of publishing calldata. However, validiums are susceptible to transaction data distortions.
StarkWare’s StarkEx and Matter Labs’ zkPorter are examples of validiums.
Channels
Channels are multisig smart contract-managed peer-to-peer protocols that enable two parties to make multiple transactions and post the final result to the blockchain.
There are two types of channels: payment and state channels. Payment channels help in atomic transfers and micropayments while state channels handle general computation and state transition logic.
However, peers need to remain online to monitor channel activity and prevent malicious actors from stealing funds.
Projects like Connext and Raiden are examples of channels.
Plasma
A plasma chain is a separate blockchain or a ‘child chain’ anchored to the parent chain or root chain (Ethereum mainnet). They execute transactions off-chain and have their own block validation mechanism.
However, plasma chains have multiple disadvantages like the inability to support Ethereum smart contracts, data unavailability, and mass exit problem.
The OMG Network and Gluon used the plasma model. Polygon also implemented plasma as an EVM-compatible state-based sidechain.
Now that you know the different types of Layer 2 networks, let’s dive into some of the specifics.
List of the Top Layer 2 blockchains
Ethereum has many Layer 2 networks, each with its own unique benefits. While some are more suited for privacy-centric apps, others are designed for large-scale, high-compute gaming platforms.
Some of the most popular Layer 2 blockchains include:
Polygon
Polygon offers a range of layer 2 scaling solutions. Firstly, it launched Polygon network, an EVM-compatible sidechain and a Layer 2 network that uses the proof-of-stake consensus algorithm and brings scalability to Ethereum dapps. Since then, it has launched other layer 2 solutions such as its zkEVM, Polygon zkEVM and its zero-knowledge rollup Polygon Miden.
Arbitrum One
Arbitrum One is an optimistic rollup that uses fraud proofs and offers a much higher transaction throughput than Ethereum and lower fees—without compromising on security.
Optimism
Optimism is an Ethereum layer 2 network that also leverages Optimistic rollups, but also focuses on making the experience as simple as possible for developers by offering tools for smart contract deployment and more.
Base
Base is a modular, rollup-agnostic blockchain built on Optimism’s OP Stack . It’s the home of Coinbase’s on-chain products with smart contract features and it aims to onboard the next generation of crypto users in web3 with its seamless integrations with Coinbase.
zkSync Era
zkSync Era is a zero-knowledge Layer 2 blockchain that aims to bring internet-grade ‘hyperscalability’ with a self-custodial, secure user interface.
Scroll zkEVM
Scroll zkEVM is a zero-knowledge rollup with native compatibility for Ethereum applications and smart contract deployment on the Alpha testnet. This combination of features means developers can simply and easily migrate their Ethereum applications to Scroll without amending their codebase.
Gnosis Chain
Gnosis Chain, formerly known as xDAI, is an EVM-compatible sidechain that has a network of over 100,000 validators and aims to build open and fast internet applications. Technically, it’s not a layer 2 network, but Gnosis is often considered part of Ethereum’s layer 2 ecosystem due to its close relationship with the Ethereum community.
Metis
Metis is a Layer 2 network for scaling dApps, businesses, and user communities and aims to make Ethereum boundless in terms of throughput. It’s particularly preferred by DAOs and blockchain applications as it offers simple framework for those wanting to set up DAOs and build apps.
Blast
Blast is an Ethereum layer 2 blockchain that offers users native yield for Ether and stablecoins including USDT, USDC and DAI. Created by the team behind NFT marketplace Blur, Blast launched in November 2023.
Linea
Linea is an Ethereum layer 2 solution network using the Consensys zkEVM. It’s designed to be scalable, cheap and efficient for blockchain apps in the DeFi and gaming sectors.
Aurora
Aurora is a layer 2 blockchain built on NEAR protocol. It was specifically designed to bring EVM compatibility to the NEAR protocol. It allows users to transfer assets back and forth using a blockchain bridge called the “rainbow bridge”.
Check out thirdweb’s Chainlist to see plenty more layer 2 blockchains you can build on today.
How to migrate assets to a Layer 2 blockchain
There are 2 primary ways to get assets onto a Layer 2 blockchain: bridges and centralized exchanges.
Blockchain Bridges
Blockchain bridges enable the transfer of assets from one chain to another. If you already have ETH in your wallet, you can use a bridge to transfer your crypto from the Ethereum mainnet to an Ethereum Layer 2 network.
For example, if you want to move your ETH from Ethereum to Arbitrum, you can use Arbitrum’s native bridge. Similarly, other Layer 2 networks also have native cross-chain bridges.
Withdrawing from exchanges
Some centralized exchanges (CEXs) like Coinbase, Binance and Kraken support multiple chains. So, for example, if you have ETH in your CEX wallet, you can withdraw it directly to your wallet on a layer 2 network by choosing the respective network and corresponding wallet address. However, it’s always best to check, as not all centralized exchanges support this feature.
Concluding thoughts: The future of Layer 2 blockchains
Layer 2 blockchains are crucial for the continued growth and success of the Ethereum network — boosting scalability by lowering fees & increasing transaction throughput. Layer 2 networks do this by offloading some of the computational work from the Layer 1 blockchain (Ethereum), alleviating network congestion & improving performance.
The importance of Layer 2 scaling solutions cannot be overstated, as they enable Ethereum to meet the increasing demands of a growing user base and diverse applications. By providing more efficient and cost-effective means for transactions and smart contracts, Layer 2 networks foster innovation and drive the adoption of dApps on the Ethereum platform.
Frequently Asked Questions (FAQs)
Why doesn’t Ethereum make its own Layer 2?
Ethereum is undergoing several upgrades to make the network more scalable on its own. For instance, the Merge upgraded Ethereum to a Proof-of-Stake blockchain, creating the foundation for sharding. The next upgrade (Surge) will introduce sharding to find optimum ways of storing calldata from Layer 2 networks. This will eventually help Ethereum to scale to over 100,000 transactions per second.
Do Layer 2 blockchains reduce gas fees?
Yes, Layer 2 blockchains reduce gas fees by reducing the burden of transactions on the Layer 1 chain and de-congesting the network.
Are Layer 2 blockchains only for Ethereum?
No, other blockchains apart from Ethereum also have Layer 2 networks. However, as the largest smart contract network, Ethereum has the maximum number of Layer 2 blockchains.
What is the biggest Layer 2 blockchain?
Currently, Polygon and Arbitrum are two of the most active Ethereum Layer 2 blockchains.
What advantages do Layer 2 blockchains have?
Layer 2 blockchains offer higher transaction throughput and lower gas along with the security guarantees of the Layer 1 blockchain.
Is a Layer 1 or Layer 2 blockchain better?
Layer 1 blockchains provide decentralized security, while Layer 2 blockchains offer scalability. So they complement each other and work in tandem to get optimum results.
Why are there so many Layer 2 blockchains?
Each Layer 2 blockchain offers a unique technological solution and tries to overcome the shortcomings of other Layer 2 networks. For instance, optimistic rollups are easier to build and offer solid short to mid-term scalability. But zero-knowledge rollups have a more secure approach to transaction approvals.
Got questions? Drop us a line in our Discord community & join 35,000+ other builders on their web3 journey...
And if you’re ready to start building best-in-class dApps on any Layer 2 blockchain, get started with thirdweb’s web3 development stack & SDKs — they’re free!