EIP-6188 Nonce upper bound (Nonce Cap)

No call decision · EVM & execution · EIP status Stagnant · created 2022-12-20

Caps an account's nonce at 2^64-2, reserving the maximum value 2^64-1 exclusively for special-purpose contracts.

Why it is needed

A nonce is a sequential number that increments by one each time an account sends a transaction or creates a contract. Currently this value can theoretically rise to its maximum, 2^64-1, and every nonce value is treated identically, with none carrying special meaning. This EIP adds no functionality by itself, but by reserving the single largest nonce value in advance, it allows a future EIP to use that value as a marker meaning "this contract behaves differently from an ordinary contract." Since it is effectively impossible for a real account to raise its nonce that high, reserving the value causes no problems for existing users.

What changes

Today

After EIP-6188

Who is affected

In depth

EOA transaction restriction

The nonce of a transaction sent from an EOA must be less than 2^64-2. A transaction with nonce 2^64-1 or 2^64-2 must be treated as invalid. This means the maximum nonce an account can actually use is 2^64-3, and the two values above it are permanently sealed off.

Handling in CREATE and CREATE2

If a CREATE or CREATE2 call that creates a contract would raise some account's nonce to 2^64-1, the nonce is instead stored fixed at 2^64-2. The value 2^64-1 itself is never used as any account's actual nonce and is reserved to denote an "alias or other special-purpose contract."

Design intent

Capping the nonce makes it possible to design other EIPs that can tell, just by looking at an account's code, whether it is a contract with special properties. Only a single nonce value (2^64-1) needs to be reserved for this, and that is the rationale behind this EIP.

Backward compatibility

Because this EIP changes consensus rules, it requires a protocol upgrade (hard fork). However, it states that adding this extra restriction on nonces has no effect on existing accounts, since it is realistically extremely difficult for a nonce to reach 2^64-2.

Security considerations

Since it is not feasible for a contract account to reach the nonce cap, it states that any potential issues this could create for other opcodes that depend on an account's nonce value can safely be ignored.

Status and relationship

This EIP is currently Stagnant, and the original text itself states that "this EIP alone is useless and only adds computation; it gains meaning only when another EIP makes use of it." EIP-2929 is listed under requires, but the body gives no specific explanation of the connection.

Original EIP · ← EIPs