Skip to content

Instantly share code, notes, and snippets.

@scmorse
Created February 10, 2015 22:30

Revisions

  1. Stephen created this gist Feb 10, 2015.
    21 changes: 21 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@


    // Assume difficulty retargets every 5 blocks for illustrative purposes
    // Assume difficulty retargeting is done with block pairs (0, 5), (5, 10), (10, 15), ...
    // (i.e. assuming we don't have to worry about time warp bug)

    Block # Timestamp (relative to start)
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5 * target block time
    6 6
    7 7
    8 8
    9 9
    10 10 * target block time
    11 11

    This still meets the block timestamp > median(past 11 blocks' timestamp) requirement along the whole chain, but allows someone to create an extremely long chain while still keeping the tip of the chain's time stamp sufficiently far back in time to be accepted. To fix this, you would need at least