Post
Topic
Board Mining speculation
Re: What does "difficulty" mean?
by
bitcoin_builder
on 03/11/2013, 16:57:39 UTC
Great explanation Augusto!
Need to clarify one thing regarding target.

1. Network takes some random number and it generates its hash

No, the target is not exactly a random number. The target is defined in accordance with the rate of blocks being accepted by the network each 10 minutes. So there is a defined formula to generate the target.

Let's examine a real case, the first block generated by Satoshi Nakamoto when he started the Bitcoin protocol. The Internet page blockexplorer.com provide a history of the blockchain in CSV format:

http://blockexplorer.com/q/nethash

Quote
blockNumber,time,target,avgTargetSinceLast,difficulty,hashesToWin,avgIntervalSinceLast,netHashPerSecond
START DATA
144,1231693144,26959535291011309493156476344723991336010898738574164086137773096960,26959535291011309493156476344723991336010898738574164086137773096960,1.00,4295032833,1563,2747941

There is a field "time" followed by a field "target". The number in the field "time", 1231693144, is given in Unix format. So let's convert this number to the traditional Gregorian calendar format:

http://www.wolframalpha.com/input/?i=1231693144+unix+time

The first block of the Bitcoin network was accepted on Sunday, January 11, 2009, 4:59:04 pm UTC. The target to accept the block was:

26959535291011309493156476344723991336010898738574164086137773096960

This is a number with only 68 decimal digits. Now let's compare with the last computed target:

68962778243821519216393853205209897734463141354237780295680

It is a 59 decimal digit number. In other words, the last target is a number lower than the first target. That means that as lower the target becomes, greater is the difficulty to find a random hash which number is equal or lower than the target.

Now, to understand how the target is defined, let's examine the first block was accepted once the difficulty increase above 1:

Quote
32256,1262153464,22791060871177364286867400663010583169263383106957897897309909286912,24875298081094336890011938503867287252637140922766030991723841191936,1.18,5080592338,502,9272714

So, on Wednesday, December 30, 2009, 6:11:04 am UTC, the first block with difficulty above 1 was accepted by the network. At that time, difficulty was 1.18 and the target was:

22791060871177364286867400663010583169263383106957897897309909286912

Quote
2. Then it distributes this hash as new target

Correct, all clients distribute to each other the same target once it is recalculated.

Quote
3. Then miners try to find a number whose hash is equal to or less than target

Correct, the "miners" use their SHA-256 hash generators device to find the current target.

Never saw such clear explanation of bitcoin before. Beautiful!