<p>Yes, its possible for there to be more than one valid hash.  I don't know what the mathematical probability of this is, but if you were to exhaust the entire nonce spectrum, there are likely to be several valid blocks.  Most blocks, however, stop when they get a valid hash, so it seldom is an issue.  Though occasionally, two miners might come up with different valid hashes at the same time, and this results in one of them being rejected.</p>

<p>As for a collision, well, that's effectively impossible.  First, yes, it's possible that the same hash could be found for two different blocks, but that's not a collision.  It's also highly unlikely.  Unlikely to the point of there being no point in dealing with it.  </p>

<p>Yes, it could screw up certain software that assumes hashes are indexable and unique, but it shouldn't really be an issue for the blockchain itself to have duplicate hashes.</p>

<p>The only real "collision" would be if an attacker were trying to come up with his own block of transactions, with the same parent that would somehow hash to the same value and trying to "take over" the other block, and that is astronomically unlikely to the point of absurdity.</p>

CC BY-SA 3.0
2017-07-11T09:53:33.850Z
Ok, you replied my mainly question but: Why is not an issue for blockchain to have duplicate hashes? Each block point to the previous block... Maybe in order to follow the blockchain you get lost(?). And I read about ntime and extranonce, how these affect to producing hashes? It's not the nonce the only thing that can change, right? Thanks!!
miguelmartinezinf
CC BY-SA 3.0
2017-07-11T14:30:34.790Z
@mikiasda - Can't get lost because each block points to the previous block, not the previous hash.  The previous hash is included in the block, but it's not a pointer.
Mr.Nobody
CC BY-SA 3.0
2017-07-10T23:46:44.957Z
2017-07-10T23:46:44.957Z
Mr.Nobody
<p>Certainly. Multiple miners can find a valid block hash for a specific block height and both would be valid blocks. In cases like this, the one that other miners decide to extend upon (usually by receiving the block first) becomes the "real" block and other block becomes stale (or orphaned). This happens fairly frequently.</p>

CC BY-SA 3.0
2017-07-10T17:51:07.613Z
2017-07-10T17:51:07.613Z
Ava Chow
<p>Since changing a single byte of the block results in a different hash, a block can only have a unique hash. A block cannot have several hashes.</p>

<p>However, for a given previous block header, there's an quasi infinite number of new blocks that can be mined on top. The role of miners is to generate as many new blocks as they can on top of the current chain head, and then check if the hash of this new block is less than the current target.</p>

<p>To generate these new blocks, they pick a set of valid transactions that doesn't contradict previous transactions, compute the merkle tree of that set of transactions which they include in the block header. That block header contains the nonce field which they increment until they find a valid block or run out of nonce space, in which case, they start the process anew.</p>

CC BY-SA 3.0
2017-07-10T15:53:22.460Z
thanks for your reply, but WHY is not possible to produce multiple valid hashes? The only condition is to be less than the target. And I have another question: Could happen a colission? Producing the same valid hash with same block header and two (or more) different nonces.
miguelmartinezinf
CC BY-SA 3.0
2017-07-10T21:33:17.190Z
For a given ordered set of transaction and a parent block, there can be only one byte representation of it as a new block and hence only a single hash for it. But if you change the order of the transactions, or the transactions themselves, you can find different valid solutions for a given parent.

Indeed, it's mathematically possible to have collisions where two or more headers have the same valid hash, but it's _incredibly_ unlikely and would most certainly break most Bitcoin software.
alcio
CC BY-SA 3.0
2017-07-10T23:38:52.657Z
@alcio - that's simply not true.  Mining is essentially a process in which brute force hashing is performed against a block, the hash of the parent block, and an ever changing nonce value.  When you mine, you increment this nonce value, looking for a hash value below the current difficulty.  As such, different nonce values for the same block result in different hashes, and it's VERY possible for there to be multiple valid hashes for the same block/parent with different nonces.  So yes, there are multiple valid hashes for a given block.
Mr.Nobody
CC BY-SA 3.0
2017-07-11T00:18:18.543Z
@ErikFunkenbusch Since the nonce is part of the block, you cannot have "different nonce values for the same block".
David Schwartz
CC BY-SA 3.0
2017-07-11T09:50:40.170Z
That's like @ErikFunkenbusch said. I mean, all the block header the same except the nonce and multiple nonce values could produce more than 1 valid hash block.
miguelmartinezinf
CC BY-SA 3.0
2017-07-11T10:05:32.670Z
Ah, I see what you mean, while theorically possible, in practice, that's incredibly unlikely for 2 reasons: miners do not mine on the same exact set of transactions (they each pay out to their own address), and at the current difficulty, the chance of a block header having even 1 nonce resulting in a valid hash is infinitesimal (4.3 billion possible nonce values, but there's in average 900 billion billion hashing attempts before a valid block is found)
alcio
CC BY-SA 3.0
2017-07-11T14:32:52.940Z
@alcio - I think you're saying you understand what is meant, but just be sure.. the point is that when the block is unsolved, it's possible for there to be two valid hashes.
Mr.Nobody
CC BY-SA 3.0
2017-07-10T12:13:47.077Z
2017-07-10T12:13:47.077Z
alcio
<p>Discovering a new block is a task about generation of millions of hashes in order to find one valid hash, which is a hash less than the current target.</p>

<p>The question is: Are there more than 1 valid hash? Is it possible to find more than 1 hash valid for the same block? Maybe there are multiple nonce suitable to valid block hashes.</p>

