start learning →
intermediate13 min read

Layer 2 explained: rollups, the Lightning Network and why fees differ

Layer 2 networks move transactions off a busy blockchain and settle them back on it later. Here is how optimistic and ZK rollups and the Lightning Network work, why their fees are lower, and the extra risks you take on.

key takeaways
  1. A layer 2 processes transactions away from the main chain (layer 1) and periodically settles a compressed record back on it, so many users share one layer 1 fee.
  2. Optimistic rollups assume batches are valid unless someone proves fraud during a challenge window, which is why native withdrawals to Ethereum usually take about a week.
  3. ZK rollups post a cryptographic validity proof with each batch, so withdrawals can finalise once the proof is verified, at the cost of heavier computation.
  4. The Lightning Network uses payment channels on Bitcoin: only opening and closing a channel touch the blockchain, and payments in between are off-chain.
  5. Lower fees come with extra layers of risk: sequencer outages, upgrade keys, bridge hacks and liquidity split across many networks.

A layer 2 (L2) is a network that processes crypto transactions away from a main blockchain, the "layer 1", and then settles a compressed summary of them back on that chain. Because hundreds or thousands of transactions share the cost of one layer 1 record, each user pays a fraction of the fee they would pay on the main chain. On Ethereum the dominant design is the rollup, in two flavours (optimistic and ZK); on Bitcoin the best-known layer 2 is the Lightning Network, which uses payment channels instead.

This guide explains why layer 2s exist, how each design works, what actually determines the fee you pay, and the risks that come with the cheaper transactions. It assumes you know what a blockchain and a gas fee are; if not, start with what is cryptocurrency and the gas section of Ethereum and altcoins.

Risk first. Crypto-assets are highly volatile and you can lose all of the money you put in. Layer 2 networks add their own technical and operational risks on top of those of the underlying blockchain. Leveraged products such as CFDs magnify losses, and most retail CFD accounts lose money.

Why blockchains need a second layer

A public blockchain such as Bitcoin or Ethereum asks every full node to check every transaction. That is what makes it hard to cheat, and it is also what makes it slow and expensive to scale. Each block has limited space, and when more people want to transact than fit, they bid against each other for inclusion. On Ethereum this bidding shows up as rising gas prices; on Bitcoin it shows up as higher fees per byte. Our guide to crypto gas fees goes into the fee market in detail.

There are broadly two ways to handle more activity:

  • Make the base layer itself faster, with bigger blocks, faster block times or more demanding hardware for validators. This is the route some newer layer 1s have taken. The usual trade-off is that fewer people can afford to run a node, which concentrates control. Our guide to Solana describes one example of that approach.
  • Keep the base layer conservative and move activity on top of it. The layer 1 becomes a settlement and security layer, and the bulk of everyday transactions happens on layer 2 systems that borrow its security in some way.

The phrase "borrow its security" is doing a lot of work, and how much security an L2 really inherits is the central question for anyone using one. A system that only posts occasional summaries to Ethereum but lets a single company freeze or rewrite balances is not the same as a system where users can always force their way out using the layer 1 alone.

How a rollup works

A rollup runs its own chain where users send transactions. A component called the sequencer orders those transactions, executes them and gives users a quick confirmation. Periodically, the rollup bundles a large batch of transactions, compresses the data and posts it to Ethereum together with a commitment to the rollup's new state (essentially a fingerprint of every balance after the batch).

Posting the transaction data to layer 1 matters because it means anyone can reconstruct the rollup's state from Ethereum alone. If the rollup's operators vanished, the data needed to work out who owns what would still be on Ethereum. That property is called data availability, and it is the main thing that separates a rollup from a separate chain with a bridge.

What remains is the question of how Ethereum knows the posted state is correct. This is where the two families differ.

Optimistic rollups

An optimistic rollup posts its batches and assumes they are valid. Anyone watching can challenge a batch during a challenge window by submitting a fraud proof that shows the state transition was wrong. If the challenge succeeds, the bad batch is reverted and whoever posted it is penalised.

