Overview
What is Layer 2?
Layer 2 (L2) is a collective term to describe a specific set of Ethereum scaling solutions. A Layer 2 is a separate Blockchain that extends Ethereum and inherits the security guarantees of Ethereum.
Why do we need Layer 2?
Three desirable properties of a Blockchain are that it is decentralized, secure, and scalable. The Blockchain Trilemma states that a simple Blockchain architecture can only achieve two out of three. Want a secure and decentralized Blockchain? You need to sacrifice scalability. Ethereum has reached the network's current capacity with 1+ million transactions per day and high demand for each of these transactions. The success of Ethereum and the demand to use it has caused gas prices to rise substantially. Therefore, the need for scaling solutions has increased in demand as well. This is where Layer 2 networks come in.
Scalability
The main goal of scalability is to increase transaction speed (faster finality) and transaction throughput (higher transactions per second) without sacrificing decentralization or security.
The Ethereum community has taken a strong stance that it would not throw out decentralization or security in order to scale. Until sharding is supported, Ethereum MainNet (Layer 1) is only able to process roughly 15 transactions per second. When demand to use Ethereum is high, the network becomes congested, which increases transaction fees and prices out users who cannot afford those fees. That is where Layer 2 comes in to scale Ethereum today.
Benefits of Layer 2
Lower fees
By combining multiple off-chain transactions into a single Layer 1 transaction, transaction fees are massively reduced, making Ethereum more accessible for all.
Maintain security
Layer 2 Blockchains settle their transactions on Ethereum MainNet, allowing users to benefit from the security of the Ethereum network.
Expand use cases
With higher transactions per second, lower fees, and new technology, projects will expand into new applications with improved user experience.
How does Layer 2 work?
As we mentioned above, Layer 2 is a collective term for Ethereum scaling solutions that handle transactions off Ethereum Layer 1 while still taking advantage of the robust decentralized security of Ethereum Layer 1. A Layer 2 is a separate Blockchain that extends Ethereum. How does that work?
A Layer 2 Blockchain regularly communicates with Ethereum (by submitting bundles of transactions) in order to ensure it has similar security and decentralization guarantees. All this requires no changes to the Layer 1 protocol (Ethereum). This lets Layer 1 handle security, data availability, and decentralization, while Layer 2s handles scaling. Layer 2s take the transactional burden away from the Layer 1 and post finalized proofs back to the Layer 1. By removing this transaction load from Layer 1, the base layer becomes less congested, and everything becomes more scalable.
Rollups
Rollups are currently the preferred Layer 2 solution for scaling Ethereum. By using rollups, users can reduce gas fees by up to 100x compared to Layer 1.
Rollups bundle (or ’roll up’) hundreds of transactions into a single transaction on Layer 1. This distributes the L1 transaction fees across everyone in the rollup, making it cheaper for each user. Rollup transactions get executed outside of Layer 1 but the transaction data gets posted to Layer 1. By posting transaction data onto Layer 1, rollups inherit the security of Ethereum. There are two different approaches to rollups: optimistic and zero-knowledge - they differ primarily on how this transaction data is posted to L1.
Optimistic rollups
Optimistic rollups are 'optimistic' in the sense that transactions are assumed to be valid, but can be challenged if necessary. If an invalid transaction is suspected, a fault proof is ran to see if this has taken place. You can read more on optimistic rollups here.
Zero-knowledge rollups
Zero-knowledge rollups use validity proofs where transactions are computed off-chain, and then compressed data is supplied to Ethereum MainNet as a proof of their validity. You can read more on ZK-rollups here.
Do your own research: Risks of Layer 2
Since Layer 2 chains inherit security from Ethereum, in an ideal world, they are as safe as L1 Ethereum. However, many of the projects are still young and somewhat experimental. After years of research and development, many of the L2 technologies that will scale Ethereum launched in 2021. Many projects still have additional trust assumptions as they work to decentralize their networks. Always do your own research to decide if you're comfortable with any risks involved.
For more information on the technology, risks, and trust assumptions of Layer 2s, we recommend checking out L2BEAT, which provides a comprehensive risk assessment framework of each project.
Use Layer 2
Now that you understand why Layer 2 exists and how it works, let's get you up and running!
When bridging over and using Layer 2, it is important to note that you will control the address for your EOA account (an account where only a single private key controls the account) just like on Ethereum MainNet. However, if you are using a contract account, such as Gnosis Safe or Argent, you will not have control over this address on a Layer 2 until you redeploy your contract account to that address on the Layer 2. If you are bridging or sending funds to a contract account, and you do not control this address for the contract account, your funds may be lost.