Ethereum L2 solutions

Alberto Molina
iobuilders
Published in
8 min read3 days ago

Introduction

Ethereum Layer-2 (L2) solutions are a set of scaling technologies designed to address the scalability challenges of the Ethereum blockchain. As Ethereum has become the leading platform for decentralized applications (dapps), decentralized finance (DeFi), and various Web3 projects, increased network activity has led to higher transaction fees and slower processing times. L2 solutions operate as independent blockchains, running on top of the main chain (referred to as the Layer 1 or L1) thus inheriting its security. Their main advantages are increased scalability and lower transaction fees although, in some cases, this might entail higher technical complexity and centralization risks.

Types of Scaling Solutions

Sidechains

Although not actual Layer 2 solutions, it is worth mentioning sidechains, as they were conceived and used before Layer 2 technologies. In this sense, sidechains can be considered precursors to Layer 2 solutions.

Sidechains are Ethereum-compatible independent blockchains that use their own consensus models and block parameters to process transactions. They do not actually run on top of the Layer 1 but in parallel to it. Users will transfer funds from the L1 to the sidechain using a bridge or a similar system, then start interacting with it directly.

The main difference between sidechains and layer 2 is that sidechains do not commit transactions or anything into the Layer 1, they are like a completely parallel universe people can “jump into” and “jump from”.

Sidechains can process a larger number of transactions, reducing congestion on the main chain, and they normally do it at a lower cost. However, operating on a sidechain is riskier because it does not inherit the security of Ethereum’s Layer 1. If the sidechain’s security is compromised, the assets on it could be at risk.

Examples : Polygon PoS, Gnosis chain (formerly known as xDai chain).

Example of how a sidechain with a bridge works

Plasma

Plasma is a layer-2 scaling solution for Ethereum that provides a framework for building “off-chain” decentralized applications that are secure, scalable, and swift.

Plasma works by creating smaller chains (child chains) that process transactions independently from the Ethereum mainnet. These child chains periodically submit a summary of their state (such as state roots) to the Ethereum mainnet, allowing for dispute resolution and security through fraud proofs. Each “child chain” extends from the root chain and is generally managed by a smart contract deployed on the parent chain.

This setup helps to scale Ethereum by reducing the load on the mainnet while ensuring the integrity of off-chain transactions.

However plasma chains present two main disadvantages:

  • They do not support general computation (smart contracts), only basic token transfers and a few other transaction types.
  • A malicious operator could submit an invalid transaction and withhold information about it, making it very hard to create a fraud proof.

Examples : OMG Network, LeapDao.

State Channels

State channels are a scalability technology that enables instant and low-cost peer-to-peer Ethereum transactions. They allow participants to securely transact off-chain while keeping interaction with Ethereum Mainnet at a minimum. Channel peers can conduct an arbitrary number of off-chain transactions while only submitting two on-chain transactions to open and close the channel.

Opening the channel means locking up funds into a special smart contract on the Ethereum mainnet (L1).

Closing the channel means submitting the final state of the off-chain exchanged transactions to unlock the funds and distribute them according to the final balances. The final state must obviously be signed by all the involved parties.

The channel can also be updated multiple times before closing it by submitting intermediate states of the parties’ balances, although that could undermine the efficiency gains.

State channels offer a way to make Ethereum transactions faster and cheaper by conducting most of the activity off-chain and only interacting with the blockchain when necessary to update the final state. They are considered secure since they inherit the L1 security but they can only be used to transfer funds between the involved parties, which makes then very limited in terms of usability.

State channel schema

Examples : The Raiden Network, Nitro.

Rollups

Ethereum L2 rollups are a type of second-layer scaling solution that aims to improve the scalability of the Ethereum blockchain by allowing for off-chain transactions to be “rolled up” and periodically committed to the blockchain. This approach enables faster and more cost-effective transactions, making it possible to process a large number of transactions without overwhelming the main Ethereum network.

Rollups bundle together hundreds or even thousands of transactions into a single L1 transaction, effectively distributing the transaction fee cost among all included transactions.

There are two main types of rollups: Optimistic Rollups and ZK (Zero-Knowledge) Rollups. Optimistic Rollups submit transactions to the L1 and are considered valid unless challenged within a certain time period. ZK Rollups, on the other hand, submit validity proofs alongside the transactions to the L1 to cryptographically prove their correctness.

Rollups allow for faster transaction processing at lower costs while inheriting the security of the L1.

Rollups in depth

Optimistic

Optimistic Rollups are a type of roll-up protocol that uses smart contracts deployed on Ethereum to manage interactions between the L2 (Layer 2) and the L1 (Layer 1, Ethereum). They work by aggregating multiple transactions into a single batch and submitting them to the main Ethereum chain. The rollups operate under the assumption (hence “optimistic”) that transactions are valid, but they include a challenge period during which any incorrect transactions can be disputed through fraud proofs.

