Ethereum Layer 2 Solutions for Beginners

Wilford.Lam
Block Magnates
Published in
3 min readJun 8, 2022

--

What is a Layer 2 Blockchain?

A layer 2 blockchain is a separate blockchain that extends Ethereum and inherits the security guarantees of Ethereum

Why do we need layer 2 blockchains?

There are 3 core pillars of blockchain technology including decentralization, security and scalability. When you look across all the blockchain projects in the ecosystem today, you’ll notice that the blockchain trilemma states that only 2 out of the 3 can be achieved, sacrificing scalability.

We are still in the early days with Ethereum but many users have the same complaints about the technology and the user experiences. The main issues include:

  • Increasing gas fess for transactions
  • Transaction speed is slow

Further, Ethereum has reached its current network capacity with over 1 million transaction per day. For Ethereum to scale to global adoption, layer 2 blockchains will play a pivotal role.

How does a layer 2 blockchain work?

The layer 2 blockchain is in constant communication with the base layer (Ethereum) to ensure security and decentralization exists. The main responsibilities of each blockchain look like this:

  1. Layer 1 handles the security, data availability, and decentralization
  2. Layer 2 handles the transactional burden, with the final profs being provided back o the layer 1 blockchain

By removing the transactional burden from layer 1, the base layer becomes far less congested and the blockchain becomes far more scalable.

Rollups

Rollups are currently the preferred layer 2 solution on Ethereum. The basic mechanism of rollups work by bundling hundreds of transactions into a single transaction that is processed outside of the layer 1 blockchain, where the final transaction data gets posted on layer 1.

There are 2 main approaches to rollups, including Optimistic and ZK (Zero Knowledge) rollups.

Optimistic Rollups

Optimistic rollups sit in parallel to the main Ethereum chain on layer 2. The core concept with Optimistic rollups is that the inherently believe the transaction is correct, therefore they can offer improvements in scalability without actually doing any computation. You might be asking how Optimistic rollups can ensure transactions aren’t fraudulent, and this is where fraud proofs come in.

If someone notices that a transaction could be fraudulent, the rollup will execute a fraud-proof where the transaction computation and execution happens on the main chain, Ethereum. If a transaction is proven to be fraudulent, the transaction is actually reverted and the validator is slashed. The incentives for the validators are aligned in this mechanism as well since the gas fees involved in executing the fraud-proof are reimbursed.

ZK Rollups

ZK-rollups bundle hundreds of transfers off the main chain and create a cryptographic proof. There are forms these proofs can come in:

  1. SNARKs: Succinct non-interactive argument of knowledge
  2. STARKs: Scalable transparent argument knowledge

Both of which are validity proofs that get posted to the main layer 1 chain, Ethereum. A validity proof is when someone goes through all transactions and finds out they were safe and not fraudulent, subsequently the transaction gets submitted to the layer 1 blockchain.

The reason it’s called zero-knowledge proof is because the smart contract maintains the state of all transfers on the layer 2, thereby allowing transactions to process only requiring the validity proof. With ZK-rollups, validating a block is cheaper and quicker because fewer data is required.

--

--

Ivey 22' (MBA) | UBC 18' (Accounting) | UBC 15' (Bsc) | ex-EY | Learning Web3 & finance