Crypto glossary

Nonce

Definition

A nonce is a number used once: in mining it is the value miners change to find a valid block hash, and on Ethereum it counts an account's transactions.

In proof-of-work mining, the nonce is a field in the block header that miners change again and again. Each new value produces a completely different hash, and the miner keeps trying until the hash falls below the network's difficulty target. Finding that value is the work in proof of work, and any node can check the result with a single hash.

On Ethereum and other account-based chains, the nonce has a different job: it counts how many transactions an address has sent. Each new transaction must carry the next number in sequence, which stops the same signed transaction from being replayed and fixes the order in which an account's transactions are processed.

Account nonces explain some everyday wallet problems. A pending transaction with a low fee blocks every later one from the same address until it confirms; wallets let users replace it by sending a new transaction with the same nonce and a higher fee, or cancel it the same way.

Example

If an address has already sent 41 transactions, its next one must use nonce 41, because the count starts at 0.

Related terms

Latest articles on Nonce