Loading prices...

Nonce

TechnologyUpdated 12.08.20262 min

A number used once, which miners search for when mining a block in Proof-of-Work networks; also a counter that prevents a transaction from being replayed on an account.

How it works

A nonce is a number picked so that the result of a computation satisfies a given condition. The word comes from “number used once”.

In mining it is the only part of a block a miner may freely change. They insert a number, compute the block's hash and check whether the result came out below a target value. If not, they add one and compute again.

This brute-force search is the work in proof of work. A valid number can only be found by blind search, while verifying someone else's find takes a single operation. The network's entire security rests on that asymmetry.

The scale of the search

Bitcoin's nonce field is 32 bits wide. Here is how far that goes on modern hardware.

Total values in the fieldabout 4.3 billion
Speed of one machineup to 200 trillion hashes per second
Time to exhaust the fielda fraction of a second
Target block interval10 minutes

The field has long been too small: a machine exhausts all four billion values in under a second. So miners also vary other parts of the block — the timestamp and a service transaction — to obtain a fresh set of values to search.

Where else the word appears

  • The transaction counter in EthereumHere nonce means something else entirely: the sequence number of an operation from a given address. It prevents the same transfer being sent twice.
  • A stuck transactionIf an operation with a lower number is unconfirmed, every later one waits for it. Hence the trick of replacing a transaction with the same number and a higher fee.
  • One-time values in cryptographyIn encryption such a value guarantees that two identical messages produce different output.