# What would happen if two blocks had the same hash?

Consider the following scenario:

• January 2016 block A gets submitted. Its hash is `0001010`.

• January 2017 block B gets submitted. Its hash is also `0001010` (collision).

• 10 minutes later, block C gets submitted and the previous field points to the hash `0001010`.

Is it still possible to determine that the previous block is block B and not block A?

Note that while this is unlikely, there are not 2^256 possibilities a block hash can be. Every block hash has to start with zeroes which decreases the amount of possibilities. In this scenario there are only 2^4 possibilities even though the hash has 7 bits which would theoretically allow 2^7 possibilities.

Blocks are identified by their hash.

This means that in your story, in Jan 2017, when B gets broadcast, any node that it is advertized to will think "I already have this block", and ignore it.

However, when we consider block hash collisions to be a realistic situation, there is another issue that may arise:

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.

They would be the same block ;-)

If a block happen to have the same hash of another one then all the odds are for those two blocks to share the same exact data i.e. be the same block. Before arguing if we managed to create a collision (extremely low probability, zero I would say) we should investigate if we managed to mine the same transactions in the same order and using the same nonce (low probability, but order of magnitude greater than the previous case)

• We would still have two different coinbase transactions, unless we're also trying to pay the same address. :)
– Murch
Sep 27, 2017 at 14:17