EIP-4844 and its impact on rollups' operations.

Introduction

EIP-4844 also known as proto-danksharding marks a pivotal development in the evolution of Ethereum's scaling solutions. In line with Ethereum's goal of executing at least 100,000 transactions per second (TPS) through rollups, this proposal focuses on enhancing the capabilities of rollups. It carries significant implications for the overall scalability and efficiency of the Ethereum network. In this article, we'll delve into the key aspects of EIP-4844 and explore its stands on improving Ethereum's scalability through rollups.

Understanding rollups

Before we explain EIP-4844, you must have a basic understanding of rollups. This prerequisite knowledge will help you appreciate the end goal EIP-4844 is driving towards. A rollup is a layer-2 blockchain designed to enhance scalability and reduce transaction costs by moving a significant portion of transaction processing off the main blockchain (layer-1). There are four basic responsibilities every blockchain should be able to perform; execution, consensus, data availability, and settlement. Execution is the process through which nodes on the blockchain carry out and validate transactions. Settlement is simply the finalization of transactions i.e., a certain point in time when a transaction on a blockchain can no longer be reversed. Consensus refers to the mechanism through which nodes agree on the state of the blockchain. Data availability is the accessibility and ever-presence of transaction data across the blockchain for verification.

A layer-1 (L1) or a primary blockchain carries out the four core responsibilities of a blockchain without reliance on another chain e.g., Ethereum while a layer-2 (L2) or secondary blockchain depends on an L1 blockchain to carry out some of its responsibilities e.g., rollups.

Ethereum execution rollups were designed to combat the high transaction fees users were made to pay, stemming from the increased demand and competition for blockspace on Ethereum. This increase in demand, more often than not, usually resulted from some increased activity on the main chain e.g. airdrop farming, NFT minting, etc. This occurrence is known as blockspace scarcity.

Blockspace scarcity explained.

An Ethereum block has a limit of 30 million gas. This means that transactions contained in a single block must not consume up to 30 million gas when they're executed by the Ethereum Virtual Machine (EVM). Gas is a unit for measuring the computational effort used by the EVM to perform any operation. As a result, users compete for blockspace to ensure that their transactions are executed and finalized within the shortest possible time. This competition is based on two factors; the amount of gas that the user is willing to pay for execution of the transaction (gas limit) and the amount of ETH that the user is willing to pay for each unit of gas spent in executing the transaction (gas price). The transaction fee or gas fee is the product of the gas limit and gas price set by the transactor. A transaction with a higher transaction fee is more likely to be included in a block by a block proposer faster than a transaction with a lower fee. This is because high-fee transactions increase the reward the block proposer gets for proposing the block.

Back to rollups

The introduction of execution rollups offered users a cheaper way to utilize Ethereum. Instead of transacting directly on Ethereum, users could now conduct their transactions through rollups which offer lower transaction fees, availability of transaction data on Ethereum, and faster confirmation times than Ethereum. In the EIP-4844 documentation, it's noted that optimistic rollups like Optimism and Arbitrum typically have transaction fees that are 3-8 times lower than fees on Ethereum, whereas ZK rollups boast even lower fees, ranging from 40-100 times less than what Ethereum charges.

The image compares the gas fees for transferring ETH and exchanging tokens on Ethereum’s layer 1 and its layer 2 rollups.

Source: https://l2fees.info/
Source: https://l2fees.info/

Types of Rollups and how they work.

There are two major types of rollups; optimistic rollups and validity rollups. Optimistic rollups also known as fraud-proof rollups take an approach where the default assumption is that the majority of transactions conducted on it are valid, requiring intervention, specifically dispute resolution, only when discrepancies arise. A rollup sequencer bundles multiple transactions conducted on the rollup into a single block which is compressed and sent off as calldata to the main chain (Ethereum). To compensate for its assumption of transaction validity, optimistic rollups implement a challenge period usually 1 to 2 weeks for nodes to investigate and challenge the validity of transactions in the batch sent by the rollup on-chain which is done through fraud-proofs. A fraud-proof is a claim demanding the immediate reversal of a batch because a transaction in that batch was found invalid. If after the waiting period, there’s no fraud-proof against transactions in a particular batch, the transactions are finalized and added to the Ethereum blockchain.

