Why EIP4844? How L2s operate before Dencun deployment

GM Blobs!

Welcome back to the second instalment of our series of educative blog posts, related on EIP4844, Dencun and Ethereum’s scaling efforts!In this edition, we’ll be learning about how Layer 2 (L2) networks work in the pre-Dencun era, why they’re cheaper than Ethereum and how they guarantee correctness and safety for end users!

Introduction

What is a L1?

Layer 1 (L1) is typically used to identify a blockchain that doesn’t depend on any external network: it can carry out all the functions needed by a working blockchain by itself!

Simple examples of L1 blockchains are:

  • Bitcoin

  • Ethereum

  • Solana

  • Avalanche

  • and many, many others… the folks at Alchemy have a list of 34 L1 networks here

Apart from functioning in a completely independent way, all these networks also have in common the fact that other networks or blockchains may use them as a service provider for some specific function they require!

These networks, that rely on a L1 blockchain, are known as Layer 2 blockchain

What is a L2?

Layer 2 is a blockchain that is “layered“ on top of a Layer 1!

A Layer 2 blockchain carries out only part of the functions needed to have a working, decentralized blockchain! They delegate some functions to another, L1, network!

🤔 What’s the typical case?
🤓 Generally, L2 networks offer to carry out computation (~= smart contract execution!) and delegate the transaction persistence (commonly referred to as security) to the L1!

Because of this, within this context, a L1 network is often called the data availability layer for the L2!

What is a data availability layer?

Data availability layer is the term used to indicate the network on which a given L2 writes its own history, making the data of all transaction that occurred available for anyone to read!

❗This is the most important function a L1 carries out for a L2❗

Because L2 networks don’t (currently) work with a network of nodes that all store the transactions the blockchain has processed, the L2 must store this history somewhere!

💡 To explain this simply, one can imagine the L1 and L2 as computer:

  • The L1 is the computer’s hard disk! Here, the computer stores the transactions that occurred on L2, in case somebody wanted to look how cool they are!

  • The L2 is the computer’s CPU! Here, all calculation occurs and is where the result obtained by applying transactions can be seen. Although, this result will soon change, as new transactions arrive!

Users may send transactions to an L2, using it just like they'd use an L1 blockchain! They may also consult the L1 network that stores the L2's transactions to verify what happened on the L2!
Users may send transactions to an L2, using it just like they'd use an L1 blockchain! They may also consult the L1 network that stores the L2's transactions to verify what happened on the L2!

Layer 2 Networks

The two classes of L2

At this point, Blob, you may have heard of two different types of L2 networks, commonly referred to as “rollup“:

  1. Optimistic rollups

  2. ZK rollups

Although it may sound scary and hard to understand, the difference between these is very simple to comprehend! It revolves around the way the two types of rollups write their transactions to L1, and how they convince end users that such transactions have been executed correctly!

Optimistic rollups take the following “trust me bro“ approach:

  1. Optimistically execute incoming transactions on the L2

  2. Post transactions and the result of their execution to L1 (providing all data necessary to verify the transactions have been applied correctly)!

  3. For a fixed amount of time, they allow anyone to dispute the result obtained!
    e.g. : if tomorrow you found that Arbitrum has incorrectly handled your $BLOB transfer, you’d be able to report it! As a result, you’d receive a reward for it, and Arbitrum’s chain would be corrected to reflect the correct, expected, outcome!

ZK rollups instead, take a more “this is the result. here’s the proof“ approach:

  1. ZK rollups use a special version of the EVM, that is able to

    1. Execute the transactions normally

    2. Generate a proof that the execution was correct

  2. Post transactions and the proof of their correct execution to L1

  3. Anyone is now able to verify the L2 correctly executed the transactions, by simply checking the proof provided! (🧠 the big brain fact here is that verifying the proof’s validity is exponentially cheaper than running all the transactions and comparing the L2’s result with yours!)

🤓 Curious readers can read more about these special proofs in this great article!

So… how does an L2 network work today??

Excellent question, Blob!

Generically speaking, we can summarize an L2s function in the following steps:

  1. Users of the L2 send transactions: wrap ETH, swap on Sushiswap, lend on AAVE, buy $BLOB, etc…

  2. The L2 applies the transactions as they arrive: this is what causes you to receive tokens after a swap!

  3. Periodically, the L2 will create a batch of transactions and post them to L1.. 🤔
    we’ll get back to this!

  4. Based on the type of L2, the transactions are either finalized or they enter the dispute period. In the second case, after some time they’ll be finalized as well!

  5. Done! Rinse and repeat.

Now, I’d like to delve deeper into how the L2 posts the transaction batch to L1, as understanding this will explain clearly why we need EIP-4844!

Today, a thing called calldata exists on all EVM blockchains: this is a special space within a user’s transaction where he/she may write anything they want!

🤔 “Wait… I thought calldata has something to do when executing a smart contract?“🤓 “Yes Blob, that’s correct! Indeed, we use calldata to specify what a smart contract must do when sending it a transaction. But we’re not forced to do just that!

So, because of the fact that we can write anything in a transaction’s calldata.. L2s had the bright idea of writing their transactions, proofs and execution results right there!This is a great idea, because thanks to calldata, L2s can now write their history to Ethereum, which grants them one of the highest levels of decentralization and security, as Ethereum is very decentralized and very hard to modify!

But.. there’s a hidden implication about writing data in calldata that hurts all users of the L1 and of the L2:

😵All transactions will be competing in the same fee market!😵

This means that if the gas price on Ethereum spikes because of an NFT mint, the cost that the L2 has to pay to post their data will increase!And this translates in a higher cost for sending transactions on the L2!Viceversa, if a L2 network must post a lot of data, this will hurt all users of Ethereum that don’t even care about the L2’s data!

🦸🏻EIP-4844 to the rescue! 🦸🏻

Because of the problem explained above, the Ethereum community has thought of a very smart way to solve that bad externality:

🧠“Lets create a separate place, where L2s can carry out their business in peace!“ 🧠- Someone, somewhere

EIP-4844 bears this simple idea with it: “*let L2s do their own thing, without disturbing Ethereum users!”*To achieve this, it introduces a new transaction type that enables L2 networks to post all the data they need into the ✨blobspace✨: a new section within an Ethereum block, which will host L2 data-writing transactions.

Furthermore, EIP-4844 will create a separate fee market, enabling Ethereum users and L2 networks to not bother each other and make transactions more expensive for the other party: everyone will drive on their own lane, safely and without interference 🚗

😎 The impact of this upgrade is estimated to be a ~10x reduction in gas fees for L2 transactions! 😎

Not bad eh, Blob?

Conclusion

This concludes our 10,000ft overview of how Layer 2 networks work today!

In the post-Dencun era, not much will change, though: what will be significantly affected is the way in which these networks write and commit to a certain set of transactions on Ethereum.From the user’s point of view, the only major change will be a sizeable reduction in gas fees on L2s, and potentially smaller gas spikes on L1!

In the next post of our series, we’ll dive deep into how EIP-4844 is implemented, what it achieves and some interesting technical details about it!

If you enjoyed this blog post and are following along on our series, please consider following our blog and our X account! Or also, drop by our telegram community if you have any questions, we’d love to hear them!

See ya next time, Blob 👋🏻

Further learning material

  • L2s Deep Dive : for readers looking to delve deeper into L2s, we recommend this blog post!

  • ROLLUPS : an awesome video to understand how optimistic rollups work today! (Finematics makes great videos about a lot of stuff, definitely subscribe to their channel if you’re keen on continuously learning more!)

Subscribe to BLOB
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.