Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines EIP-2028, a proposal to reduce the gas cost of Calldata by estimating how larger blocks affect network delay and the efficiency ratio.

This article translates, summarizes, and expands on the following proposal.

I have also written about various other EIPs.

Overview

The proposal calls for a substantial reduction in the cost of transmitting certain data on the blockchain: the gas cost of nonzero Calldata bytes (GTXDATANONZERO), from 68 to 16 gas per byte. Gas is the unit used to account for the cost of operations in blockchain transactions. Rather than simply proposing a new price, the authors plan to evaluate its effects on network delay (which affects transaction processing speed) and security, both theoretically and empirically, using mathematical frameworks from the work of Sompolinsky and Zohar and of Pass, Seeman, and Shelat. They first use a theoretical model to predict how reducing the gas cost affects network delay, then test the model against empirical data and experiments. The ultimate goal is to use the findings to determine an appropriate gas cost for Calldata.

Motivation

The proposal aims to improve blockchain scalability by lowering the gas cost of Calldata. It offers three main benefits. First, it improves on-chain scalability. Increasing Calldata bandwidth allows more data to fit in a single block, increasing transaction throughput.

Second, it improves layer 2 scalability. Layer 2 solutions improve scalability by moving computation and data storage off-chain, but doing so involves transmitting data. Reducing the gas cost of Calldata makes these solutions more efficient. For instance, it makes it easier to use proof systems such as STARKs and SNARKs to provide proofs of computations that process large numbers of transactions.

Finally, there are benefits for stateless clients. The model is also intended to help determine the future cost of state access for stateless clients. State access gas costs are expected to increase in proportion to the additional bandwidth and processing power needed to transmit and verify block proofs. This supports efficient blockchain operation and enables more advanced scaling solutions in the future.

Stateless clients

A stateless client is a concept that allows nodes in a blockchain network to operate without storing the complete transaction history or account state. In the traditional model described here, each node must retain all transactions and the resulting account state. Such a client is called a stateful client.

As a blockchain grows, however, retaining all of its data increases storage costs and raises the barrier to participating in the network. Stateless clients were proposed to address this problem. Instead of storing the entire blockchain state, a stateless client retains only proofs. These proofs establish that a transaction is valid or that a particular state is correct.

With stateless clients, network participants can verify transactions and blocks while retaining only the minimum necessary data. This reduces node operating costs and enables more users and devices to participate in the blockchain network. In particular, even resource-constrained or mobile devices could function as full nodes. Stateless clients are considered an important technology for improving blockchain scalability and accessibility.

Further explanation

Lowering the gas cost of Calldata could theoretically increase block sizes, leading to greater delays in transmitting data across the network. However, this is only one component of overall network delay. Block processing time, including storage access, also contributes to the delay. Greater network delay can reduce security: fewer nodes are up to date with the latest blockchain state, potentially lowering the cost of attacking the network.

Yonatan Sompolinsky and Aviv Zohar proposed a sophisticated model relating network delay to network security. The model was also used in research by Rafael Pass, Lior Seeman, and Abhi Shelat. To establish a lower gas cost for Calldata, the proposal plans to study this model theoretically and validate it with empirical measurements.

The model uses the following parameters.

  • λ (lambda) is the block creation rate [1/second]. Finding a Proof of Work (PoW) solution is modeled as a Poisson process with rate λ.
  • β (beta) is the chain growth rate [1/second]: the rate at which new blocks are added to the heaviest chain.
  • D is the block delay [seconds]: the time between the mining of a new block and its acceptance by all miners (when all miners switch to mining on top of that block).

λ (lambda)

λ (lambda) indicates how frequently new blocks are created on a blockchain. This quantity is called the block creation rate, measured in blocks per second. A higher lambda means that blocks are created more frequently.

Blocks are generated by solving a computational problem known as Proof of Work (PoW). Miners (participants who generate blocks) create new blocks by finding solutions to that computational problem. The process is probabilistic, and the exact time at which a new block will be found cannot be predicted.

One mathematical way to describe such a stochastic process is the Poisson process. It models the number of events that occur randomly over a given period. Here, the event is the discovery of a new block. Lambda is the rate of this Poisson process: the average number of blocks created per second.

λ (lambda) measures how quickly blocks are created, and the generation of blocks through PoW is modeled as a sequence of random events. This mathematically captures the unpredictability of when new blocks are found.

Lower bound on beta

Not every discovered block becomes part of the main chain (uncle blocks are an example), so λ (lambda) is at least as large as β (beta). As shown in reference [1], for a blockchain following the longest-chain rule, the lower bound on β can be expressed as λ / (1 + D * λ). This bound is attained in the extreme case where the network topology is a clique with delay D between every pair of nodes (the maximum possible delay). The lower and upper bounds on β are therefore as follows.

λ≥β≥λ1+D×λ\lambda \geq \beta \geq \frac{\lambda}{1 + D \times \lambda}

As a sanity check, when there is no delay (D=0), β equals λ, as expected.

