Hexncoin

🧱 Layer 1, Layer 2 & Rollups

What Is a Layer 2?

How L2s inherit Layer 1 security while processing transactions elsewhere.

6 min read

Borrowing a Layer 1's security

A Layer 2 is a protocol built on top of a Layer 1 that does most of its transaction processing elsewhere, then periodically checks in with the base layer. It doesn't need its own army of validators from scratch - it leans on the L1's existing security instead.

That's the key difference from just building a brand-new, separate blockchain: a well-designed Layer 2 is only as trustworthy as its connection back to the L1 lets it be.

The basic recipe

A component called a sequencer collects transactions and orders them, much faster and cheaper than the base layer could on its own. Periodically, a summary of what happened - compressed data, and often a proof - gets posted back to the Layer 1.

Once that summary is on the L1, it inherits the L1's guarantees: the data is public, and the L1's own security now backs up the L2's history. Different Layer 2 designs differ mainly in how they prove that summary is honest - the subject of the next lesson.

Why fees drop

Posting to a Layer 1 costs money - it's competing for the same limited block space as everyone else. A Layer 2 batches hundreds or thousands of transactions into one L1 posting, so that cost gets split across everyone in the batch instead of paid individually.

That's the practical payoff for users: transactions that might cost dollars directly on the L1 can cost fractions of a cent on a well-used Layer 2.

You're still ultimately paying for L1 block space - just your tiny slice of one shared posting instead of a whole transaction's worth.

Check your understanding

3 questions from this lesson, with the correct answer already marked.

1. What makes a Layer 2 different from an entirely separate, standalone blockchain?

  • L2s don't have their own transactions
  • L2s periodically settle back to a Layer 1 and inherit its security
  • L2s can't be hacked
  • L2s don't charge any fees

The defining trait of a Layer 2 is that it leans on an underlying Layer 1 for security, rather than securing itself from scratch.

2. What does a Layer 2's sequencer do?

  • Mines the Layer 1's blocks
  • Orders and batches Layer 2 transactions before they're posted to Layer 1
  • Stores users' private keys
  • Sets the price of gas on Layer 1

The sequencer is the component that collects and orders L2 transactions ahead of posting a summary to the base layer.

3. Why are Layer 2 transaction fees typically much lower than paying the Layer 1 directly?

  • L2s are exempt from paying for L1 block space
  • The cost of one L1 posting is split across many batched L2 transactions
  • L2 validators work for free
  • L1 block space is unlimited

Batching means many users share the cost of a single L1 posting instead of each paying for their own.