Bitcoin block headers contain a nonce field that is only 32 bits long, meaning it has just under 4.3 billion possible values. Modern ASIC miners can compute far more hashes per second than that, so running out of nonces is not a theoretical edge case. It happens constantly during the mining process. When a miner cycles through all possible nonce values without finding a valid hash, it changes other fields in the block header. The main method is modifying the coinbase transaction to change the Merkle Root, which opens up a brand new nonce search space.

A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!
Why the Nonce Is Not Enough
A Bitcoin block header has six fields: version, previous block hash, Merkle Root, timestamp, difficulty target (bits), and nonce. The nonce is the only field designed for miners to change freely and quickly. It starts at 0 and increments with each hash attempt. 2³² attempts is nothing for today's mining hardware. Take the older AntMiner S9 as an example. It runs at about 12 TH/s, or roughly 2⁴³ hashes per second. That means the entire nonce space can be exhausted in under a millisecond. The miner does not stop. It must immediately find the next thing it can change.
Changing the Coinbase Transaction to Get a New Merkle Root
This is the core way miners keep going. The coinbase transaction is the first transaction in every block. It is the one where the miner pays themselves the block reward and transaction fees. Inside this transaction there is a field that can be filled freely, usually called the ExtraNonce. When a miner increments the ExtraNonce, the hash of the coinbase transaction changes. That in turn changes the Merkle Root of the entire block. Once the Merkle Root changes, the block header becomes a completely new input, and the nonce can start over from 0 and cycle through all 2³² values again.
This process has a cost. Every time the ExtraNonce changes, the miner needs to recalculate the Merkle Root and prepare the block header data again. Compared to incrementing the nonce, which costs almost nothing, changing the coinbase is a low-frequency action. But in real mining, this low-frequency update is still far faster than the rate at which valid blocks are found. So it is more than enough to keep miners running continuously.
Timestamp and Version Can Also Change, but Are Used Less
The timestamp is also in the block header. Miners can adjust it within a certain range. When the timestamp changes, the input to the block header hash changes too, and the nonce space refreshes again. The version field can also be rolled. Some mining machines or firmware support changing certain bits in the version field as an additional source of search space.
Timestamp adjustments have limits. You cannot set it arbitrarily far into the future or past, otherwise the block may be rejected by the network. Version rolling is also not as universal as changing the ExtraNonce. Different mining machines and mining pools support it to different degrees. So in real mining workflows, the coinbase ExtraNonce is the main tool, the timestamp is a backup, and version rolling is a supplement for specific situations.
What This Means for Regular Readers
Understanding what happens after the nonce runs out clears up a common misunderstanding: Bitcoin mining does not have a search space that ends after 2³² hash attempts. The nonce is just a small knob that changes very often. The Merkle Root is a big knob that changes less often but has an almost unlimited range. By using these two knobs together, miners can expand the search space far beyond 2³².
Another point to keep clear is that running out of nonces is not a failure or a rare event. At the current difficulty level of the Bitcoin network, miners go through multiple full nonce cycles every second. You do not need to worry about what happens when the nonce runs out. Mining firmware and pool software have long since built this logic into their everyday operations. What miners really care about is hash rate and electricity cost, not whether the nonce counter overflows.

A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!
References
- Programming Bitcoin, Chapter 9 https://raw.githubusercontent.com/jimmysong/programmingbitcoin/06c8c7c2661d1af9fd80c6497acfe500fa015ece/ch09.asciidoc#2
- Bitcoin Developer Reference, blockchain documentation https://developer.bitcoin.org/reference/block_chain.html
- EP4276598A1 related patent document https://patentimages.storage.googleapis.com/12/15/3d/5e893bc5c6feb9/EP4276598A1.pdf#2#4#2


