Ethereum Layer 2 Solutions

When Ethereum goes through periods of elevated usage, it has historically had a tendency to get very expensive to use. On rare occasions, transaction fees have risen to as much as $200–300 worth of ETH.

To help stop this from happening, teams of developers are building networks ‘on top’ of Ethereum. These are referred to as layer-2 solutions, or L2 solutions for short.

The Need for Layer 2 Solutions

Ethereum scaling has been a constant debate since its inception, but what does this mean?

Ethereum is restricted by how many transactions can be processed on the network, approximately 15 transactions per second. This is because each block can only contain a certain amount of data, known as the block size. In comparison, Visa processes more than 45,000 transactions per second. This means Ethereum is significantly restricted in the amount of transactions which can be verified, leading to significant congestion in the network in times of high demand. You can think of this like a queue of shoppers which moves at a certain pace. If more shoppers join the queue, it can take longer to reach the front and get your transaction processed.

Read: What is Network Congestion? 

This is the central reason why L2 solutions are needed: to solve the scalability problem. This has been a common problem facing blockchains since they were created, or commonly referred to as the ‘The Scalability Trilemma’. This states that any updates or changes to increase scalability should not be at the expense of security or decentralisation. It might be possible to process 45,000 transactions like Visa, but if the network is less secure than there is a problem.

The Scalability Trilemma

The Scalability Trilemma

Solving this problem is essential for creating a fair and well-run network. For example, when Ethereum is experiencing heavy congestion, gas fees can skyrocket—costing US$50 for a simple swap on Uniswap. This can make dApps unusable for the everyday person.

Read: What Is Gas On Ethereum? 

What Are Layer 2 Solutions?

As the name implies, L2 solutions are built on top of layer 1 (L1)—Ethereum’s base layer—to secure off-chain interactions. This simply means they process transactions on this additional layer, instead of Ethereum’s main chain. 

L2 solutions can help solve the scalability trilemma as they’re built on L1, so they can secure off-chain interactions by leveraging the security of L1. This helps to ensure there are no security trade-offs, while helping to provide more block space for transactions to be processed—helping scale the network and reduce transaction fees.

Think of L1 as the settlement layer, making sure everything balances, is secure and is running efficiently. Whereas L2 is where all transactions are batched and processed before being sent to L1 for reconciliation. 

Sidechains are another scaling solution, although are technically not a L2 solution. Sidechains are unique blockchains that are attached to a main chain and allow digital assets from one blockchain to be used in a separate one—moving back to the original when needed. They are independent from the main chain and can implement their own mechanism for achieving consensus. Examples of sidechains are Polygon PoS and xDai Stable Chain.

Scaling via L1

L1 is the base consensus layer of Ethereum protocol, so you may ask why can’t you just improve the base layer Ethereum runs on?

As the scalability problem has been around since Etheruem’s inception, there has been extensive work on scaling Ethereum’s base layer through moving to a proof of stake (PoS) system. This involves migrating from the computational heavy proof-of-work (PoW) system.

PoS is a different kind of consensus mechanism blockchains use to agree on a single true record of a data’s history. Using PoS introduces sharding, a potential L1 scalability solution for Ethereum. Simply put, sharding refers to splitting the entire Ethereum network into smaller, multiple portions called ‘shards’. Sharding is one of the most complex scaling solutions, but the basic idea is to split up transaction processing between smaller groups of nodes to increase the amount of transactions that can happen. This is enormously difficult and poses significant technological challenges.

Although moving to PoS can help solve some scalability issues, there is still a need for L2 solutions to work together to maximise the amount of transactions Ethereum can process and reach the ultimate goal of processing thousands of transactions for widespread adoption.

This is where layer 2 solutions come in.

Types of Layer 2 Solutions

There are many potential L2 solutions, each of which with unique benefits and trade-offs. Below, we define each L2 solution and provide examples of their application.

State channels

State channels improve blockchain performance by moving state-modifying operations off-chain. These are similar to the concept of payment channels in Bitcoin’s Lightning Network, but instead of only being limited to payments, it supports general ‘state updates’. They simply minimise their use of ‘on-chain’ operations, reserved for only the necessary operations.

To contextualise this, imagine an example where you deposited funds into a contract and sign state updates representing the running scores of a basketball game. When the game is finished only the final outcome would be broadcasted to the Ethereum network, helping dapps to move transactions off-chain and increasing the usefulness of the network. Projects currently working on state channels solutions include Raiden Network and Connext.

Rollups

Rollups refer to solutions which bundle sidechain transactions into a single transaction—hence the name ‘roll up’—which generates a cryptographic proof. In its simplest form, it means all state and execution is handled in sidechains—with the Ethereum’s L1 only storing transaction data. They are useful for reducing fees, creating open participation and creating fast transaction throughput. For example, they can increase the throughput of the blockchain from 15 tps to more than a 1,000.

“Rollups are a powerful new layer-2 scaling paradigm, and are expected to be a cornerstone of Ethereum scaling in the short and medium-term future (and possibly long-term as well). They have seen a large amount of excitement from the Ethereum community because unlike previous attempts at layer-2 scaling, they can support general-purpose EVM (Ethereum Virtual Machine) code, allowing existing applications to easily migrate over. They do this by making a key compromise: not trying to go fully off-chain, but instead leaving a small amount of data per transaction on-chain.” – Ethereum founder Vitalik Buterin [An Incomplete Guide to Rollups; Jan. 5, 2021]

There are 2 types of L2 rollups, each with different security models: zero-knowledge (ZK) rollups and Optimistic rollups.

ZK rollups use a validity proof, meaning the smart contract can verify all of the transfers from the bundling hundreds of transfers off-chain. This can be useful as you don’t need all the transaction data to verify it, just the proof.

  • Loopring, Matter Labs, zkSync and StarkWare are examples of projects working on ZK rollups.

Optimistic rollups do not do any computation by default, instead are assumed to be valid by default. Users only submit ‘fraud proofs’’ if they see any mathematically verifiable misbehaviour. As computation is a slow, expensive part of using Ethereum, Optimistic rollups can offer up to 10–100x improvements in scalability dependent on the transaction.

  • As of this writing, Optimism and Fuel Network are working on these implementations. Synthetix has deployed the first app on Optimism’s public testnet.

Plasma

Plasma is a framework for creating scalable dapps on the blockchain. They create smaller blockchains which are connected to the main blockchain via a smart contract. dapps then run via these smaller mini blockchains, greatly lowering the strain on the main network.

The communication between these mini blockchains and the main chain are secured by fraud proofs, with the main chain responsible for securing the network and punishing the malicious actors. Simply, fraud proofs are a mechanism in which a Plasma mini-chain files a complaint to the main chain. OMG Network and Loom Network are behind some common Plasma L2 implementations.