Post
Topic
Board Bitcoin Technical Support
Re: Why didn't the difficulty change at block 2016?
by
nathan_24
on 10/08/2017, 13:37:30 UTC
You say that difficulty can't go lower than that because of the algorithm, but it is much lower in the testnet, for example.

Is there a hard-coded minimum difficulty then?
Testnet does have a minimum difficulty of 1 though it is not equivalent to the difficulty on the mainnet.

Yes, the lowest possible target is hardcoded into the client.[1]

[1] https://github.com/bitcoin/bitcoin/blob/1b046603b30ebfab6199a2f92015d507b248b590/src/pow.cpp#L82

That's it! I could read in the code that the minimum difficulty target is 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff. That is transformed into 486604799 when compressed. Then that's why the difficulty never went lower, even when the blocks were produced slower than 2,016 blocks per 2 weeks.

Thanks!