Similar to optimistic rollups, a validity rollup sequencer bundles multiple transactions conducted on the validity rollup into a single block which is compressed and ready to be sent off as calldata to the main chain. This is where the similarities between both types of rollups end. A validity proof is generated using a Zero Knowledge Proof (ZKP) algorithm which is sent alongside the calldata to the main chain. The validity on-chain smart contract proceeds to verify the validity proof by reconstructing it using the same algorithm and parameters used off-chain. If the resulting validity proof from the smart contract matches the validity proof sent alongside the calldata, then the transactions in this particular block are considered valid and finalized immediately.

The major drawback of rollups.

Rollups have made the cost of transactions way cheaper than ever before. But “cheaper” is not the goal of rollups. I believe that rollups can be fine-tuned to the extent that users no longer have to pay transaction fees. Unfortunately, this is very much unlikely to be achieved because rollups currently bear the burden of paying exorbitant high gas fees solely to send their batches of transactions to Ethereum as calldata. The weird thing here is that these high fees are consistently influenced by the increasing demand for blockspace (blockspace scarcity) whereas the calldata sent by rollups are not stored in blockspaces. Why is this so?

Every operation carried out on Ethereum consumes gas and has to be paid for. The price for storing a zero byte and a non-zero byte in a calldata is 4 gas and 16 gas respectively. When the demand for blockspace skyrockets, the cost of 1 gas does the same. This is done to allow proper management of the network’s congestion. Once this happens, the gas fee rollups have to pay for calldata increases too. Calldata refers to the input data that is passed to a function in a smart contract during a transaction. It is a read-only area where function arguments and data sent to a smart contract are stored. The EVM processes this calldata to execute the desired function within the contract. With rollups, the calldata is passed to the function of the roll-up smart contract responsible for verifying that the data sent corresponds with the rollup state. The larger and more complex the calldata is, the more gas the EVM consumes to execute the function.

Solving the rollup problem with EIP-4844

EIP is short for Ethereum Improvement Proposal. An EIP is a proposal that is approved by the Ethereum community and written by one of its members. It either describes a solution to a problem on the blockchain or suggests a possible feature that could improve the blockchain’s system. EIP-4484 also called proto-danksharding proposes the idea of having rollups send in their transaction batches to Ethereum as blobs instead of calldata. The cost of calldata arises from the computational effort the EVM will expend to process the calldata before it can be used by the verification function of the roll-up smart contract. With the implementation of blobs, a lot of things change. Firstly, the EVM will no longer have to access nor process the rollup data because the blobs containing the rollup data will be sent to the beacon chain (Ethereum’s consensus layer) instead of the execution layer like calldata. Since we won’t be sending blobs to the EVM, how then is the rollup smart contract going to verify the rollup state? This is where blob-carrying transactions come in. A blob-carrying transaction has a blob_versioned_hashes parameter that stores the hashes of all the blobs it is linked to in a list. The roll-up smart contract accesses this list of hash(es) from the blob_version_hashes parameter and proceeds with reconstructing and verifying the rollup state.

Blocks and blobs

A blob is large and putting it in a block would increase the size of the block which in turn increases the computational difficulty of verifying and finalizing the block; a huge disadvantage for lightweight nodes on the network. To avoid such complications, a blob is attached to a block in a manner resembling a sidecar configuration while the commitment (hash) of the blob is referenced inside the block it is attached to. This serves as evidence that at a certain point in time, XYZ rollup sent its data in a blob and the blob was attached to this block. This is because blobs unlike calldata are not designed to be stored permanently on-chain. Blobs will be left on-chain for about 4096 epochs (approx. 18 days) after which they are pruned from the blockchain. It is assumed that this is enough time for any node to challenge the validity of any transaction from the blob data or reconstruct the rollup state. EIP-4844 specifies 3 blobs per block and 6 blobs per block as the ideal and maxblob-to-block attachment respectively. The adoption of EIP-4844 will introduce a new fee market, the blob gas fee market that will operate alongside the gas fee market. The cost of storing rollup transaction data on-chain will be measured in blob gas instead of the gas. If there's increased network activity in Ethereum and the cost of gas skyrockets, rollups are not affected in any way because they expend blob gas in sending blobs on-chain, not gas.

The Dencun upgrade which was all about implementing EIP-4844 on the Goerli testnet happened today, the 17th of January, 2024, and the entire Ethereum community is excited about the changes this upgrade will facilitate in the Ethereum ecosystem.

Subscribe to Trinity Morphy
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.