The consequence for users is the withdrawal delay. Moving funds from an optimistic rollup back to Ethereum through the rollup's own bridge typically involves waiting for the challenge window to pass, which on the largest optimistic rollups has been about seven days. Third-party "fast bridges" will pay you out on layer 1 sooner, but they charge a fee for fronting the money and add their own smart-contract risk.

Arbitrum, Optimism and Base are well-known examples of optimistic rollups on Ethereum.

ZK rollups

A ZK (zero-knowledge) rollup posts each batch with a validity proof: a compact piece of cryptography that proves the new state follows correctly from the old one and the transactions in the batch. An Ethereum smart contract verifies the proof. If it checks out, the batch is final as far as Ethereum is concerned, with no need to wait for challenges.

The trade-off is computational. Generating proofs is expensive and technically demanding, especially for full compatibility with Ethereum's smart contracts, which is why ZK rollups were slower to support general applications. In practice, withdrawals from a ZK rollup can still take hours rather than minutes, because operators prove and post batches at intervals to spread the cost.

Despite the name, most ZK rollups are not built for privacy. "Zero-knowledge" refers to the proof technique, not to hiding your transactions; on most of them, activity is as public as on Ethereum.

Optimistic versus ZK at a glance

  • How validity is established: optimistic rollups rely on someone challenging a bad batch; ZK rollups prove every batch up front.
  • Withdrawal to layer 1 through the native bridge: roughly a week on optimistic rollups; usually much shorter on ZK rollups once a proof is posted.
  • Main cost driver: for both, posting data to Ethereum; ZK rollups add the cost of generating proofs.
  • Main failure mode: for optimistic rollups, nobody watching and challenging; for ZK rollups, a bug in the proof system or its verifier.

The Lightning Network on Bitcoin

Bitcoin's scripting language is deliberately limited, so rollups in the Ethereum sense are not straightforward there. The Lightning Network, first proposed in a 2015 paper, takes a different approach based on payment channels.

Two parties lock bitcoin into a shared on-chain output, which opens a channel. From then on they can send payments back and forth by exchanging signed updates of how the locked balance is split. None of these updates goes on the blockchain. When they are done, either party broadcasts the latest balance and the channel closes, which is the second on-chain transaction. Hundreds of payments can happen between those two on-chain events.

Channels link into a network. If Anna has a channel with Ben and Ben has one with Chloe, Anna can pay Chloe through Ben without Ben being able to steal the payment, because each hop is locked with the same cryptographic condition. Routing nodes may charge small fees for forwarding.

Lightning suits frequent, small payments. It has practical limits:

  • Liquidity in channels. A payment can only route if every channel along the path has enough balance on the right side. Large payments often fail or need splitting.
  • Being online. If your counterparty broadcasts an old channel state to cheat, you (or a "watchtower" service acting for you) must respond within a set time. Most mobile users rely on a wallet provider to manage this, which brings back an element of trust.
  • On-chain costs to open and close. When Bitcoin fees are high, opening or closing a channel is expensive, and small channels can become uneconomic.

Why layer 2 fees are lower, and what sets them

The fee you pay on a rollup has two main parts:

  1. An execution fee for the rollup's own processing. Because the sequencer can handle far more transactions than Ethereum's base layer, this part is usually tiny.
  2. A share of the layer 1 data cost, the cost of posting your transaction's compressed data to Ethereum. This has historically been the larger part.

Before March 2024 rollups posted their data to Ethereum as ordinary transaction data, competing with every other Ethereum user for block space. The Dencun upgrade, activated on Ethereum on 13 March 2024, introduced a separate, cheaper space for this data called blobs (the change is known as EIP-4844). Blobs have their own fee market and are pruned from nodes after a few weeks, which is enough time for anyone to check them. Fees on the major rollups fell sharply after the upgrade, although by how much varied by network and over time.

