What is nonce?
A number used only once, which on an account-based chain counts your transactions in order and in mining is the value changed while searching for a valid block.
Not yet verifiedHow we verify
3 min read
In this entry
A number used only once, which on an account-based chain counts your transactions in order and in mining is the value changed while searching for a valid block.
The word covers two unrelated jobs that happen to share a name, and knowing which one is meant depends entirely on the context. On Ethereum and similar chains it is a per-account counter. In proof-of-work mining it is a search variable inside the block header.
A pending transaction with a low nonce blocks every later one from the same address until it confirms or is replaced. Wallets normally set it for you, and the only time most people meet the concept is when a wallet reports that transactions are stuck behind one that never confirmed.
How it works
The account nonce. Each Ethereum account carries a counter starting at zero. Every transaction you send must use the next number in sequence, and the network rejects anything out of order. This is what prevents a signed transaction from being replayed: once nonce 12 has been used, a copy of that same signed transaction is invalid forever.
The consequence is strict ordering. If you broadcast nonce 12 with too low a fee and then broadcast nonce 13, the second cannot confirm until the first does. Everything queues. The fix is to replace nonce 12 with a version paying a higher fee, usually offered in wallets as "speed up", or to replace it with a zero-value transaction to yourself, which wallets call "cancel". Both work by reusing the same nonce.
The mining nonce. In a proof-of-work block header, the nonce is a field the miner changes to produce a different hash on each attempt. It has no meaning beyond being something to vary. When the 32-bit field is exhausted, miners change other parts of the header and continue.
The two share only the underlying idea of a value not repeated. Nothing else transfers between them.
Example
Illustrative stuck queue. Your wallet sends three transactions in a minute: nonce 40, 41, and 42. Nonce 40 was broadcast when fees were low and does not get included.
Nonces 41 and 42 are valid, propagated, and unconfirmable, because the network will not process 41 before 40. All three sit pending. Using "speed up" on nonce 40 rebroadcasts it with a higher fee. The moment it confirms, 41 and 42 confirm behind it in the same or the next block. Nothing was lost, and nothing needed resending.
Why it matters when you buy
This is the explanation behind a specific and alarming situation: several transfers all stuck at once with no obvious reason. Recognizing that it is one blocked nonce, not several failures, tells you to fix the oldest transaction rather than resend everything. When you are moving funds to an exchange to buy, that difference is minutes rather than hours. Our fee walkthrough is at Gas fees explained, and current per-network conditions are measured on the chain rankings.
Related terms
- mempool — where a low-nonce transaction waits
- replace by fee — reusing a nonce at a higher fee
- hash — what the mining nonce is searching for
- gas — the fee that decides whether it confirms
- proof of work — where the mining nonce lives
- transaction id — changes when you replace one
Questions
Why are all my transactions stuck?
Almost always because the oldest one has not confirmed and every later one is queued behind its nonce. Speed up or cancel the oldest, and the rest follow.
Does Bitcoin have account nonces?
No. Bitcoin uses unspent outputs rather than accounts, so ordering is enforced by which outputs a transaction spends. The nonce in Bitcoin appears only in the mining header.
Can I reuse a nonce?
Only to replace a pending transaction that has not confirmed. Once a nonce is confirmed, any other transaction using it is permanently invalid.