Consider two important blockchain parameters, λ (lambda) and β (beta). λ is the block creation rate, whereas β is the rate at which blocks are actually added to the main chain.

In a blockchain, miners may produce blocks simultaneously, but not all of those blocks become part of the final blockchain. In this situation, blocks that do not become part of the main chain are referred to as uncle blocks. Consequently, the rate at which blocks are added to the main chain, β, is less than or equal to the block creation rate, λ.

It is also important to understand how network delay (D) affects β. The greater the delay, the longer information takes to propagate between nodes, reducing the rate at which blocks are added to the main chain (β). This relationship can be expressed mathematically by the lower bound λ / (1 + D * λ). The bound shows how both delay and the block creation rate affect β.

When there is no delay (D=0), β equals λ. In other words, blocks are created and added to the blockchain immediately. When there is delay, however, β is smaller than λ, and the difference grows depending on the values of D and λ.

This explains the relationship between the block creation rate (λ) and the rate at which blocks are added to the main chain (β), and expresses the effect of network delay mathematically.

Network security

An attacker attempting to reorganize the main chain must generate blocks at a rate higher than β (beta). For a fixed Proof of Work (PoW) puzzle difficulty, the total hash rate in the system is related to λ (lambda). The ratio β / λ is therefore defined as the efficiency of the system: the proportion of total hash power used to produce the network's main chain.

λ≥β≥λ1+D×λ\lambda \geq \beta \geq \frac{\lambda}{1 + D \times \lambda}

Rearranging this inequality gives the following lower bound on efficiency as a function of delay.

βλ≥11+D×λ   [∗∗]\frac{\beta}{\lambda} \geq \frac{1}{1 + D \times \lambda} \space\space\space[**]

This shows how delay D and the block creation rate λ affect system efficiency. As delay increases, the proportion of hash power contributing to the main chain, and hence system efficiency, decreases. The inequality illustrates why maintaining network security requires ensuring that enough hash power contributes to the main chain while accounting for the effects of delay.

λ≥β≥λ1+D×λ\lambda \geq \beta \geq \frac{\lambda}{1 + D \times \lambda}

The inequality above is rearranged to derive a lower bound on system efficiency in terms of delay. Specifically, the ratio of β (the rate at which blocks are added to the main chain) to λ (the block creation rate), \(\frac{\beta}{\lambda}\), represents the efficiency of the system.

This ratio (βλ)(\frac{\beta}{\lambda}) represents the proportion of generated blocks that are actually added to the main chain, a measure of system efficiency. Rearranging means deriving an inequality for that ratio (βλ)(\frac{\beta}{\lambda}) from the preceding inequality.

Specifically, dividing both sides of the lower bound (β≥λ1+D×λ)(\beta \geq \frac{\lambda}{1 + D \times \lambda}) by λ yields the lower bound on efficiency (βλ≥11+D×λ)(\frac{\beta}{\lambda} \geq \frac{1}{1 + D \times \lambda}). This mathematically describes how delay (D) affects system efficiency, with efficiency decreasing as delay increases.

The delay parameter D

Network delay D depends on the locations of mining nodes in the network and on its current, dynamically changing topology, making direct measurement somewhat difficult. Christian Decker and Roger Wattenhofer previously showed that propagation time scales linearly with block size. Vitalik Buterin also showed that the uncle rate, a measure closely related to efficiency (**), scales linearly with block size.

However, the delay function can be decomposed into two components as D = D_t + D_p. Here, D_t is the delay caused by transmitting a block, while D_p is the delay caused by processing the block at a node. The authors' model and tests examine the effects of Calldata on D_t and D_p separately, assuming that the effects differ. This distinction may be particularly relevant to layer 2 scalability and stateless clients. Much of the Calldata associated with these objectives consists of Merkle authentication paths, which have a large D_t component but a relatively small D_p.

Tests

The proposal uses two types of tests to determine the gas cost of Calldata.

  • Network tests

    • Conducted on Ethereum mainnet to estimate how increasing block size affects D_p (block processing delay), D_t (block transmission delay), overall network delay D, the efficiency ratio (**), and delays between different mining pools.
    • These include regression tests on existing data and stress tests introducing extreme scenarios.
  • Local tests

    • Conducted on a single node to measure processing time as a function of the amount of Calldata and general computation limits.

The goal of these tests is to identify an appropriate gas cost for calldata and optimize the efficiency and security of the Ethereum network.

References

Citation

Alexey Akhunov (@AlexeyAkhunov), Eli Ben Sasson eli@starkware.co, Tom Brand tom@starkware.co, Louis Guthmann louis@starkware.co, Avihu Levy avihu@starkware.co, "EIP-2028: Transaction data gas cost reduction," Ethereum Improvement Proposals, no. 2028, May 2019. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2028.

Conclusion

This article covered EIP-2028, which proposes reducing the gas cost of Calldata by estimating how larger blocks affect network delay and the efficiency ratio. I hope this explanation was useful.

If you have any questions, feel free to contact me by direct message on Twitter.

Twitter @cardene777

You can also find my writing on other platforms.

https://chaldene.net/