<p>The timestamp in blocks does not need to be set to the actual time of the current hash. So during mining, the timestamp can be moved when the nonce is exhausted even if the actual time is not that timestamp.</p>

<p>There are also other ways to change block headers that do not require changing the timestamp. Miners frequently add a value to the coinbase part of their coinbase transaction which is referred to as an extranonce. Miners will increment that in order to change the merkle root every time they exhaust one set of nonces so as to allow for even more nonce possibilities. Furthermore, other things can be done such as permuting transaction order, selecting new transactions, changing coinbase output scripts, etc. All of these ways of changing the block hash allows for miners to do trillions of hashes per second.</p>

CC BY-SA 4.0
2021-06-07T12:29:49.833Z
The timestamp chosen by the miner is subject to sanity checks: "greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours" https://en.bitcoin.it/wiki/Block_timestamp
Joachim Wagner
CC BY-SA 3.0
2017-08-28T23:07:57.500Z
2017-08-28T23:07:57.500Z
Ava Chow
<p>According to another similar question on Bitcoin Stack Exchange, <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Block_hashing_algorithm</a> shows how the mining algorithm works for Bitcoin.  The problem is, it shows the nonce as being not larger than 2^32.  When someone has gone through all the values the nonce can have, it seems the time changes and the search for a proper nonce begins anew, as even changing the second by 1 is enough to warrant testing the nonces again in the hashing algorithm.  </p>

<p>As it relates to the actual mining algorithm/software, with all this in mind, how can mining hardware provide billions or trillions of hashes per second when each second only provides ~4.3 billion different nonces and requires a new "second of time" to change the time so as to begin anew with the nonces?  It seems as though in the most extreme circumstances, even having the "merkle root" changing due to the addition of a transaction to the block would not occur frequently enough for the most powerful ASICs to always have work to do.  </p>

<p>To the extent that it is possible I am seeking a potentially elaborate yet easy to understand answer.</p>

<mining-hardware><miner-configuration><hash><hashpower>
How can someone mine bitcoins at billions or trillions of hashes per second when the nonce is only 2^32 in size?
Mine
# How can someone mine bitcoins at billions or trillions of hashes per second when the nonce is only 2^32 in size?

(Asked by: username_0 on 2017-08-28)

According to another similar question on Bitcoin Stack Exchange, <https://en.bitcoin.it/wiki/Block_hashing_algorithm> shows how the mining algorithm works for Bitcoin. The problem is, it shows the nonce as being not larger than 2^32. When someone has gone through all the values the nonce can have, it seems the time changes and the search for a proper nonce begins anew, as even changing the second by 1 is enough to warrant testing the nonces again in the hashing algorithm.

As it relates to the actual mining algorithm/software, with all this in mind, how can mining hardware provide billions or trillions of hashes per second when each second only provides ~4.3 billion different nonces and requires a new "second of time" to change the time so as to begin anew with the nonces? It seems as though in the most extreme circumstances, even having the "merkle root" changing due to the addition of a transaction to the block would not occur frequently enough for the most powerful ASICs to always have work to do.

To the extent that it is possible I am seeking a potentially elaborate yet easy to understand answer.

**Tags:** mining-hardware, miner-configuration, hash, hashpower


---

## 1 answers

### Answer by username_1 on 2017-08-28. Score: 3 | Accepted answer

The timestamp in blocks does not need to be set to the actual time of the current hash. So during mining, the timestamp can be moved when the nonce is exhausted even if the actual time is not that timestamp.

There are also other ways to change block headers that do not require changing the timestamp. Miners frequently add a value to the coinbase part of their coinbase transaction which is referred to as an extranonce. Miners will increment that in order to change the merkle root every time they exhaust one set of nonces so as to allow for even more nonce possibilities. Furthermore, other things can be done such as permuting transaction order, selecting new transactions, changing coinbase output scripts, etc. All of these ways of changing the block hash allows for miners to do trillions of hashes per second.

> **Comments:**
> **username_2**: The timestamp chosen by the miner is subject to sanity checks: "greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours" https://en.bitcoin.it/wiki/Block_timestamp  

---

