Keys, wallets & account abstraction

nonce management

Nonce management is the practical work of keeping each account's transaction nonces in the right order. In an account-based chain like Ethereum, every account has a counter — its nonce — that must increase by exactly one with each transaction it sends. This counter is what gives an account a strict, gap-free transaction order and is the chain's defense against replay: a signed transaction is only valid for its specific nonce, so it cannot be re-submitted or executed twice.

The strictness creates the headaches wallets must handle. The network executes an account's transactions strictly in nonce order, so if transaction nonce 5 is pending and you broadcast nonce 6, nonce 6 will wait in the mempool until 5 confirms. If nonce 5 is underpriced and stuck, everything behind it is 'stuck' too — a gap blocks the queue. To fix this you replace the stuck transaction by re-broadcasting the same nonce with a higher fee (a 'speed-up' or 'cancel'); to unstick a gap you must get the missing nonce mined. Wallets and especially high-throughput services (exchanges, bots) must therefore track the latest used nonce locally, because relying only on the node's count can desync when many transactions are in flight.

Account abstraction generalizes the nonce. ERC-4337 introduces two-dimensional nonces: a 192-bit key plus a 64-bit sequence, managed by a NonceManager in the EntryPoint. This lets a smart-contract account run many independent ordered streams in parallel — different applications or session keys each using their own nonce key — so unrelated operations no longer block one another the way a single linear counter forces them to. Note the contrast with UTXO chains like Bitcoin, which have no per-account nonce at all; there, replay protection comes from each output being spendable only once.

A bot fires off transactions with nonces 10, 11, 12 in quick succession, but the gas price for nonce 10 was set too low and it sits unmined. Nonces 11 and 12 are valid but cannot execute, because the chain will not skip nonce 10. The bot resends nonce 10 with a higher max fee; once it confirms, 11 and 12 immediately follow.

Do not confuse this 'account nonce' with the proof-of-work 'block nonce'. The account nonce orders and de-duplicates an account's transactions; the mining nonce is the number a miner varies to find a valid block hash. They share a name but solve completely different problems.

Also called
transaction sequencing交易序號管理