Where, or how, can I get a complete history of difficulty?

2

I would like to have a complete list of the historical mining difficulty of bitcoin. Preferably it would be a text list or csv, but a webpage that displays the data in any text format will do.

I've been searching for several hours over the last couple of days with no progress. I'm quite surprised that this is so hard to find...

timeSmith

Posted 2016-01-07T10:53:31.477

Reputation: 23

Answers

3

You can get it for example on blockchain.info. Call up the Difficulty chart, switch the time-frame to "All Time", then use the link labelled "CSV", to download it.

Note that the difficulty only changes every 2016 blocks, which is re-targeted to be about 14 days, in case you wonder why there are so few data points.

Murch

Posted 2016-01-07T10:53:31.477

Reputation: 41 609

After having a look at the data, there may be a mistake in the first few data points. As far as I know the difficulty can’t drop below one, so the values given with zero irritate me. I would assume that they were one as well.Murch 2016-01-07T11:13:10.323

Thank you! This is exactly what I was looking for. Also, I'll adjust the 0 values, as you describe, before using the data.timeSmith 2016-01-07T11:27:52.633

I don't see any negative data points, but I do see a few 0 points. Bitcoin's difficulty can't go below 1 by consensus rule, I believe, so blockchain.info has some bad data here.morsecoder 2016-01-07T21:30:30.600

2

The data is also stored on the block chain. Query every 2016 blocks to see the difficulty at that time. Here are some samples, can see block 131040 was a re-target.

# bitcoin-cli getblockhash 4032 | xargs bitcoin-cli getblock
{
    "hash" : "00000000ca4b69045a03d7b20624def97a5366418648d5005e82fd3b345d20d0",
    "time" : 1294031411,
    "difficulty" : 1.00000000,
}

# bitcoin-cli getblockhash 131039 | xargs bitcoin-cli getblock
{
    "hash" : "0000000000000e6e98694ccb8247aad63aaa1e2bec5a7be14329407e4cea6223",
    "time" : 1308145551,
    "difficulty" : 567269.53016242,
}

# bitcoin-cli getblockhash 131040 | xargs bitcoin-cli getblock
{
    "hash" : "000000000000097aa651b8e19c448924586a8010721c8e7ea282a0272d425987",
    "time" : 1308145774,
    "difficulty" : 876954.49351354,
}

Dustin Butler

Posted 2016-01-07T10:53:31.477

Reputation: 461