EIP-2242 Transaction postdata

No call decision · Scaling & data · EIP status Stagnant · created 2019-08-16

A proposal to add a 'postdata' field to transactions, which the EVM does not read, allowing sidechain data to be recorded on-chain more cheaply.

Why it is needed

Today, putting data into a transaction requires using calldata, which is expensive because the EVM directly reads and processes it. EIP-2028 lowered the gas cost of calldata, but there are cases, such as sidechains, where the EVM never needs to look at the content at all. In a fraud-proof-based sidechain, the block proposer only needs to prove that 'this data exists,' and verification by fraud proof only happens after the fact if the data turns out to be wrong. In other words, the data ends up paying the same cost as calldata even though the EVM has no reason to read it right away. Following the principle of 'not paying for what isn't used,' a separate, cheaper path is needed for recording on-chain data that the EVM does not process.

What changes

Today

After EIP-2242

Who is affected

In depth

Addition of the postdata field

From FORK_BLKNUM onward, an optional field called postdata is added to transactions. It is appended after the existing from, to, startGas, gasPrice, value, data, and nonce fields, and the signature (witness) is made over the RLP encoding that includes this entire set of fields.

The structure of postdata: version and data

postdata itself is an RLP tuple of the form (version: uint64, data: bytes). The current version is 0, and data is an RLP-encoded list of binary data. This EIP does not interpret the content of data at all, treating it purely as a binary blob, and leaves room for future EIPs to introduce different interpretation schemes based on the version value.

Gas cost: 1 gas per byte

Data posted via postdata costs 1 gas per byte, and this cost is deducted from startGas. If the remaining gas drops to 0 or below, the transaction immediately reverts with an out-of-gas exception. Even compared to the calldata gas cost lowered by EIP-2028, this is designed to be cheaper since the data is never read by the EVM at all.

Motivation: 'don't pay for what isn't used'

EIP-2028 lowered the gas cost of calldata, but calldata is still data the EVM can read. In cases such as Eth 2.0's Execution Environment or discussions of stateless clients, where the blockchain is used purely as a 'data availability and dispute arbitration layer,' the EVM has no need to read that data at all. This EIP creates a separate path, for such uses, for data that the EVM does not process.

Applies to: fraud-proof sidechains. Excludes: validity-proof sidechains

Trust-minimized sidechains based on fraud proofs only need the block proposer to prove that 'the data exists'; if the data is wrong, this is only certified after the fact via a fraud proof. Validity-proof-based sidechains, by contrast, must certify posted data immediately, so they cannot use this EIP's structure, and the original text leaves this as the topic of a future separate EIP.

Backward Compatibility and Hard Forks

Since postdata is an optional field appended to the end of an existing transaction, it is backward compatible with the existing transaction format. However, this change is not forward compatible, and a hard fork is required for the entire network to recognize the new format.

Current status: Stagnant

This EIP's status is Stagnant, with both the Test Cases and Implementation sections left as TODO, meaning no concrete implementation or tests have been written. There is no call record addressing fork inclusion either, so whether it will actually be adopted and applied cannot be determined from the original text alone.

Original EIP · ← EIPs