Skip to content

Bitcoin accepted at checkout  |  Ships from Laval, QC, Canada  |  Expert support since 2016

Nonce

Intermediate Mining Basics

Also known as: Number used once

Definition

Nonce (short for “number used once”) is the 32-bit field at the end of a Bitcoin block header that miners increment to search for a hash below the network target. It is the smallest, fastest-changing knob in proof of work: change the nonce, and the entire hash output changes unpredictably.

A Bitcoin block header is 80 bytes laid out as version || prev_hash || merkle_root || ntime || nbits || nonce. The nonce occupies the final 4 bytes. Mining is the brute-force hunt for a nonce value that, when the whole header is run through double SHA-256, produces a result less than or equal to the current target. There is no shortcut — you guess, you hash, you check, you guess again, billions of times per second.

How ASIC hardware actually searches the nonce

On real mining hardware, the nonce search is split across the silicon to maximize throughput. The control board (or in newer designs, the FPGA work distributor) computes the midstate — the result of the first SHA-256 compression round over header bytes 0 through 63, which never change during a single job. That midstate plus the remaining header bytes (64 onward, covering nonce, ntime, and nbits) is streamed down the UART chain to the ASIC chips. Each chip then sweeps its assigned slice of the nonce range internally and only reports back when it lands a candidate.

This is why an ASIC reports so little traffic for so much work. When a chip finds a header that beats the chip-local difficulty, it returns just the winning nonce, a work-id stamp, and (on chips like the BM1397 and BM1362) a midstate index identifying which version-rolled variant hit. The firmware looks up that work-id in its work table, rebuilds the full 80-byte header, verifies the double-SHA-256 result is at or below the share target, and forwards a share to the pool.

Why 32 bits is not enough anymore

The nonce is only 32 bits wide — roughly 4.29 billion (2^32) possible values. That sounds enormous, but a modern ASIC blows through the entire space in a fraction of a second. An S9-class machine at ~13.5 TH/s, for example, exhausts a single 32-bit nonce range almost instantly. If the only variable were the nonce, the chip would simply run out of guesses and idle.

Mining hardware and pools solve this by giving the miner more “fresh” header inputs to keep the nonce relevant:

  • Extranonce — the pool assigns an extranonce1 and an extranonce2 size during the Stratum handshake. The miner varies extranonce2 inside the coinbase transaction, which changes the merkle root and therefore resets the entire 32-bit nonce range to a fresh, unsearched header.
  • Version rolling (BIP 320 / ASICBoost) — by negotiating a version mask (commonly 0x1fffe000) the miner is allowed to flip certain version bits, adding roughly 16 more bits of search space. On Antminer chips this is implemented by feeding the chip several midstate variants per job.
  • ntime rolling — the timestamp can be advanced within the protocol-allowed window, producing yet another set of unique headers without waiting for new work.

Combined, version rolling plus the 32-bit nonce yields on the order of 2^48 hashes per work item — enough to keep even fast chips busy between jobs.

This same arithmetic is a real operational gotcha, not just trivia. Under Stratum V2 standard channels, where the pool controls the coinbase and the miner cannot vary extranonce2, a high-hashrate machine can exhaust its assigned nonce-plus-version space in seconds and effectively drop to zero accepted shares. The fix is to use a Stratum V2 extended channel (or Stratum V1), which hands extranonce control back to the miner so it can keep generating fresh headers.

What the nonce means for your operation

For most operators the nonce is invisible — the firmware and pool handle all of this. But it surfaces in a few practical places. Stratum share submissions (mining.submit) carry the winning nonce, extranonce2, and ntime back to the pool, so a flood of “stale” or rejected shares can point to work-table or work-id handling problems rather than the nonce itself. Small, low-power devices in the open-source Bitaxe family walk the exact same nonce-search loop as a full Antminer hashboard — just with a single chip — which makes them an excellent way to learn how header construction, midstate, and nonce sweeping fit together before scaling up.

Whether you are bench-testing a single-chip miner or commissioning a rack, understanding how the nonce, extranonce, and version bits interact helps you read pool stats correctly and spot misconfiguration fast. If you are choosing hardware to put that search loop to work, browse the current lineup in the D-Central miner catalog or pick up open-source gear from the open-source shop to tinker hands-on.

