Created
February 10, 2015 22:30
-
-
Save scmorse/ecd204f0a0974270ba90 to your computer and use it in GitHub Desktop.
Block height attack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment