Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Massimo80 on May 07, 2014, 02:48:17 PM



Title: Is a full blockchain fork possible?
Post by: Massimo80 on May 07, 2014, 02:48:17 PM
Let's say someone creates a blockchain fork starting from the genesis block, when the difficulty was absurdly low compared to today; then he starts mining new blocks from there up to the current block index.

Normally, this would require such an amount of time to make it completely impossibile to catch up with the real blockchain; even if he used today's powerful mining hardware, the difficulty increase would compensate for it quickly. But, here's the catch: he customizes his mining software to not ever increase the difficulty, even if it's mining hundreds of blocks per second; block timestamps are simply faked in order to make it seem they were generated at ~10 minutes interval.

When the fake blockchain is longer then the real one (currently ~300000 blocks), he starts broadcasting it; it appears to conform to all rules, and it's longer than the current one, thus all clients and miners treat this as a winning fork and switch to working on it. Of course, difficulty increases abruptly as soon as the full network hashing power is thrown at it, and after some time block generation resumes normal levels.

But now the creator of the fake blockchain owns all Bitcoins that have been generated from the genesis block to when he released it.

Is this scenario actually possible? If not, why? How would Bitcoin nodes reacts to a 300000-blocks-long fork? Is there a limit on how long a fork can be?


Title: Re: Is a full blockchain fork possible?
Post by: Rannasha on May 07, 2014, 02:57:26 PM
This has been discussed several time before, including a thread that is still ongoing: https://bitcointalk.org/index.php?topic=596892.0

The gist of it is: The measure of "longest chain" doesn't only look at the blockcount, but instead at the total amount of work completed in a chain. That is, blockcount with each block weighted by its difficulty. Your proposed attack will generate a chain that is equal or greater in blockcount to the main chain, but will be orders of magnitude smaller in terms of total amount of work and will therefore not be accepted.


Title: Re: Is a full blockchain fork possible?
Post by: Massimo80 on May 07, 2014, 03:01:23 PM
This has been discussed several time before, including a thread that is still ongoing: https://bitcointalk.org/index.php?topic=596892.0

The gist of it is: The measure of "longest chain" doesn't only look at the blockcount, but instead at the total amount of work completed in a chain. That is, blockcount with each block weighted by its difficulty. Your proposed attack will generate a chain that is equal or greater in blockcount to the main chain, but will be orders of magnitude smaller in terms of total amount of work and will therefore not be accepted.

Ok, thanks ;D

Sorry if this had already been discussed, of course I did some searching, but I couldn't find a good way to search for this.


Title: Re: Is a full blockchain fork possible?
Post by: DeathAndTaxes on May 07, 2014, 03:08:14 PM
he customizes his mining software to not ever increase the difficulty, even if it's mining hundreds of blocks per second; block timestamps are simply faked in order to make it seem they were generated at ~10 minutes interval.

When the fake blockchain is longer then the real one (currently ~300000 blocks), he starts broadcasting it; it appears to conform to all rules, and it's longer than the current one

As pointed out the "longest chain" is the one with the highest sum of difficulty.  However even if that wasn't the case the blocks would be invalid.   The timestamp of the genesis block is fixed at 01/03/2009. To avoid a difficulty increase no more than 144 blocks can be mined per day.  To mine a chain longer than the current chain would require 2083 days of faked timestamps.  That would make the timestamp of the last block 09/18/2014 or almost 4 months into the future.  Blocks which deviate from the network median time by more than 2 hours are invalid, in other words they "don't conform to all the rules".



Title: Re: Is a full blockchain fork possible?
Post by: Massimo80 on May 07, 2014, 03:23:20 PM
As pointed out the "longest chain" is the one with the highest sum of difficulty.  However even if that wasn't the case the blocks would be invalid.   The timestamp of the genesis block is fixed at 01/03/2009. To avoid a difficulty increase no more than 144 blocks can be mined per day.  To mine a chain longer than the current chain would require 2083 days of faked timestamps.  That would make the timestamp of the last block 09/18/2014 or almost 4 months into the future.  Blocks which deviate from the network median time by more than 2 hours are invalid, in other words they "don't conform to all the rules".

Nice catch :D