Post
Topic
Board Mining speculation
Re: What does "difficulty" mean?
by
augustocroppo
on 02/11/2013, 22:11:01 UTC
What exactly does "difficulty" mean?

Difficulty is an indicator of how much difficult is to find a block in accordance with the current target. To understand what difficulty means, you need to learn what targets means.

https://en.bitcoin.it/wiki/Target

Target is a 256-bit number which is shared by all Bitcoin clients. This number is compared to another 256-bit number in every block header. However  the number is not stored in a plain format, but in hash format. That means, the number is encrypted with SHA-256 algorithm.

When the number in the block header is equal or lower than the target, the block is accepted by the network and the process to create a new block begins.

E.g.

This is 256 bit number (in plain format) generated by the WolframAlpha:

8393997369393596769785934437998533438869467733663864887985488578597765357899637 6963755689359767757995645635365976764834883553347856773996359755847675437989674 7685754754588889348944777763666355343496447368956469469785645675565858334876759 7376735687578643494

So, as you can see, it is quite difficult to generate a random number which is exactly equal or lower than the above number. That is why the speed of a given Bitcoin "mining" device is what defines the chances to meet this criteria. As more random numbers per second is generated by the device, more chances to meet the target in less time as possible.

So if a person have a device which generates 1 Gigahash per second, that means the device generates the equivalent amount of 1 billion hash (256 bit number) per second.

 Shocked

Amazing, right?

Now let's understand what difficulty really means.

Quote
I know the higher the difficulty the difficult it becomes to mine coins but what exactly does it mean? For e.g. if difficulty is 545898 so that means it will take this number of days or may be minutes to find the next block?

Difficulty is the maximum target divided by the current target. So if difficulty is 545898, that means:

545898 = maximum target / current target

Quote
The maximum difficulty is roughly: maximum_target / 1 (since 0 would result in infinity), which is a ridiculously huge number (about 2^224).

The current target changes in accordance with how fast or how slow the blocks are accepted by the network during a time frame of 2 weeks. If the network is accepting more or less than 1 block each 10 minutes, the Bitcoin protocol will adjust the current target to keep that rate stable. So from this continuous adjustment is where the speed of the Bitcoin network comes from:

Network Hash Rate = Difficulty * 2**32 / 600

E.g.

Network Hash Rate = 545898 * 2**32 / 600

Network Hash Rate = 3907690094919 17/25

That means, if the difficulty is 545898, than the average number of hash per second required to a block being accepted by the network each 10 minutes is approximately 3907690094918, or approximately 3907 Terahash per second.