<p>When the nonce range is exhausted, miners change the extraNonce field of the generation transaction. This changes the Merkle root in the header and allows a new range of nonces to be attempted.</p>

<p>Since the Merkle root is 256 bits, this can be repeated indefinitely.</p>

CC BY-SA 3.0
2013-11-13T19:38:50.813Z
Don't the transactions in the block also change the hash? So, whenever you add another transaction couldn't you just start over at 0 with the nonce?
Murch
CC BY-SA 3.0
2013-11-13T21:21:49.233Z
@Murch: Of course. But getting a new transaction is generally rarer than exhausting a nonce range.
Meni Rosenfeld
CC BY-SA 3.0
2013-11-12T21:18:32.203Z
2013-11-12T21:18:32.203Z
Meni Rosenfeld
<p>I've been doing a lot of reading on mining and software related to mining but I can't quite get my head wrapped around the specific nature of what is being hashed together. So far I feel like the current block header, and a nonce are hashed together in hopes of finding a hash that is less than the current target, if it is, you get 25BTC. Here's where I am confused, according to the psuedocode <a href="https://bitcoin.stackexchange.com/a/3047">https://bitcoin.stackexchange.com/a/3047</a> . The only value that changes is the nonce, and that is a fixed possible hex/integer ex: from 0 to 0xFFFFFFFF.</p>

<p>How is it that the difficulty can increase if there are a finite number of attempts to change the nonce?</p>

<p>Am I right about hashing together the block header with the nonce?</p>

<p>I referenced this <a href="https://en.bitcoin.it/wiki/Proof_of_work" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Proof_of_work</a> and it makes perfect sense.. except for the fact that I still feel like the nonce is the only value that changes.</p>

<p>Maybe the 32-bit nonce yields way more possibilities that I can fathom and hashing together every possible nonce value is actually what is done.</p>

<p>Thanks!</p>

<hash><algorithms><sha256><nonce><mining-technical-details>
What values are hashed in the SHA-256 algorithm, and what would be the next iteration until a possible header is found?
Snarf
# What values are hashed in the SHA-256 algorithm, and what would be the next iteration until a possible header is found?

(Asked by: username_0 on 2013-11-12)

I've been doing a lot of reading on mining and software related to mining but I can't quite get my head wrapped around the specific nature of what is being hashed together. So far I feel like the current block header, and a nonce are hashed together in hopes of finding a hash that is less than the current target, if it is, you get 25BTC. Here's where I am confused, according to the psuedocode <https://bitcoin.stackexchange.com/a/3047> . The only value that changes is the nonce, and that is a fixed possible hex/integer ex: from 0 to 0xFFFFFFFF.

How is it that the difficulty can increase if there are a finite number of attempts to change the nonce?

Am I right about hashing together the block header with the nonce?

I referenced this <https://en.bitcoin.it/wiki/Proof_of_work> and it makes perfect sense.. except for the fact that I still feel like the nonce is the only value that changes.

Maybe the 32-bit nonce yields way more possibilities that I can fathom and hashing together every possible nonce value is actually what is done.

Thanks!

**Tags:** hash, algorithms, sha256, nonce, mining-technical-details


---

## 1 answers

### Answer by username_1 on 2013-11-12. Score: 5

When the nonce range is exhausted, miners change the extraNonce field of the generation transaction. This changes the Merkle root in the header and allows a new range of nonces to be attempted.

Since the Merkle root is 256 bits, this can be repeated indefinitely.

> **Comments:**
> **username_2**: Don't the transactions in the block also change the hash? So, whenever you add another transaction couldn't you just start over at 0 with the nonce?  
> **username_1**: @username_2: Of course. But getting a new transaction is generally rarer than exhausting a nonce range.  

---

