Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: zeppelin on March 13, 2014, 02:31:19 PM



Title: Potential attack by solo mining a long chain?
Post by: zeppelin on March 13, 2014, 02:31:19 PM
Apologies if this has already been brought up, or is otherwise a stupid question.

Could a rogue miner decide to branch off of the blockchain from a very early block (when the difficulty was very low - and keep it low), and solo mine a chain of huge length which would exceed the current chain's length and thus become the longest?


Title: Re: Potential attack by solo mining a long chain?
Post by: Deafboy on March 13, 2014, 02:35:31 PM
No, because blockchain length is not the only important factor. Chain with higher difficulty will win.
And there are also hardcoded checkpoints in every bitcoin client release.


Title: Re: Potential attack by solo mining a long chain?
Post by: zeppelin on March 13, 2014, 02:41:25 PM
The hardcoded checkpoints make sense, but could you give more detail about the difficulty being an important part of choosing the main chain? What's the formula? Also, couldn't the difficulty be faked?

If I recall, the difficulty is adjusted every two weeks. The attacker could time the attack to happen right at the changeover, and make it appear that the previous two weeks of their solo effort ramped up the difficulty significantly.

Thanks!


Title: Re: Potential attack by solo mining a long chain?
Post by: DeathAndTaxes on March 13, 2014, 02:54:15 PM
Each block targets a specific difficulty.  Difficulty can't be faked because a difficulty 1 million block IS 1 million times harder to produce.

The "longest" chain is the chain with the highest sum of block difficulty.

So between these two chains
dif 1, dif 1, dif 1, dif 1, dif 1
block height 5, total difficulty 5

and
diff 2, diff 2, diff 2
block height 3, total difficulty 6

the later is the "longest" chain.

There is no method you can use to consistently produce the longest chain without having more hashpower than all "good" miners combined.


Title: Re: Potential attack by solo mining a long chain?
Post by: zeppelin on March 13, 2014, 03:03:19 PM
Great, thanks! I guess 'longest chain' hides some complexity, since it seems to imply height only. This totally makes sense though.

I know you can't fake the difficulty of a solved block, but I was suggesting that you could solve 2016 (low-difficulty-target) blocks in like 1 day, which would make the next block's difficulty target very high. So if 'longest chain' meant something like: 'height plus difficulty of the next block', then there'd be room for an attack. That's why I wanted clarification of what 'longest chain' really meant. But given what you said, this is impossible.

Thanks for the guidance.