Author

Topic: Same block hash (Read 980 times)

member
Activity: 81
Merit: 1002
It was only the wind.
April 06, 2014, 03:37:59 AM
#12
Yeah ofcourse it has a very small chance by now, we are around diff 0x0000000000000000 8d7c776de8f52815420ca164e661e062c8590ca248c8d4ec which makes it about 16^48, but the hashrate is increasing, so the diff does. Every difficulty doubling halves this number. The difficulty doubled every 2month so far, which will probably slow down at a time, but if it keeps the tendence after 20months it will be just 16^38 which is still a large number, but way less then what it is now.

But after all, I was just curious what happens if we get the same hash number, how does the protocol and how does the current wallet implementation react ?

Edit : laanwj answered it : 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.

Awesome, so even if it does happen by some miracle, some miner/pool will just have been extremely unlucky.
newbie
Activity: 47
Merit: 0
April 03, 2014, 08:35:37 PM
#11
Yeah ofcourse it has a very small chance by now, we are around diff 0x0000000000000000 8d7c776de8f52815420ca164e661e062c8590ca248c8d4ec which makes it about 16^48, but the hashrate is increasing, so the diff does. Every difficulty doubling halves this number. The difficulty doubled every 2month so far, which will probably slow down at a time, but if it keeps the tendence after 20months it will be just 16^38 which is still a large number, but way less then what it is now.

But after all, I was just curious what happens if we get the same hash number, how does the protocol and how does the current wallet implementation react ?

Edit : laanwj answered it : 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.
legendary
Activity: 3472
Merit: 4801
April 03, 2014, 05:51:57 PM
#10
The odds of the two blocks hashing to the same value is about 2^256 which is about 1.15 * 10^77.

In case you don't understand scientific notation, the chance is about 1 in 115000000000000000000000000000000000000000000000000000000000000000000000000000.

The odds of being killed by a meteorite is about 1 in 250,000

http://www.wired.com/2013/02/asteroid-odds/

Odds of death by lighting are about 1 in 10,000,000.

http://www.theblaze.com/stories/2013/02/15/how-likely-are-you-to-die-from-gun-violence-this-interesting-chart-puts-it-in-perspective/

You would be better off planning for these two events.
These events are much more likely to occur.

Toshi

Given the current difficulty, I think the first 64 bits or so of block hashes are all zeros. As difficulty increases, the number of effective bits in the valid hash are reduced. Therefore, the odds (assuming difficulty doesn't increase beyond the effective difficulty of the current block) that any valid future block will have the same hash as the current block is about 2192, not 2256.  The birthday paradox increases the likelihood that there will be two blocks that match each other (rather than a block that matches a specific block).

Of course, even 2192 is a ridiculously large number.

So, we are discussing something that most of us agree isn't going to happen. Even if the OP can't wrap their mind around just how unlikely it is, I'm not yet convinced that a duplicate block hash would be a serious problem anyhow.  So not only are we discussing something that isn't going to happen, it might not even be a problem if it was possible.
newbie
Activity: 3
Merit: 0
April 03, 2014, 05:28:34 PM
#9
The odds of the two blocks hashing to the same value is about 2^256 which is about 1.15 * 10^77.

In case you don't understand scientific notation, the chance is about 1 in 115000000000000000000000000000000000000000000000000000000000000000000000000000.

The odds of being killed by a meteorite is about 1 in 250,000

http://www.wired.com/2013/02/asteroid-odds/

Odds of death by lighting are about 1 in 10,000,000.

http://www.theblaze.com/stories/2013/02/15/how-likely-are-you-to-die-from-gun-violence-this-interesting-chart-puts-it-in-perspective/

You would be better off planning for these two events.
These events are much more likely to occur.

Toshi
legendary
Activity: 3472
Merit: 4801
April 03, 2014, 02:49:29 PM
#8
Why would it matter if two blocks have the same hash?  Is there something that I'm not aware of in the protocol that depends on blocks having a unique hash?
Isn't the block database indexed by blockhash?

The chain could still function if it was traversed linearly as then the previous block would also be relevant.

So, we're saying even if there were a risk of block hash collision, it would be an implementation problem in the Bitcoin Core database, and not a protocol problem, right?

Transactions refer to previous outputs by previous transaction hash and output index, there is no reference to block hash.  The block chain is stored linearly in files, so the order of the blocks (and of the transactions) would be unaffected.
sr. member
Activity: 287
Merit: 250
April 03, 2014, 02:42:00 PM
#7
Why would it matter if two blocks have the same hash?  Is there something that I'm not aware of in the protocol that depends on blocks having a unique hash?

Isn't the block database indexed by blockhash?

The chain could still function if it was traversed linearly as then the previous block would also be relevant.
legendary
Activity: 3472
Merit: 4801
April 03, 2014, 02:29:43 PM
#6
Why would it matter if two blocks have the same hash?  Is there something that I'm not aware of in the protocol that depends on blocks having a unique hash?
legendary
Activity: 2058
Merit: 1452
April 03, 2014, 12:09:32 PM
#5
Well I think we should prepare for this. At this time its not an urging issue, as the hashrate is growing, and there are plenty of space to increase the diff, but once hashrate is not increasing, or we get a very high diff, the chance of getting the same hash is getting bigger.
getting bigger, but still miniscule.
legendary
Activity: 1792
Merit: 1111
April 03, 2014, 12:04:44 PM
#4
Well I think we should prepare for this. At this time its not an urging issue, as the hashrate is growing, and there are plenty of space to increase the diff, but once hashrate is not increasing, or we get a very high diff, the chance of getting the same hash is getting bigger.

Even if you use up all energy of our sun, you won't be able to find a collision by chance

The only possible scenario is when SHA256 is completely broken
newbie
Activity: 47
Merit: 0
April 03, 2014, 11:58:57 AM
#3
Well I think we should prepare for this. At this time its not an urging issue, as the hashrate is growing, and there are plenty of space to increase the diff, but once hashrate is not increasing, or we get a very high diff, the chance of getting the same hash is getting bigger.
legendary
Activity: 1792
Merit: 1111
April 03, 2014, 11:46:32 AM
#2
I think it's a fundamental assumption that no collision may occur. I don't think the code has prepared for this. The chain will fork if the transaction inputs and outputs in the two blocks are not identical.
newbie
Activity: 47
Merit: 0
April 03, 2014, 11:29:07 AM
#1
Hello everyone,

Do you know what happens if two blocks get the same hashes ? I know it has a very small chance, but I would like to know if it can affect the integrity of blockchain or someting.
Jump to: