Skip to content
IntermediateLook up a term

What is a nonce?

Author
CRYPTO PORT Editorial
Published
Updated
Reading time
4 min

In short

A nonce is a number used once, and blockchains use the word in two different places. In mining it is the value miners vary while hunting for a valid hash; on an account it is a counter that numbers your transactions. Both exist to stop the same action from taking effect twice.

Key points

  • A mining nonce is the field miners iterate in the header
  • An account nonce is a sequential counter of your transactions
  • Only one transaction per nonce can ever be confirmed
  • A gap in the sequence stalls every later transaction

Definition

A number intended to be used only once. In proof of work it is brute-forced as an input to the block hash; on account-based chains it is a counter that fixes transaction order and prevents duplicates.

A Bitcoin block header contains a 32-bit nonce field. Miners change it, recompute the hash, and repeat until the result falls below the target set by the difficulty. Thirty-two bits is far too small a search space, so miners also vary part of the coinbase transaction and the timestamp.

On account-based chains such as Ethereum, every address carries a nonce counting how many transactions it has sent. Numbers are used in order, and only one transaction per nonce can ever confirm. That is exactly why a 'replace by fee' resend works: it reuses the same nonce with a higher fee.

Because the counter must be consumed in order, a stuck transaction at nonce 5 blocks nonce 6 and everything after it, no matter how generous their fees. This is the usual cause of a wallet that appears frozen, and the standard fix is to resend at the same nonce with a higher fee.

Watch out for

  • · A fee bump must reuse the original nonce, or you risk sending the payment twice
  • · If your wallet lets you edit the nonce, skipping a number stalls everything after it
  • · A transaction that disappears from view can still confirm until another transaction with that nonce does

Related coins

Read next

Crypto quizzes

Answer a few questions and get your result instantly.

Start