Blob space is itself limited, so when many rollups want it at once its price can rise too. Layer 2 fees are lower than Ethereum's, but they are not fixed and they are not zero.

Worked example: one swap, two layers

Illustrative numbers only, to show the mechanism. Assume ether is priced at 3,000 dollars.

On Ethereum layer 1, a token swap uses 150,000 gas. With a base fee of 18 gwei and a 2 gwei tip, the price is 20 gwei per unit of gas.

  • Fee: 150,000 times 20 gwei = 3,000,000 gwei = 0.003 ETH.
  • In dollars: 0.003 times 3,000 = 9 dollars.

On a rollup, the same swap is one of 2,000 transactions in a batch. Posting the batch's data to Ethereum costs 0.01 ETH in total, and the rollup charges its own execution fee of 0.000002 ETH per transaction.

  • Your share of the layer 1 data cost: 0.01 divided by 2,000 = 0.000005 ETH.
  • Plus execution: 0.000005 + 0.000002 = 0.000007 ETH.
  • In dollars: 0.000007 times 3,000 = 2.1 cents.

If congestion doubled the layer 1 gas price, the layer 1 swap would cost 18 dollars, while the rollup user's share of the data cost would rise from 1.5 cents to 3 cents, because the extra cost is spread over 2,000 users. That is the whole economic case for layer 2 in one sum. It also shows the dependency: the rollup fee still moves with the cost of posting data to the main chain, and with how many users share each batch.

Worked example: a Lightning channel

Illustrative numbers only. You open a Lightning channel with 0.01 BTC. Opening costs an on-chain fee of 0.00002 BTC, and closing later costs another 0.00002 BTC.

  • On-chain cost: 0.00004 BTC in total.
  • Over the channel's life you make 200 small payments, each paying 0.0000001 BTC in routing fees: 0.00002 BTC in total.
  • All-in: 0.00006 BTC across 200 payments, or 0.0000003 BTC per payment.

Had each of the 200 payments been a separate on-chain transaction at 0.00002 BTC, the total would have been 0.004 BTC, more than 66 times as much. The saving depends on using the channel many times; open a channel for two payments and close it, and you have simply paid two on-chain fees.

The risks layer 2 adds

The marketing around layer 2s focuses on speed and cost. The risks are less visible, and some of them are not technical at all.

Sequencer centralisation

Most rollups have used a single sequencer run by the team behind the network. If it goes offline, the rollup stops processing transactions until it returns, as has happened on several networks. A sequencer can also reorder or delay transactions. Well-designed rollups give users an "escape hatch" to submit transactions directly via Ethereum if the sequencer censors them, but using it is slow and technical.

Upgrade keys and training wheels

Many rollups can be upgraded by a multi-signature group or a security council. That power exists so bugs can be fixed quickly, but it also means a small group could in principle change the rules, including how withdrawals work. Independent trackers, such as L2BEAT, classify rollups by how much of this control has been removed. Check the stage a network has reached rather than assuming it is as secure as Ethereum.

Bridges

Moving assets between chains relies on bridges, which hold large pools of locked tokens and have been among the most attacked pieces of software in crypto. A rollup's native bridge inherits the rollup's own security model; third-party bridges add their own. If a bridge is drained, the tokens it issued on the other side can lose their backing.

Fragmented liquidity

Every layer 2 has its own pools, order books and versions of tokens. The same token can trade at slightly different prices on different networks, and moving between them costs time and fees. Our guide to crypto order books and liquidity explains why thinner pools mean more slippage on larger orders.

Wrong network, lost funds

Exchanges and wallets often support the same token on several networks. Sending funds on a network the recipient does not support is one of the commonest ways people lose crypto through their own mistake, and not every platform can recover it. Check the network as carefully as the address.

Layer 2 tokens are not the same as layer 2 usage

Many layer 2 projects have issued their own tokens, mostly used for governance votes. Holding one does not give you a claim on the network's fees, and transaction fees are often paid in ether rather than in the governance token. Large allocations to teams and investors, released on vesting schedules, are common. Before treating any such token as a bet on "layer 2 adoption", read its supply schedule; our guide to tokenomics and token supply shows how.

