Author

Topic: Cumulative difficulty shouldn't be used to choose the "main" blockchain (Read 2340 times)

legendary
Activity: 2142
Merit: 1010
Newbie
I think the problem is that you are comparing two different timestamps. The first blockchain wouldn't stop mining at the 00:40 mark, so if you continue it to the 01:20 mark it will win as it should.

Maybe... That was just an idea. Everything in our world can be modelled with the Gaussian distribution. When you try to optimize such models you usually come to "least squares".
member
Activity: 72
Merit: 10
I think the problem is that you are comparing two different timestamps. The first blockchain wouldn't stop mining at the 00:40 mark, so if you continue it to the 01:20 mark it will win as it should.
legendary
Activity: 2142
Merit: 1010
Newbie
Fail 1: 00:60 = 01:00

Fixed, thx. But this doesn't change the result.


Fail 2: Just extend one more block and the first chain will win

What if I extended the second chain? Try to read my post instead of skimming over it.


To others: don't feed the troll. I stop here

To others: jl2012 is obviously a forum addict. He sees trolls everywhere.
legendary
Activity: 1792
Merit: 1111
Fail 1: 00:60 = 01:00

Fail 2: Just extend one more block and the first chain will win

-----------------------

To others: don't feed the troll. I stop here
legendary
Activity: 2142
Merit: 1010
Newbie
Let's assume that we have a cryptocoin with a 3-block retarget period and 10 minutes between blocks.

A first blockchain looks like:

0th block: timestamp 00:00, difficulty 1   <- first block after retarget
1st block: timestamp 00:05, difficulty 1
2nd block: timestamp 00:10, difficulty 1
3rd block: timestamp 00:20, difficulty 2   <- first block after retarget
4th block: timestamp 00:30, difficulty 2
5th block: timestamp 00:40, difficulty 2

Cumulative difficulty = 1 + 1 + 1 + 2 + 2 + 2 = 9
Hashes calculated (excluding 0th block) = N + N + 2N + 2N + 2N = 8N
Time spent = 00:40 - 00:00 = 40 minutes
Hashpower wasted = 8N / 40 = 0.2N hash/min

A second one looks like:

0th block: timestamp 00:00, difficulty 1   <- first block after retarget
1st block: timestamp 00:10, difficulty 1
2nd block: timestamp 00:20, difficulty 1
3rd block: timestamp 00:30, difficulty 1   <- first block after retarget
4th block: timestamp 00:40, difficulty 1
5th block: timestamp 00:50, difficulty 1
6th block: timestamp 01:00, difficulty 1   <- first block after retarget
7th block: timestamp 01:10, difficulty 1
8th block: timestamp 01:20, difficulty 1

Cumulative difficulty = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 9
Hashes calculated (excluding 0th block) = N + N + N + N + N + N + N + N = 8N
Time spent = 01:20 - 00:00 = 80 minutes
Hashpower wasted = 8N / 80 = 0.1N hash/min

Which blockchain is better? If you take into account the cumulative difficulty you can choose the second one, which looks a bad choice coz it requires hardware with lower "intensity" of hashing. But if we took squares of the difficulty of each block we would definitely choose the first blockchain (15 vs 9).

You may ask why squares? Well... I think there is a mystical connection to http://en.wikipedia.org/wiki/Least_squares. Smiley
Jump to: