What Is Layer 2? A Complete Guide (2024)

Understanding Blockchain Evolution: From Layer 1 to Layer 2

Layer 1 vs Layer 2 Blockchain

Even though Ethereum has transitioned to a Proof-of-Stake consensus algorithm — which is more energy efficient & provides better scalability — slow transaction times and high fees still remain unresolved.

The need for Layer 2s

To address these issues, the Ethereum community has been exploring and implementing Layer 2 scaling solutions. Some of the most common Layer 2 solutions for Ethereum are State Channels, Sidechains, Plasma, Validium, and our main topic for today, Rollups!

What About Layer 2 Blockchains?

Rollup is a technology that bundles multiple transactions into a single transaction, reducing the computational burden on the Ethereum blockchain. There are two types of rollups: Optimistic Rollups, which rely on users to dispute invalid transactions, and ZK-rollups, which use zero-knowledge proofs to verify transactions.

Optimistic Rollups assume transactions are valid by default and only run the computation, via a fraud proof, in the event of a challenge. Read more on Optimistic rollups at the Ethereum website. Optimistic Rollup Examples: Arbitrum, Boba, Optimism, Fuel, Layer2.Finance, and Metis (until the recent update).

Zero-Knowledge Rollups: Run computation off-chain and submit a validity proof to the chain. Explore Zero-Knowledge Rollups here. ZK-Rollups Examples: Loopring, ZKSync, ZKSpace, Aztec, etc.

Before deep-diving into the technical details of the above-mentioned rollups, let’s see how they perform in the market and why Rubic is perfect to swap to Layer 2s with!

The need for Layer 2s

Despite the fact that these solutions are pretty new to the market (2 years old and less), they’re already outperforming Ethereum by certain metrics.

According to L2beat, the total L2 TVL is worth $5.7B, while Ethereum’s is estimated at $27B (DeFiLlama). However, since August, the total value locked in the Layer 2 ecosystem has been declining. This is most likely due to falling crypto asset prices rather than capital being drawn out of various networks.

Layer 2 activity is ramping up and has surpassed Layer 1 Ethereum in transactions per second. Although this does not imply overall activity on those networks, Delphi Digital, a crypto research firm, on December 21, 2022 reported the ‘Flippening’: over 152 million transactions were processed by both layers of Ethereum, and 58% of them occurred on Layer 2. The chart below shows that the flip occurred in late September, but that it has remained above Ethereum TPS ever since. L2 activity and TPS peaked at 25 TPS in late October.

L2beat has launched a new activity tracker for the ecosystem. It currently reports that the average Ethereum base layer TPS is 11.94, while the L2 TPS is 23.98. Activity on Arbitrum and Optimism alone is close to flipping Ethereum L1’s daily TPS.

February 2023 gave us another milestone in L2 development, according to L2beat, Arbitrum One made history as the first rollup to surpass Ethereum mainnet in daily transaction volume!​​

Rubic x Layer 2s

The Rubic Protocol supports the most popular Ethereum Layer 2 Rollups to date, including Linea, Mantle, Base, Polygon zkEVM, zkSync Era, Scroll, Arbitrum, Boba, Optimism, and Metis. The latter ‌has recently announced its transition to a first-of-its-kind Ethereum Hybrid Rollup: Metis is building the first-ever Hybrid Rollup by combining Optimistic rollup architecture with Zero-knowledge proofs. We have further plans to expand to ZK-rollups such as zkSync, Polygon Hermez, etc.

We can also see a tendency for the significant growth of L2s, and at Rubic.exchange, as they already constitute 12% of our total transaction volume. Although it’s mainly Arbitrum and Optimism, we will be working with Boba and Metis to grow their transaction volumes on Rubic as well.

Why is Rubic perfect in working with L2s?

Rubic.exchange offers more than 15,500 tokens for Cross-Chain Swaps across ‌Layer 2 networks and other 70+ networks, including such popular non-EVM chains like Bitcoin, Tron, Ripple, Solana, etc., with the best rates, highest liquidity, and transaction speeds — all in one click — thanks to Rubic’s aggregation of 220+ DEXs and bridges.

Another advantage of using Rubic for cross-chain interaction with L2 networks is the additional bonuses and airdrops you get.

Rubic aims to accelerate Ethereum scaling and contribute to Layer 2 development. That’s why we maintain strong partnerships with L2 Rollups and develop mutual activities to engage users. Rubic cooperates with L2 networks to provide promotions and airdrops for our community. For example, in March, Rubic is holding a promotion with Boba Network. Take part in a $45,000 reward pool by swapping to the Boba network via Symbiosis!