If you trade crypto through CFDs, note that brokers usually offer only the largest coins, and many layer 2 tokens are not available at all. Where they are, ESMA rules cap retail leverage at 2:1, and spreads on smaller tokens are typically much wider than on bitcoin or ether. A CFD gives you price exposure only: you cannot use it to pay fees on a rollup or open a Lightning channel. Our comparison of crypto CFDs vs buying crypto explains the differences, and the position size calculator helps you size any trade from your stop distance.

How to check a layer 2 before using it

A short checklist, none of which needs deep technical knowledge:

  1. Is it a rollup or a sidechain? A sidechain has its own validators and security; it does not inherit Ethereum's. Both can be useful, but the risk is different.
  2. Where does its data go? Rollups post data to Ethereum. Some systems post it elsewhere to cut costs further, which weakens your assurance that you can always rebuild your balance.
  3. Who can upgrade it, and how fast? A delay before upgrades take effect gives users time to leave if they disagree.
  4. Is there a working escape hatch? Can you withdraw if the sequencer stops?
  5. How long do withdrawals take, and what do fast bridges charge?
  6. Which tokens are native and which are bridged? A bridged token is only as good as the bridge.

Common mistakes

  • Assuming L2 means "as safe as Ethereum". Some are close; many still depend on a small group of operators or keys.
  • Forgetting the withdrawal window. Funds moved back to Ethereum from an optimistic rollup through the native bridge may be unavailable for about a week.
  • Sending on the wrong network. Always check that the recipient supports the specific network you are using.
  • Treating fees as permanently negligible. Fees rise with demand for blob space and on busy days on the rollup itself.
  • Using unknown bridges for small savings. A bridge failure can cost the whole amount.
  • Equating a governance token's price with network usage. The two can diverge for long periods, and token supply schedules often matter more.
  • Opening a Lightning channel for one or two payments. The on-chain costs of opening and closing can exceed what you save.

Frequently asked questions

What is the difference between layer 1 and layer 2?

Layer 1 is the base blockchain, such as Bitcoin or Ethereum, which orders and secures transactions itself. A layer 2 is a system built on top that processes transactions separately and settles a summary, or the final balances, back on the layer 1. The aim is lower fees and higher capacity while relying on the layer 1 for final security.

Why do withdrawals from some rollups take a week?

Optimistic rollups assume each batch is valid unless someone challenges it with a fraud proof. To give challengers time, withdrawals through the rollup's own bridge wait for the challenge window to pass, which on the largest optimistic rollups has been about seven days. ZK rollups prove each batch up front, so they do not need that wait.

Are layer 2 transactions free?

No. You pay an execution fee to the rollup and a share of the cost of posting data to Ethereum. Since the Dencun upgrade in March 2024 that data cost has usually been very small, but it rises when demand for blob space increases, and the rollup's own fees rise when it is busy.

Is the Lightning Network a rollup?

No. Lightning is a network of payment channels. Only opening and closing a channel are recorded on Bitcoin; payments in between are exchanged privately between channel participants. It is designed for frequent small payments rather than general smart-contract activity.

Can I trade layer 2 tokens with a CFD broker?

Some brokers list a few of the larger ones, many do not. Where available, EU retail leverage on any crypto CFD is capped at 2:1, spreads are usually wider than on bitcoin, and overnight financing applies. A CFD only gives price exposure; it does not let you use the network.

Do layer 2s make Ethereum fees cheaper?

They move activity off Ethereum's base layer, which can ease congestion there, but layer 1 fees still depend on demand for Ethereum block space itself. What layer 2s mainly do is give users a cheaper place to transact while settling on Ethereum.

Not investment advice. This is general information and education, written without knowledge of your circumstances. It is not a recommendation to buy or sell any instrument. Past performance is not a reliable indicator of future results. Trading leveraged products carries a high risk of losing money. Risk warning