0

This question already has an answer here:

To my knowledge, neither SHA256 or scrypt have ever had provable instances of hash collisions occur.. However, if this highly unlikely event was to happen, what would that mean for the state of the blockchain? Would it cause consensus confusion since there would be 2 blocks with the same hash that point back to different previous blocks? And/or would it make it best practice to avoid whatever algorithm the collision occurred with?

Just curious,

-Schwifty

marked as duplicate by chytrik, Raghav Sood, 0xb10c, pebwindkraft, JBaczuk Aug 3 '18 at 16:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

This is a very unlikely event to occur, but, in the case it would happen nothing strange will go on.

Also if a block is mined by two miners at the same time, some nodes will see and accept one of the two "twins" blocks first, and the second will be simply ignored. After the majority of nodes agrees that one of the two blocks is the "good" one (A) the other twin block (B) get rejected by all nodes following a network discard of such block(B).

However, chances of that happening are negligible, because the block hash is a random 256 bit output (smaller than the current target), which allows for an immense number of possible hash outputs of a similar magnitude as the address space. ref

Well explained also by P Wuille:

"If two blocks with the same hash and the same parent are produced ~simultaneously, one of which is valid, and the other is invalid (but does have valid proof of work), some nodes in the network will see one first, and others will see the other first. Those who see the invalid version first will mark the block as permanently invalid, and they won't bother even trying to learn about the valid one when another block builds on top. This would lead to a permanent chain fork between the nodes who saw the invalid block first and those who saw the valid one first." ref

  • I commend you for the thoroughness of your answer and the inclusion of references. If I could do more than upvote this and accept it as the answer to my question, I would. – apt-getschwifty Jul 31 '18 at 21:21
  • 1
    The second and third paragraph of your answer concerns an orphan block situation, which is different than a blockhash collision. Pieter’s answer that you referenced covers the blockhash collision situation well. – chytrik Aug 1 '18 at 8:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.