Using Rubic is an awesome experience, not only because it’s convenient, but also because users become eligible for joint airdrops by holding $RBC.

Let’s dive into the technical details of the different types of rollups.

How Layer-2 Solutions Work

So, how does Ethereum Layer 2 scaling solve the limitations of the Ethereum network’s current capacity? Layer 2 scaling solutions aim to alleviate high transaction fees and slow transaction times by moving transactions off the Ethereum chain and processing them in a more efficient and cost-effective manner. By doing so, Layer 2 solutions can increase transaction throughput and reduce fees, while still maintaining the security and trustlessness of the Ethereum network.

Exploring Layer 2 Technologies: Payment Channels and Rollups

Rollups move the computation and validation of transactions off the Ethereum chain, but they are then settled on the Ethereum mainnet in either a single transaction or a batch of transactions.

Optimistic rollups are the most popular L2 technology today because they started earlier, but ZK rollups have already begun to enter the market.

According to L2beat, 85% of L2 TVL is divided between Arbitrum and Optimism Networks.

L2 rollups are competing hard against each other to bring transaction fees down.

Source: https://l2fees.info/

Let’s compare Optimistic and ZK-Rollups:

In summary, ZK-rollups use Zero-Knowledge Proofs to validate transactions off the Ethereum chain, while optimistic rollups do that through a set of validators and assume transaction validity until proven otherwise. While both solutions aim to increase transaction throughput and reduce fees, they have different trade-offs in terms of computational expense and trust requirements.

Let’s more closely explore the optimistic rollups first.

Optimistic Rollups

Although contracts managing the optimistic rollup protocol run on Ethereum, the rollup protocol performs computation and state storage on another virtual machine separate from the Ethereum Virtual Machine.

Advantages of optimistic rollups include:

  • Massive improvements in scalability, without sacrificing security or trustlessness.
  • Transaction data is stored on the Layer 1 Ethereum chain, ensuring transparency, security, censorship-resistance, and decentralization.
  • Fraud-proofing guarantees trustless finality and allows honest minorities to secure the chain.
  • Computing fraud proofs is open to a regular L2 node, unlike validity proofs (used in ZK-rollups) that require special hardware.
  • Rollups benefit from “trustless liveness” (anyone can force the chain to advance by executing transactions and posting assertions).
  • Optimistic rollups rely on well-designed cryptoeconomic incentives to increase security on the chain.
  • Compatibility with EVM and Solidity allows developers to port Ethereum-native smart contracts to rollups or use existing tooling to create new dApps.

ZK Rollups

ZK-rollups work by processing a large number of transactions off the Ethereum chain and then aggregating them into a single transaction that is validated on the main chain. This reduces the computational load on the main chain and increases its throughput, allowing for faster and cheaper transactions.

The key innovation of ZK-rollups is the use of zero-knowledge proofs to verify the validity of transactions. Simply put, zero-knowledge rollups is a technology that allows one party to prove to another party that they know a piece of information without revealing the information itself. In the context of ZK-rollups, this means that transactions can be validated without revealing any sensitive information, such as the amounts being transacted or the identities of the parties involved.

ZK-rollups offer a promising solution to the scalability problem faced by blockchain networks while also providing enhanced privacy, security, and interoperability. As the adoption of blockchain technology continues to grow, it is likely that more Layer 2 scaling solutions like ZK-rollups will be developed, allowing for even more efficient and cost-effective transactions on the blockchain.

How do ZK-rollups work?

The process of using ZK-rollups involves the following steps:

1. Users submit their transactions to a smart contract on the L2 network.

2. The smart contract aggregates these transactions into a single transaction and generates proof of their validity using zero-knowledge proofs.

3. The proof is then submitted to the main chain, where it is validated by the main chain’s consensus mechanism.

4. Once the proof is validated, the L2 smart contract executes the aggregated transaction and updates the state of the L2 network.

5. Users can then withdraw their funds from the L2 network back to the main chain, if they choose to do so.

ZK-rollups offer a promising solution to the scalability problem faced by blockchain networks, while also providing enhanced privacy, security, and interoperability. As the adoption of blockchain technology continues to grow, it is likely that more Layer 2 scaling solutions like ZK-rollups will be developed, allowing for even more efficient and cost-effective transactions on the blockchain.

At Rubic, we believe in the bright future of Ethereum Level 2s, and will work hard on further integrations and partnerships!