What is a layer 2?
A layer 2 is a network built on top of a blockchain that processes transactions off the main chain to make them faster and cheaper.
A layer 2 is a separate network built on top of a blockchain that handles transactions away from the main chain and then records the results on it. The aim is to make transactions faster and cheaper while borrowing the security of the underlying chain, known as layer 1.
Why are base blockchains slow and expensive?
On bitcoin or Ethereum, every node processes and stores every transaction. To keep that manageable for ordinary computers, each block is limited in size and arrives on a fixed schedule. The result is a network that can handle only a small number of transactions per second.
When demand exceeds the space available, users outbid one another and fees rise, as the guide to gas fees explains. Raising the limits would help, but it would also make nodes costlier to run and push out smaller participants.
How do rollups work?
A rollup is the main kind of layer 2 on Ethereum. An operator called a sequencer collects thousands of transactions, processes them off the main chain and "rolls them up" into one compressed batch. It then posts the batch to Ethereum. Users split the cost of that single layer 1 transaction among them.
There are two types:
- Optimistic rollups assume each batch is valid and allow a challenge period, typically about a week, in which anyone can prove an error. Arbitrum, Optimism and Base, which was built by the exchange Coinbase, work this way.
- Zero-knowledge rollups attach a mathematical proof that the batch was calculated correctly, which Ethereum checks right away. Examples include zkSync and Starknet.
How do payment channels work?
Bitcoin's main layer 2, the Lightning Network, takes a different route. Two parties lock some bitcoin into a shared address on the main chain, which opens a channel. They can then pay each other back and forth instantly, any number of times, by exchanging signed updates of who is owed what.
It works like running a tab at a bar. Only the opening and the final settlement are recorded on the blockchain. Channels link together, so a payment can hop through intermediaries.
What are the risks?
Layer 2s make trade-offs that the base chain does not:
- Central control. Many rollups have relied on a single sequencer run by one company. If it goes down, the network stalls, and the operator decides the order of transactions. This cuts against decentralization.
- Bridges. Moving funds between layers depends on software called a bridge. Bridges have been frequent targets of large thefts.
- Delays. Withdrawing from an optimistic rollup to layer 1 can take days because of the challenge period.
A layer 2 is also not the same as a sidechain. A sidechain is an independent blockchain with its own security, linked to the main chain only by a bridge.
This guide explains how things work. It is not financial, legal or tax advice. Last updated .