Crypto glossary

Nonce

A nonce is a variable value in a block header that miners change again and again to produce different hashes, searching for one that meets the network's difficulty target. The name comes from number used once.

Auf Deutsch lesen

Why mining needs a nonce

In proof-of-work mining, a block is valid only if the hash of its header is below a target value. Everything else in the header, such as the previous block's hash and the summary of transactions, is fixed for a given candidate block. Without something to vary, a miner would get the same hash every time.

The nonce solves this. In Bitcoin it is a 32-bit field in the block header. The miner sets it to one value, hashes the header, checks the result, then changes the nonce and tries again. Because hash outputs are unpredictable, each new nonce is like a new lottery ticket.

When the nonce runs out

A 32-bit field allows about 4.3 billion values. Modern mining machines can try all of them in well under a second, which is far too few for today's difficulty. Miners therefore also change other data, most commonly an extra nonce placed in the coinbase transaction (the transaction that pays the block reward) and sometimes the timestamp, which changes the header and opens a fresh range of nonce values.

A different nonce on Ethereum

On Ethereum, the word also refers to something unrelated to mining: an account nonce, a counter of how many transactions an address has sent. Each new transaction must use the next number in sequence. This prevents the same signed transaction from being replayed and determines the order in which your transactions are processed.

If a transaction with a low nonce is stuck, all later ones from that address wait behind it. Sending a new transaction with the same nonce and a higher fee replaces the stuck one.

Why it matters

The block nonce is a visible part of how proof of work turns computing power into security. Finding a winning nonce is hard; anyone can verify it with a single hash.

Ask Coach about it

Coach is the AI on AtenaCrypto. It explains crypto with live market data, in plain words.

How do I replace a stuck Ethereum transaction using the same nonce?Ask Coach →

Frequently asked questions

Does a miner choose the nonce randomly?

Miners usually step through values systematically, but since the resulting hash cannot be predicted, every attempt has the same small chance of success.

Can the same nonce appear in different blocks?

Yes. The nonce only needs to produce a valid hash for that particular block header, so values can repeat across blocks.

Why is my Ethereum transaction showing a nonce error?

Usually because an earlier transaction from your address is still pending or the wallet used a number out of sequence. Resolving or replacing the pending transaction typically fixes it.

Related terms

HashProof of Work (PoW)MiningDifficultyHashrate

Learn it step by step

AC Learning explains these ideas in interactive lessons — the first eight sections are free.

Open AC Learning → Create a free account

All glossary terms · Educational reference only — not investment, legal, tax or financial advice.