EIP-3338 Account nonce 2^52 limit (Limit account nonce to 2^52)

No call decision · EVM & execution · EIP status Withdrawn · created 2021-03-07

A proposal to limit the account nonce (the count of transactions sent) to between 0 and 2^52. It was withdrawn in favor of EIP-2681, which addresses the same goal.

Why it is needed

Currently the account nonce is defined as an integer with no length limit. This makes it inefficient to treat the nonce as variable-length data in state witnesses, and it also burdens other proposals that aim to design new transaction formats. In addition, from the perspective of client software, it would be advantageous if the nonce could be handled with a smaller data type rather than having to be stored as a 256-bit number. However, since reaching a nonce of 2^52 would require an enormous amount of gas, no account would actually run into a problem even with a cap in place.

What changes

Today

After EIP-3338

Who is affected

In depth

Specification: two constraints

After FORK_BLOCK, two rules apply. First, a transaction with a nonce exceeding 2^52 is treated as invalid. Second, executing the CREATE opcode when an account's nonce is already 2^52 causes an exceptional halt. In other words, this structure blocks both the nonce cap itself and the act of creating a new account at that cap.

A realistically unreachable limit

The original text calculates the gas cost required to raise a nonce to the limit using only external transactions, and states that this cost reaches 21000 * (2^64-1) gas. This is presented as a level no account could realistically reach, which is the basis for claiming that imposing the limit has no effect on existing accounts.

The history of the Morden testnet and replay protection

The original text explains that the Morden testnet in the past set the starting nonce of new accounts to 2^20 in order to distinguish them from mainnet transactions. It notes that this kind of nonce-based replay protection fell out of use once EIP-155 introduced a cleaner method using chain id.

Client implementation and floating-point compatibility

The original text notes that most clients, including go-ethereum, already treat the nonce field as 64-bit. It also cites the fact that integers up to 2^52 can be represented without loss as 64-bit floating-point numbers, making the nonce easier to handle even in languages that are not integer-only.

Backwards compatibility: no accounts affected

The original text states that this change is a breaking change but has no actually observable impact. As of November 2020, the account with the highest nonce was 0xea674fdde714fd979de3edf0f56aa9716b898ec8, with a value of about 29 million, far from 2^52.

Proposal status: Withdrawn

This EIP has Withdrawn status, having been superseded by EIP-2681, which addresses the same goal of limiting the nonce to 2^52. The content in this document was therefore never reflected in the actual protocol, and the successor proposal EIP-2681 should be consulted instead.

Original EIP · ← EIPs