Glossary: Nonce

One-Sentence Definition

A nonce (number used once) is a random 32-bit number in the block header that miners increment and change repeatedly while running hash calculations to find a valid block hash that meets the network’s difficulty requirement.

Why It Matters for Solo Mining

Nonce mining is literally what your hardware does all day when solo mining—it tries billions of different nonce values per second, looking for that one winning combination. Every time your miner calculates a hash that doesn’t meet the target, it changes the nonce and tries again. Understanding the nonce helps you appreciate just how much computational work goes into finding a single block, and why solo mining is basically a giant lottery where you’re testing trillions of tickets.

How It Works

When your mining software tries to find a valid block, it takes the block header (which includes the previous block hash, merkle root, timestamp, and difficulty target) and runs it through a hash function like SHA-256. The nonce is the variable part that miners can freely change without altering the actual transactions in the block.

Your miner starts with nonce = 0, hashes the block header, checks if the result is below the target, and if not, increments to nonce = 1, then 2, then 3, continuing this process billions of times per second. Since the nonce is only 32 bits, it has about 4.3 billion possible values (0 to 4,294,967,295). Modern miners exhaust all possible nonces in fractions of a second, so they also change other parts of the block header like the timestamp or the coinbase transaction to create new search spaces.

When a miner finally finds a nonce that produces a hash below the target difficulty, they’ve solved the block and can broadcast it to the network to claim the block reward. The winning nonce gets permanently recorded in that block on the blockchain.

Example

Imagine you’re trying to roll dice until you get a number below 5. Each roll is like trying a new nonce—you keep rolling (hashing) until you get lucky. If someone asks you to roll below 2 instead, it’ll take way more attempts. That’s exactly how difficulty adjustment works—the network makes the “target number” smaller or larger depending on how fast blocks are being found.

In Bitcoin block #700,000, the winning nonce was 2,780,835,857. That miner tried billions of other nonces before finding that specific number that produced a valid hash.