From Litecoin Wiki
Jump to: navigation, search

Difficulty is a measure of how difficult it is to find a new block. It is a human-friendly way of expressing the target.

How often does the difficulty change?

Every 2016 blocks.

What is the formula for difficulty?

Difficulty can be computed from the current target (which is a 256-bit number) as follows:

difficulty = 0xFFFF * 2**208 / target

How is difficulty stored in blocks?




Difficulty 1 (which is not the lowest difficulty) corresponds to 0x1d00ffff, which gives us a hex target of


What is the current difficulty?

What is the maximum difficulty?



Can the difficulty go down?

Yes it can. See discussion in target.

What is the minimum difficulty?

The minimum difficulty allowed by Litecoin is 2-12, or about 0.00024414.

What network hash rate results in a given difficulty?

The difficulty is adjusted every 2016 blocks based on the time it took to find the previous 2016 blocks. At the desired rate of one block every 2.5 minutes, 2016 blocks would take exactly 3.5 days to find. If the previous 2016 blocks took more than 3.5 days to find, the difficulty is reduced. If they took less than 3.5 days, the difficulty is increased. The change in difficulty is in proportion to the amount of time over or under 3.5 days the previous 2016 blocks took to find.

To find a block, the scrypt hash must be less than the target. This hash is effectively a random number between 0 and 2**256-1. The offset for difficulty 1 is

0xffff * 2**208

and for difficulty D is

(0xffff * 2**208) / D



or just

D * 2**48 / 0xffff

The difficulty is set such that the previous 2016 blocks would have been found at the rate of one every 2.5 minutes, so we were calculating (D * 2**48 / 0xffff) hashes in 150 seconds. That means the hash rate of the network was

D * 2**48 / 0xffff / 150

over the previous 2016 blocks. Can be further simplified to

D * 2**32 / 150

without much loss of accuracy.

At difficulty 1, that is around 28 Mhashes per second.

At the time of writing, the difficulty is 1169.85315079, which means that over the previous set of 2016 blocks found the average network hash rate was

1169.85315079 * 2**32 / 150 = around 33 Ghashes per second.

How soon might I expect to generate a block?

(The eternal question.)


time = difficulty * 2**32 / hashrate


For example, using Python we calculate the average time to generate a block using a 1-Mhash/s mining rig when the difficulty is 1000:

$ python -c "print 1000 * 2**32 / 1e6 / 60 / 60 / 24"

and find that it would take almost 50 days on average.

  • Any one grinding of the hash stands the same chance of "winning" as any other. The numbers game is how many attempts your hardware can make per second.
  • Visit a calculator or perform the maths yourself,
  • Remember it's just probability! There are no guarantees you will win every N days.

Related articles

Portions of this content was copied from the Bitcoin wiki under the CC-BY-3.0 license.