Nonce

A nonce is the number miners change in a block header to search for a valid proof-of-work hash.

3 min read
mining

Definition

In cryptocurrency mining, a nonce is a number that miners change while trying to find a valid block hash. The word comes from “number used once,” but in mining it is better understood as a trial value that helps miners create many different hash attempts from the same candidate block.

How It Works

Proof-of-work mining is a guessing process. A miner builds a candidate block, puts its summary data into a block header, and then hashes that header over and over. For Bitcoin, that hash must be below the current difficulty target.

The nonce is one field inside the block header. When a miner changes the nonce, even by 1, the resulting hash changes completely. This is useful because cryptographic hash functions are unpredictable: miners cannot calculate the correct nonce in advance. They have to try values, check the hash, and keep going until one works.

In Bitcoin, the nonce field is only 32 bits, so it can run through about 4.3 billion possible values. Modern ASIC miners can test that range extremely quickly. When the basic nonce space is exhausted, miners can also change other parts of the candidate block, such as the coinbase transaction, which changes the Merkle root and gives them a fresh set of hashes to try.

A valid nonce does not make the block “correct” by itself. It only helps produce a block header hash that satisfies the network’s proof-of-work rule. Other nodes still verify the block’s transactions, reward amount, timestamp, and consensus rules before accepting it.

Why It Matters

The nonce is central to mining because it gives miners a simple way to generate new hash attempts. Without a changeable field like the nonce, every miner would repeatedly hash the same block header and get the same result.

It also shows why mining is based on probability, not clever shortcuts. More hash rate means more nonce and header variations tested per second, which means more chances to find a valid block. But any single attempt is still just a guess.

For the network, this trial-and-error process makes blocks expensive to create and easy to verify. A miner may need trillions of attempts to find a valid nonce, while everyone else can check the winning block hash almost instantly.