Same block hash #4000

issue gergomiho opened this issue on April 3, 2014
  1. gergomiho commented at 5:03 PM on April 3, 2014: none

    Today I was wondering once we get same hash for 2 different blocks, will the blockchain fork ? I know it has a small chance right now, but with the diff increase the chance is getting bigger, because the range of the accepted hashes are getting smaller. I am not sure if the same hash would break the integrity of blockchain, or would cause fork, but please look into it.

  2. christophebiocca commented at 2:16 AM on April 4, 2014: none

    You can simplify the calculation by ignoring the range restriction, and just calculating the odds of a collision between any two sha256 hashes anywhere in the world (including all the ones that are tried and rejected by ASICs every second). That probability is strictly greated than a block hash collision (because "all hashes ever" is a superset of "all hashes used in blocks").

    Using the well known approximation we can get how many hashes to generate before to get a one percent chance of a collision. Works out to about 2**125 (rounding down).

    How many hashes is 2125? A double hash (like used in bitcoin) requires 3375 integer operations, and each word has 32 bits, so approximately 108000 * 2125 bit flips. At the maximum achievable efficiency possible at room temperature, computing that many bit flips requires a third of the world's fossil fuel reserves to be burned just to compute them. And that's at a theoretical optimum efficiency. Use realistic figures and you'll get 10,000 times that energy cost.

    Long before any of this is even remotely likely, we'll have to deal with SHA2 being broken the old-fashionned way, by mathematicians.

  3. laanwj commented at 6:51 AM on April 4, 2014: member

    The first thing AcceptBlock() does is check for duplicate block hashes and reject the block in that case. The blockchain will not fork, it will just not be accepted.

    However, as @christophebiocca says If you're able to create double-SHA2 collisions, then you could create all kinds of havoc with the network. The algorithm will have to be switched way before then.

  4. laanwj closed this on Apr 4, 2014

  5. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me