They are compatible with the Ethereum Virtual Machine (EVM), allowing developers to port existing Ethereum smart contracts to rollups or create new dApps using existing tools. They are designed for interoperability with the Ethereum main chain, allowing users to pass messages and data between L1 and L2.

Optimistic Rollups offer increased scalability, reduced gas fees, and improved latency while inheriting security from the L1. The main drawback is that it requires participants to monitor the transactions submitted to the L1. If a fraudulent transaction is submitted and goes undetected until the challenge period is over, the system could be compromised.

Optimistic rollup

Examples : Optimistic, Base.

zero-knowledge

Zero-Knowledge Rollups (ZK-rollups), just like optimistic rollups, are a type of roll-up protocol that uses smart contracts deployed on Ethereum to manage interactions between the L2 (Layer 2) and the L1 (Layer 1, Ethereum). They aggregate multiple transactions into a single batch they submit to the L1 as well. However, unlike optismitic rollups, transactions validity is not presumed, but proven through the use of zk-proofs, so basically, zk-rollups submit two main type of transactions to the L1, the batches of transactions plus the zk proof validating the batches of transaction.

ZK rollups have been recently evolving a lot, early versions primarily handled simple token transfers, but the latest one are EVM compatible, meaning that smart contracts and dapps can migrate from the L1 to ZK rollups.

They also offer higher scalability, reduced gas fees and improved latency, Zk-rollups require computational effort to generate zk-proofs, but they can finalize transactions faster than optimistic rollups since there is no challenge period.

generic zk-rollup schema

Zk rollups come in three variants :

  • zk-rollups : they submit the L2 transactions unencrypted to the L1 as calldata (blobs in the future). This allows for anyone to recompute the state of the L2 since the content of the transactions is publicly available. They also submit the zk-proof that validate them.
  • Validiums : Validiums submit only hashes of L2 transactions to L1, with the actual data stored off-chain. This approach enhances privacy and reduces costs but relies on trusted external parties for data availability.
  • Volition : hybrid approach that allows users to choose between zk-Rollup and Validium modes for their transactions. Users can decide whether they want their data to be stored on-chain (zk-Rollup) for higher security or off-chain (Validium) for greater scalability and lower costs. This flexibility enables users to balance security and efficiency based on their needs​.

Examples : Polygon zkEVM, StarkNet.

The Future of Layer 2

The future of Ethereum L2 (Layer 2) is a topic of great interest and debate in the blockchain and cryptocurrency community. As the Ethereum network continues to evolve, the need for scalability and efficiency has become increasingly pressing. L2 solutions aim to alleviate this pressure by providing an off-chain scaling solution for Ethereum-based applications.

Current State of L2

Currently, several L2 projects are being developed to address the scalability issues faced by Ethereum. Some notable projects include:

  • Arbitrum: A popular L2 solution that uses Optimistic rollups to reduce transaction costs and increase network throughput. Its main advantages are compatibility with the EVM, high network throughput, and low transaction costs.
  • Optimism: Another prominent L2 project that uses Optimistic rollups to achieve scalability. It has a high network throughput and low transaction costs, making it an attractive solution for DeFi applications.

Challenges and Concerns

However, the rapid growth of the L2 ecosystem also raises concerns about potential risks and challenges. Research by Binance Research suggests that the continuous growth of the L2 ecosystem could lead to:

  • Increased competition: As more L2 projects emerge, competition for users and resources may increase, leading to higher transaction fees and decreased network throughput.
  • Security risks: The migration of assets and users to L2 solutions could potentially reduce the security of the main Ethereum network, as staking rewards for validators may decrease.

Future of L2

Despite these challenges, the future of Ethereum L2 holds much promise. As the L2 ecosystem continues to evolve, we can expect to see:

  • Increased adoption: As L2 solutions become more user-friendly and scalable, we can expect to see increased adoption across various industries, including DeFi, gaming, and social media.
  • Improved scalability: The development of new L2 technologies and protocols will continue to improve scalability, reducing transaction costs and increasing network throughput.
  • New use cases: The L2 ecosystem will enable new use cases, such as decentralized finance (DeFi) applications, that were previously not possible on the main Ethereum network.
  • Addressing related risks : L2s come with their own sets of risks, like the usage in many cases of bridges which can be a point of vulnerability; if they fail or get attacked, users could lose funds.

Conclusion

The future of Ethereum Layer-2 (L2) solutions is promising, with numerous exciting developments on the horizon. As the Ethereum ecosystem evolves, the importance of scalable and efficient solutions cannot be overstated. L2 technologies such as sidechains, Plasma, state channels, and rollups are pivotal in addressing Ethereum’s scalability challenges, reducing transaction fees, and improving processing times.

In conclusion, Ethereum’s Layer-2 solutions are set to play a crucial role in the future of the blockchain. Despite the challenges, the potential for increased adoption, improved scalability, and the emergence of innovative use cases makes L2 technologies an essential component of Ethereum’s continued growth and success. As the ecosystem matures, the collaborative efforts of the community and developers will ensure that Ethereum remains at the forefront of decentralized technology.

--

--