What is EIP-4844? Proto-Danksharding Explained

What is EIP-4844? Proto-Danksharding Explained

One of the greatest deterrents to the mass adoption of Ethereum is the blockchain’s notoriously high gas fees — which refers to the transaction fees that users must pay to transact on (and interact with) the blockchain.

When onchain activity increases, these fees can also increase dramatically — making it expensive to transact on the blockchain, and thus inaccessible to many.

In the Ethereum Foundation’s efforts to improve the chain, and to solve its high gas fee problem, EIP-4844 was proposed to reduce transaction fees and increase throughput (or the amount of transactions that a blockchain can process) — and as an interim solution before the full implementation of sharding on the Ethereum blockchain.

In this blog post, we’re going to dive into everything you need to know about EIP-4844, the “proto-danksharding” mechanism that it aims to implement, and why it’s important in moving the chain forward.

What is EIP-4844?

The Ethereum Improvement Proposal 4844 (EIP-4844), also called the Cancun upgrade, is a network update proposed to reduce transaction fees on Ethereum. EIP-4844 introduces a new transaction type called a blob-carrying transaction to bring down gas costs.

Blob-carrying transactions are like any regular Ethereum transaction but with some extra set of data called a blob.

These blobs are considerably large (~125 kB) and cheaper than the current calldata — an immutable and read-only memory for storing transaction data.

EIP-4844 is also known as proto-danksharding, which implements the framework and logic of danksharding like new transaction formats and verification rules.

If it sounds like alien concepts, let’s dive further into EIP-4844 and simplify its technicalities.

Events leading to EIP-4844

Ethereum went through a series of upgrades in the last three years to transition from Proof-of-Work (PoW) to Proof-of-Stake (PoS) consensus and also make the chain more scalable.

The following timeline provides a broad overview of these updates:

  1. On December 1, 2020, the PoS-powered Beacon Chain went live and Ethereum users could stake their ETH on this separate chain to validate transactions.
  2. In September 2022, the Beacon Chain merged with the Ethereum Mainnet (The Merge), bringing together the execution and consensus layers of the network.
  3. On April 13, 2023, the Shanghai upgrade (EIP-4895) went live, enabling staked ETH withdrawals for Ethereum validators.

While these upgrades are necessary for Ethereum scalability, none of them directly improve the chain’s transaction speed or gas prices. Sharding and danksharding, however, are upgrades that will make the chain actually scalable.

But what do these terms mean? Let’s take a look.

What is sharding?

Sharding refers to dividing a blockchain network into smaller units called ‘shards’. Each shard can then parallelly process transactions to maximize transaction throughput, reduce network congestion, and lower gas fees.

But it’s easier said than done. To get to sharding, Ethereum has to undergo several intermediary steps, like danksharding and proto-danksharding.

What is danksharding?

Danksharding is a new sharding architecture that relies on large pieces of data called blobs to scale the Ethereum blockchain. Rollup-centric layer 2 protocols use the extra blob data spaces to decongest the network, thereby reducing transaction charges.

But implementing full danksharding on Ethereum will not happen in one go. It will require several prior upgrades like the EIP-4844 or proto-danksharding.

What is proto-danksharding?

In the words of Vitalik Buterin, an Ethereum co-founder, proto-danksharding implements “most of the logic and “scaffolding” of danksharding, without implementing any actual sharding.

In other words, proto-danksharding is a prototype of danksharding that provides the “scaffolding” or a framework to later implement other sharding upgrades.

So how does proto-danksharding or EIp-4844 work? Let’s find out.



How does EIP-4844 work to reduce gas fees?

The primary purpose of EIP-4844 or proto-danksharding is to reduce Ethereum gas fees by using blob-carrying transactions.

Blob data is cheaper because it is inaccessible by the Ethereum Virtual Machine (EVM), which can only view a commitment to the blob (more on this later).

Moreover, the data bandwidth in proto-danksharding is fixed at 1 MB per slot.

But why do Ethereum developers want to build a new type of (blob-carrying) transaction to reduce gas when they can simply work on making calldata 10x cheaper? Because the latter might lead to average case/worst case load mismatch.

Let us explain the problem.

The average Ethereum block size is ~90 kB, but theoretically, the maximum block size is ~1.8 MB. This means Ethereum blocks can accommodate more transactions during high network activity but will require extraordinarily high gas fees.

If calldata becomes 10x cheaper, then transaction volume will go up 10 times, leading to 10x block sizes or 18 MB in the worst cases. Ethereum cannot accommodate such huge blocks in its network.

The solution

Protodanksharding solves the gas pricing crisis with a multidimensional EIP-1559 fee market.

Before protodanksharding, EIP-4488 tried to solve the high gas fee problem.

EIP-4488 had two rules:

  1. Reduction of calldata gas prices from 16 gas units per byte to 3 gas units per byte
  2. 1 MB limit per block plus 300 bytes per transaction, taking the theoretical maximum to ~1.4 MB

A hard limit is the easiest way to ensure that average-case load surges do not also lead to worst-case load surges. Moreover, the worst-case block size would always be lower than the current size(1.4 MB compared to 1.8 MB).

So, when EIP-4488 already proposed a solution for the gas problem, why is the Ethereum community choosing EIP-4844 or protodanksharding to reduce gas fees?

