The nonce is a 4-byte number in the block header that miners change on every attempt. Learn why it runs out so fast and what miners change next.
A number to change
The The block header has a 4-byte field called the nonce ("number used once"). Miners set it to 0, hash the header, check the result, then try 1, 2, 3… Each change gives a completely different hash.
When the nonce runs out
4 bytes allow about 4.3 billion values. Modern machines try that many in well under a second. When they run out, miners change something else:
- the extra nonce: spare bytes in the The coinbase transaction, which changes the Merkle trees and the merkle root;
- the timestamp, within the allowed range;
- some version bits.
Then the nonce search starts again.
The genesis block's nonce
Block 0 has nonce 2,083,236,893. Its target was the easiest Bitcoin has ever had, yet it still took about two billion tries.
How fast do miners use up the nonce?
| Machine speed | Time to try all 4.3 billion nonces |
|---|---|
| 1 GH/s (an early GPU) | about 4 seconds |
| 100 TH/s (one modern ASIC) | about 0.00004 seconds |
| 800 EH/s (the whole network) | far less than a nanosecond |
That's why the extra nonce in the coinbase transaction is essential.
Is the winning nonce special?
No. It's just the number that happened to produce a low enough hash with that exact header. Change any other field and a different nonce would be needed.
Key takeaways
- The nonce is a 4-byte header field miners change on each attempt.
- Its 4.3 billion values run out quickly on modern hardware.
- Miners then change the extra nonce, time or version bits.
Common questions
Is there a correct nonce?
Many nonces might work, and often none does for a given header. Miners just need any combination that produces a hash below the target.
Why is it called a nonce?
It's short for 'number used once', a common cryptography term.
What does nonce stand for?
Number used once.
Where can I see a block's nonce?
It's in the block header; MyBitcoinExplorer's API returns it in a block's full details.