CC BY-SA 3.0
2017-07-11T00:18:54.480Z
What do you mean by "for the same block"? A block has one, and only one, hash, which is the hash of that block.
David Schwartz
CC BY-SA 3.0
2017-07-11T04:15:26.567Z
related: [How can we be sure that a new block will be found?](https://bitcoin.stackexchange.com/q/22978/5406)
Murch
CC BY-SA 3.0
2017-07-11T05:41:44.613Z
There is slight confusion in the question. The nonce is a part of the block. So, a given block will have only 1 hash. If you mean, can there be different nonces such that block hash is different but still meets the difficulty, then yes.
sanket1729
<bitcoind><block><hash>
More than one valid hash block
miguelmartinezinf
# More than one valid hash block

(Asked by: username_0 on 2017-07-10)

Discovering a new block is a task about generation of millions of hashes in order to find one valid hash, which is a hash less than the current target.

The question is: Are there more than 1 valid hash? Is it possible to find more than 1 hash valid for the same block? Maybe there are multiple nonce suitable to valid block hashes.

**Tags:** bitcoind, block, hash

> **Comments:**
> **username_1**: What do you mean by "for the same block"? A block has one, and only one, hash, which is the hash of that block.  
> **username_2**: related: [How can we be sure that a new block will be found?](https://bitcoin.stackexchange.com/q/22978/5406)  
> **username_3**: There is slight confusion in the question. The nonce is a part of the block. So, a given block will have only 1 hash. If you mean, can there be different nonces such that block hash is different but still meets the difficulty, then yes.  

---

## 3 answers

### Answer by username_4 on 2017-07-10. Score: 1 | Accepted answer

Yes, its possible for there to be more than one valid hash. I don't know what the mathematical probability of this is, but if you were to exhaust the entire nonce spectrum, there are likely to be several valid blocks. Most blocks, however, stop when they get a valid hash, so it seldom is an issue. Though occasionally, two miners might come up with different valid hashes at the same time, and this results in one of them being rejected.

As for a collision, well, that's effectively impossible. First, yes, it's possible that the same hash could be found for two different blocks, but that's not a collision. It's also highly unlikely. Unlikely to the point of there being no point in dealing with it.

Yes, it could screw up certain software that assumes hashes are indexable and unique, but it shouldn't really be an issue for the blockchain itself to have duplicate hashes.

The only real "collision" would be if an attacker were trying to come up with his own block of transactions, with the same parent that would somehow hash to the same value and trying to "take over" the other block, and that is astronomically unlikely to the point of absurdity.

> **Comments:**
> **username_0**: Ok, you replied my mainly question but: Why is not an issue for blockchain to have duplicate hashes? Each block point to the previous block... Maybe in order to follow the blockchain you get lost(?). And I read about ntime and extranonce, how these affect to producing hashes? It's not the nonce the only thing that can change, right? Thanks!!  
> **username_4**: @mikiasda - Can't get lost because each block points to the previous block, not the previous hash.  The previous hash is included in the block, but it's not a pointer.  

---

### Answer by username_5 on 2017-07-10. Score: 0

Certainly. Multiple miners can find a valid block hash for a specific block height and both would be valid blocks. In cases like this, the one that other miners decide to extend upon (usually by receiving the block first) becomes the "real" block and other block becomes stale (or orphaned). This happens fairly frequently.


---

### Answer by username_6 on 2017-07-10. Score: 0

Since changing a single byte of the block results in a different hash, a block can only have a unique hash. A block cannot have several hashes.

However, for a given previous block header, there's an quasi infinite number of new blocks that can be mined on top. The role of miners is to generate as many new blocks as they can on top of the current chain head, and then check if the hash of this new block is less than the current target.

To generate these new blocks, they pick a set of valid transactions that doesn't contradict previous transactions, compute the merkle tree of that set of transactions which they include in the block header. That block header contains the nonce field which they increment until they find a valid block or run out of nonce space, in which case, they start the process anew.

> **Comments:**
> **username_0**: thanks for your reply, but WHY is not possible to produce multiple valid hashes? The only condition is to be less than the target. And I have another question: Could happen a colission? Producing the same valid hash with same block header and two (or more) different nonces.  
> **username_6**: For a given ordered set of transaction and a parent block, there can be only one byte representation of it as a new block and hence only a single hash for it. But if you change the order of the transactions, or the transactions themselves, you can find different valid solutions for a given parent.  Indeed, it's mathematically possible to have collisions where two or more headers have the same valid hash, but it's _incredibly_ unlikely and would most certainly break most Bitcoin software.  
> **username_4**: @username_6 - that's simply not true.  Mining is essentially a process in which brute force hashing is performed against a block, the hash of the parent block, and an ever changing nonce value.  When you mine, you increment this nonce value, looking for a hash value below the current difficulty.  As such, different nonce values for the same block result in different hashes, and it's VERY possible for there to be multiple valid hashes for the same block/parent with different nonces.  So yes, there are multiple valid hashes for a given block.  
> **username_1**: @ErikFunkenbusch Since the nonce is part of the block, you cannot have "different nonce values for the same block".  
> **username_0**: That's like @ErikFunkenbusch said. I mean, all the block header the same except the nonce and multiple nonce values could produce more than 1 valid hash block.  
> **username_6**: Ah, I see what you mean, while theorically possible, in practice, that's incredibly unlikely for 2 reasons: miners do not mine on the same exact set of transactions (they each pay out to their own address), and at the current difficulty, the chance of a block header having even 1 nonce resulting in a valid hash is infinitesimal (4.3 billion possible nonce values, but there's in average 900 billion billion hashing attempts before a valid block is found)  
> **username_4**: @username_6 - I think you're saying you understand what is meant, but just be sure.. the point is that when the block is unsolved, it's possible for there to be two valid hashes.  

---

