Ethereum is one of the most popular blockchain networks in today’s blockchain market. Ethereum is simply a public blockchain anyone can use to build decentralized apps, launch tokens, and spend digital currency. Its comprehensive capabilities make it a highly accessible virtual computer, which is probably why Ethereum is the leading smart contract platform for startups and many other blockchain projects.
You’ve probably come across the term “Layer 2”. Crypto investors often talk about blockchains in terms of “Layer 1” and “Layer 2”, but to understand what they mean, it’s worth explaining from the base point. Blockchains like Bitcoin and Ethereum are often described as “Layer 1” chains because they settle every transaction on their network. Essentially, layer 2 can be thought of, as a different network running on top of the main network, (layer 1) to improve the transaction processing rate and reduce the load on the main network (layer 1).
So, What is Layer 2?
Layer 2 is just a secondary framework or protocol that is built on top of an existing blockchain system. The goal of these protocols is to solve the transaction speed and scaling difficulties that are being faced by the major cryptocurrency networks.
They are created to help process transactions off of the Ethereum Mainnet (layer 1) while still maintaining the same security measures and decentralization as the main net. Layer 2 solutions increase throughput (transaction speed) and reduce gas fees.
For instance, Ethereum is still not able to process thousands of transactions per second (TPS), and this is certainly limiting its long-term growth. There is a need for higher throughput before these networks can be effectively adopted and used on a wider scale. This is where layer 2 solutions come in, to help reduce the load on the Ethereum network and then increase transaction speed.
Examples of Layer 2 solutions:
Polygon (MATIC): is a Layer 2 (L2) scaling solution that allows developers to create scalable and user-friendly dApps with minimal transaction costs and without sacrificing security. It boasts a Transaction per second (TPS) of up to 7,000 compared to Ethereum's 15 TPS. Besides, Polygon is already used by major crypto brands like Sushiswap, Chain Games, and Quickswap, and non-crypto brands like Instagram, Stripe, Adidas Originals, and Prada.
Optimism (OP): is also a layer2 scaling solution. It provides users with cheaper transactions and a smoother user experience and is also one of the top five Ethereum Layer 2 solutions in the market today.
Arbitrum (ARB): is a layer 2 scaling solution, combining multiple transactions into one smart contract message for bulk processing on the Ethereum network.
zkSync: is a layer-2 scaling solution designed to speed up transactions and lower gas fees on the Ethereum network. currently has a huge ecosystem of dapps built on it- but no token yet.
Why are layer 2 solutions so important?
Layer 2 solutions are important because they allow for increased throughput while still holding the integrity of the Ethereum blockchain, allowing for complete decentralization, transparency, and security while also reducing the gas fees and energy used on the Ethereum network.
Although the Ethereum blockchain is the most widely used smart contract blockchain. The Ethereum Mainnet is known to have slow transaction times (15 transactions per second) and expensive gas fees. Layer 2s are built on top of the Ethereum blockchain, keeping transactions secure, speedy, and scalable.
Let's Look at layer 2 rollups.
Rollups are Layer 2 scaling solutions that perform transaction operations off the main Ethereum blockchain (Layer 1), but still, post the transaction data onto Layer 1. Considering the transaction data is on layer 1, rollups are secured by the same layer 1 security measures. Rollups execute transactions outside of layer 1 (reduces gas fees), its proof of transactions resides on layer 1 (maintains security), rollup smart contract which is found on layer 1, can enforce proper transaction execution on layer 2, by using the transaction data that is stored on layer 1.
The two types of rollups:
Optimistic rollups: Sit in parallel to the Ethereum Mainnet on layer 2 and don't perform any computation (mathematical equations) by default. Instead, after the transaction is complete, they submit the new state to the Ethereum Mainnet.
Optimistic roll-up transactions are written into the main Ethereum blockchain, further optimizing transactions by reducing the cost of gas, increasing transaction throughput, and using Ethereum Security. Layer 2 built on optimistic rollups includes Optimism, Arbitrum, etc.
Zero-knowledge rollups (ZK rollups): Bundle thousands of transactions off the main Ethereum chain and create a cryptographic proof which is known as SNARK (succinct non-interactive argument of knowledge). This is called validity proof, which is posted to the Ethereum Mainnet.
The smart contract for a ZK rollup keeps the data of all transfers on layer 2 and the data can only be edited with a validity proof. Meaning, ZK rollups only need validity proof, as opposed to all the transaction data. This function decreases the cost to transact due to fewer data being included. ZK rollups offer near-instant transfers,
Not vulnerable to the attacks that optimistic rollups may be affected by and still secure and decentralized. Layer 2 built on ZK rollups includes zkSync, Immutable X, Loopring, Starkware, etc.
Conclusion:
Layer 2 protocols create a secondary framework, where blockchain transactions and processes can take place independently of layer 1 (main chain). For this reason, these techniques may also be referred to as “off-chain” scaling solutions.
One of the main advantages of using off-chain solutions is that the main chain doesn’t need to go through any structural change because the second layer is added as an extra layer. As such, layer 2 solutions have the potential to achieve high throughput without sacrificing network security.
In other words, a great portion of the work that would be performed by layer 1 can be moved to layer 2. So while the main chain (layer 1) provides security, the second layer (Layer 1) offers high throughput, being able to perform hundreds, or even thousands, of transactions per second.
Too insightful.... thanks so much for this Sir