Let us elaborate.

Proto-danksharding is making more changes today so that in the future, only a few changes can help the network upgrade to full sharding.

On the other hand, EIP-4488 minimizes current changes and would require more future changes for sharding.

But how is EIP-4844 or proto-danksharding doing this?

Proto-danksharding creates a separate transaction type that holds data in large fixed-size blobs, with an upper limit on how many blobs can be there per block.

The blobs are stored on the consensus layer (Beacon Chain) instead of the execution layer and thus remain inaccessible from EVM. This makes all the difference.

Even though sharding will still be a complex task after proto-danksharding, the complexity will be limited to the consensus layer.

Therefore, execution layer client teams and rollup developers need not do any extra work to transition to full sharding from proto-danksharding.

EIP-4844 also separates blob data from calldata, making it much easier to store blob data for a shorter time period.

Let us now turn our attention to data storage techniques for proto-danksharding.

What are the data storage options for EIP-4844?

Proto-danksharding with its ~1 MB per slot (12 seconds) usage will be generating an enormous 2.5 TB of data per year.

The consensus layer can tackle the data storage challenge with history expiry (EIP-4444) and implement a logic to auto-delete the blob data after some time.

But how can users access older blob data? There are multiple ways to store historical data on decentralized protocols.

For example, application-specific protocols like rollups, BitTorrent, the Ethereum Portal Network, block explorers, API providers, and third-party indexing protocols like The Graph can store the full history.



Technical specifications of EIP-4844

As already mentioned, EIP-4844 introduces blob-carrying transactions.

Each blob is a vector of 4096 field elements, mathematically treated as a degree < 4096 polynomial.

The EVM can view a commitment to the blob, which is a hash of the KZG commitment to the polynomial.

EIP-4844 uses a versioned hash: a single 0x01 byte followed by the last 31 bytes of the SHA256 hash of the KZG.

But why use the hash instead of using KZG to represent the blob directly?

This is for EVM compatibility: KZG commitments are 48 bytes while EVM works with 32 bytes. So any switchover from KZG means the commitments can continue to be 32 bytes.

Proto-danksharding introduces two precompiles:

1. Blob verification precompile: Optimistic rollups will use this precompile during fraud proofs which takes a versioned hash and a blob as input, and verifies that the versioned hash is a valid hash for the blob.

2. Point evaluation precompile: Zero-knowledge rollups will use this precompile. ZK rollups will provide two commitments: the KZG in the blob and the rollup’s internal commitment. It then uses a proof of equivalence protocol to prove that the KZG and ZK rollup’s own commitment refers to the same data.

Implementation plan of EIP-4844

EIP-4844 or proto-danksharding will already implement the following parts of full danksharding:

  • A new transaction type with the same format that will exist in ‘full sharding’
  • All the execution-layer logic required in full sharding
  • All the execution/cross-verification logic
  • Layer separation between ‘BeaconBlock’ verification and data availability sampling blobs
  • Most of the ‘BeaconBlock’ logic for full sharding
  • A self-adjusting gas price for blobs

However, the following work will be pending for ‘full sharding’:

  • A low-degree extension of the ‘blob_kzgs’ in the consensus layer to allow 2D sampling
  • The actual implementation of data availability sampling
  • Proposer-builder separation
  • Proof-of-custody or any similar in-protocol requirement to verify sharded data in each block

As mentioned before, all the remaining work will only be on the consensus layer.

FAQs

When does EIP-4844 go live?

At the time of publishing, the Ethereum developers haven’t specified a date when EIP-4844 will go live. However, they expect the upgrade to happen sometime in the second half of 2023.

Will EIP-4844 lower gas fees on Ethereum?

Yes, the primary goal of EIP-4844, or proto-danksharding is to reduce gas fees on Ethereum by 10-100x by using a new type of blob-carrying transactions. EIP-4844 will make the transition to full sharding easier since all future upgrades will happen on the consensus layer only.

What upgrades are coming before/after EIP-4844?

Ethereum developers have come up with several upgrades before EIP-4844 to reduce gas fees. For example, EIP-3651 lowers the gas that block builders pay for interacting with Coinbase, an Ethereum block-building software. EIP-3855 lowers gas for developers through Push0 while EIP-3860 reduces gas charges for a specific use case.

EIP-4844 is a step toward full sharding that will scale the Ethereum network and bring down gas fees. Developers are planning for the “Verge” after EIP-4844 where Verkle trees will be introduced for scalability.

EIP-4844: The stepping stone for a fully-sharded and scalable Ethereum

EIP-4844 or proto-danksharding is a major upgrade to make the Ethereum network more scalable by implementing maximum changes today, leaving fewer future updates for full sharding.

The Cancun upgrade or proto-danksharding increases space for groups of data, called blobs, that will allow for more data processing, resulting in less network congestion and reduced gas fees.

Although it’s difficult to predict a fixed date, we can expect the upgrade to happen sometime in the second half of 2023.

We hope this blog post helped you understand what EIP-4844 or proto-danksharding is, how it works, and why it’s important in Ethereum’s journey toward scalability and solving the blockchain trilemma.

If you have any questions, join 35,000+ other builders in our Discord community or reach out directly to the team!

And if you want to start building smart contracts, get started with thirdweb’s web3 tools and SDKs for free!