In Simple Terms

A number miners change to produce different hash results when searching for a valid block.

Nonce (short for "number used once") is the 32-bit field at the end of a Bitcoin block header that miners increment to search for a hash below the network target. It is the smallest, fastest-changing knob in proof of work: change the nonce, and the entire hash output changes unpredictably.

A Bitcoin block header is 80 bytes laid out as version || prev_hash || merkle_root || ntime || nbits || nonce. The nonce occupies the final 4 bytes. Mining is the brute-force hunt for a nonce value that, when the whole header is run through double SHA-256, produces a result less than or equal to the current target. There is no shortcut — you guess, you hash, you check, you guess again, billions of times per second.

How ASIC hardware actually searches the nonce

On real mining hardware, the nonce search is split across the silicon to maximize throughput. The control board (or in newer designs, the FPGA work distributor) computes the midstate — the result of the first SHA-256 compression round over header bytes 0 through 63, which never change during a single job. That midstate plus the remaining header bytes (64 onward, covering nonce, ntime, and nbits) is streamed down the UART chain to the ASIC chips. Each chip then sweeps its assigned slice of the nonce range internally and only reports back when it lands a candidate.

This is why an ASIC reports so little traffic for so much work. When a chip finds a header that beats the chip-local difficulty, it returns just the winning nonce, a work-id stamp, and (on chips like the BM1397 and BM1362) a midstate index identifying which version-rolled variant hit. The firmware looks up that work-id in its work table, rebuilds the full 80-byte header, verifies the double-SHA-256 result is at or below the share target, and forwards a share to the pool.

Why 32 bits is not enough anymore

The nonce is only 32 bits wide — roughly 4.29 billion (2^32) possible values. That sounds enormous, but a modern ASIC blows through the entire space in a fraction of a second. An S9-class machine at ~13.5 TH/s, for example, exhausts a single 32-bit nonce range almost instantly. If the only variable were the nonce, the chip would simply run out of guesses and idle.

Mining hardware and pools solve this by giving the miner more "fresh" header inputs to keep the nonce relevant:

  • Extranonce — the pool assigns an extranonce1 and an extranonce2 size during the Stratum handshake. The miner varies extranonce2 inside the coinbase transaction, which changes the merkle root and therefore resets the entire 32-bit nonce range to a fresh, unsearched header.
  • Version rolling (BIP 320 / ASICBoost) — by negotiating a version mask (commonly 0x1fffe000) the miner is allowed to flip certain version bits, adding roughly 16 more bits of search space. On Antminer chips this is implemented by feeding the chip several midstate variants per job.
  • ntime rolling — the timestamp can be advanced within the protocol-allowed window, producing yet another set of unique headers without waiting for new work.

Combined, version rolling plus the 32-bit nonce yields on the order of 2^48 hashes per work item — enough to keep even fast chips busy between jobs.

This same arithmetic is a real operational gotcha, not just trivia. Under Stratum V2 standard channels, where the pool controls the coinbase and the miner cannot vary extranonce2, a high-hashrate machine can exhaust its assigned nonce-plus-version space in seconds and effectively drop to zero accepted shares. The fix is to use a Stratum V2 extended channel (or Stratum V1), which hands extranonce control back to the miner so it can keep generating fresh headers.

What the nonce means for your operation

For most operators the nonce is invisible — the firmware and pool handle all of this. But it surfaces in a few practical places. Stratum share submissions (mining.submit) carry the winning nonce, extranonce2, and ntime back to the pool, so a flood of "stale" or rejected shares can point to work-table or work-id handling problems rather than the nonce itself. Small, low-power devices in the open-source Bitaxe family walk the exact same nonce-search loop as a full Antminer hashboard — just with a single chip — which makes them an excellent way to learn how header construction, midstate, and nonce sweeping fit together before scaling up.

Whether you are bench-testing a single-chip miner or commissioning a rack, understanding how the nonce, extranonce, and version bits interact helps you read pool stats correctly and spot misconfiguration fast. If you are choosing hardware to put that search loop to work, browse the current lineup in the D-Central miner catalog or pick up open-source gear from the open-source shop to tinker hands-on.

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Mining Glossary

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Compare Miners