Bitcoin Forum
April 24, 2024, 01:00:14 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does bitcoin finely change the difficulty target..?  (Read 1127 times)
spazzdla (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1000


View Profile
July 13, 2015, 06:57:03 PM
 #1

I have done some reading into mining, it seems the difficulty is based on finding a hash that has X amount of zeros at the start.  If this is the case can't the difficulty really only be changed by rather largely up or down..?

Find a hash with 17 zeros at the start vs 16 is a large difficulty jump, how does the difficulty only change a bit?
1713963614
Hero Member
*
Offline Offline

Posts: 1713963614

View Profile Personal Message (Offline)

Ignore
1713963614
Reply with quote  #2

1713963614
Report to moderator
1713963614
Hero Member
*
Offline Offline

Posts: 1713963614

View Profile Personal Message (Offline)

Ignore
1713963614
Reply with quote  #2

1713963614
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713963614
Hero Member
*
Offline Offline

Posts: 1713963614

View Profile Personal Message (Offline)

Ignore
1713963614
Reply with quote  #2

1713963614
Report to moderator
1713963614
Hero Member
*
Offline Offline

Posts: 1713963614

View Profile Personal Message (Offline)

Ignore
1713963614
Reply with quote  #2

1713963614
Report to moderator
1713963614
Hero Member
*
Offline Offline

Posts: 1713963614

View Profile Personal Message (Offline)

Ignore
1713963614
Reply with quote  #2

1713963614
Report to moderator
domob
Legendary
*
Offline Offline

Activity: 1135
Merit: 1161


View Profile WWW
July 13, 2015, 07:26:32 PM
 #2

The notion with "zeros at the beginning" is clear to understand and thus often used in explanations, but not fully correct.  The actual condition is "hash below a certain target value".  In this way, the difficulty (usually expressed as 1/target) can be changed almost arbitrarily and with more gradual steps than just doubling/halving.

Use your Namecoin identity as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS | GPG 0xA7330737
spazzdla (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1000


View Profile
July 13, 2015, 07:46:09 PM
 #3

The notion with "zeros at the beginning" is clear to understand and thus often used in explanations, but not fully correct.  The actual condition is "hash below a certain target value".  In this way, the difficulty (usually expressed as 1/target) can be changed almost arbitrarily and with more gradual steps than just doubling/halving.


AHHH, can you go into that a little more, what do you mean by under a certian target?


TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
July 13, 2015, 11:16:01 PM
 #4

AHHH, can you go into that a little more, what do you mean by under a certian target?

Imagine that the hash picks a number between 0 and 999,999.

You could say that the difficulty is to count the number of leading zeros.

One zero means you have to get 99,999 or lower (099999 or lower).  That is one in 10 (difficulty 10).

Two zeros means you have to get 9,999 or lower (009999 or lower).  That is one in 100 (difficulty 100) and so on.

You could alternatively just use a threshold.  For a difficulty of 63, you use 1,000,000 / 63 = 15,873.

You don't say that you need 1 zero, you say the number must be 15,873 or lower.  That gives a 1 in 63 chance, so a difficulty of 63.

With the actual hash, it picks a number between 0 and (2256 - 1).   The difficulty is also divided by 232.  A difficulty of 1 means that you have a 1 in 232 chance of a hash being less than the threshold.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Mikestang
Legendary
*
Offline Offline

Activity: 1274
Merit: 1000



View Profile
July 14, 2015, 02:53:30 AM
 #5

I have done some reading into mining, it seems the difficulty is based on finding a hash that has X amount of zeros at the start.  If this is the case can't the difficulty really only be changed by rather largely up or down..?

Find a hash with 17 zeros at the start vs 16 is a large difficulty jump, how does the difficulty only change a bit?

Because there are 57 places in the hexidecimal difficulty, and each place has a value 0-9 a-z A-Z that represents and incremental change, so the difficulty can be expressed very precisely.

Check out the wiki on difficulty: https://en.bitcoin.it/wiki/Difficulty
spazzdla (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1000


View Profile
July 15, 2015, 03:36:40 PM
 #6

AHHH, can you go into that a little more, what do you mean by under a certian target?

Imagine that the hash picks a number between 0 and 999,999.

You could say that the difficulty is to count the number of leading zeros.

One zero means you have to get 99,999 or lower (099999 or lower).  That is one in 10 (difficulty 10).

Two zeros means you have to get 9,999 or lower (009999 or lower).  That is one in 100 (difficulty 100) and so on.

You could alternatively just use a threshold.  For a difficulty of 63, you use 1,000,000 / 63 = 15,873.

You don't say that you need 1 zero, you say the number must be 15,873 or lower.  That gives a 1 in 63 chance, so a difficulty of 63.

With the actual hash, it picks a number between 0 and (2256 - 1).   The difficulty is also divided by 232.  A difficulty of 1 means that you have a 1 in 232 chance of a hash being less than the threshold.


OOOH, I think I kind of get it..

so FFFFFFFFFFFF .... = 1.16 x 10 ^ 77

0000000000 ... 1 = 1 (good luck)

0000000000000******** = 1 x 10 ^22 (for eg)

find a number smaller than 1 x 10 ^ 22

I thinks I get it?
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
July 15, 2015, 05:49:46 PM
 #7

find a number smaller than 1 x 10 ^ 22

I thinks I get it?

Yes.  

The target is a floating point number though, A * 256b.  

A is 3 bytes so gives reasonable accuracy.  The b value is 1 byte, so can easily go up to 2256.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!