← Glossary

Mining

What Is a Nonce in Mining? The Number Miners Keep Changing

In proof-of-work mining, the nonce is a number field in the block header that miners change on every attempt so the header hashes to a new value, until one hash falls below the network's target.

Key takeaways

What the nonce does

A hash function turns any input into a fixed-size output that looks random, and changing even one bit of the input changes the output completely. Mining exploits this. The block header contains a field called the nonce, and by changing it a miner gets a fresh, unpredictable hash from the same block contents. The miner checks each result against the network's target and keeps going until one is low enough.

How big the space is

In Bitcoin's header the nonce is a single 4-byte field. The developer documentation notes that a single 4-byte nonce is good for about 4 gigahashes, a number modern mining hardware exhausts in a fraction of a second. That is why miners do not rely on the nonce alone.

The extra nonce

When the nonce space is used up, the miner needs a different header to keep hashing. It changes something else, such as the extra nonce field in the coinbase transaction. Because the coinbase is part of the merkle tree, changing it changes the merkle root, which changes the header. The documentation describes mining software rebuilding the needed parts of the merkle tree and updating the time and merkle root fields whenever the extra nonce changes. Each new header opens another 4 billion nonce values to try.

Why it matters

The nonce shows why mining is a lottery: every attempt has the same small chance of success, and nothing about earlier attempts helps. Your share of rewards depends on how many attempts you make per second, which is your hashrate, not on any clever search. In Scrypt coins the same idea applies, with a different hash function doing the work.

Example

A miner hashes a header with nonce 0, then 1, then 2. Each hash looks unrelated to the last. After 4,294,967,296 attempts the nonce wraps, so the miner bumps the coinbase extra nonce, which changes the merkle root and header, and starts again at nonce 0.

Put it into practice

Turn attempts per second into expected coins

Your hashrate is how many nonce attempts your hardware makes each second. The mining calculator converts it into expected Litecoin and Dogecoin rewards.

Open the mining calculator Get Scrypt for Android

Frequently asked questions

Is the nonce a secret?

No. The winning nonce is published in the block header so anyone can verify the work with one hash.

Why is it called a nonce?

Short for 'number used once', a term from cryptography for a value that is varied to produce a different result.

Does a bigger nonce field make mining easier?

No. Difficulty is set by the target, not by the size of the nonce field, which only decides how many attempts fit before other data must change.

Related terms

Go deeper

Written by the Scrypt Wallet team · Updated 2026-10-02. General education, not financial, tax or legal advice.