Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: tkbx on October 24, 2013, 01:03:18 AM



Title: Difficulty and zeroes?
Post by: tkbx on October 24, 2013, 01:03:18 AM
If Bitcoin uses the number of preceding zeroes in a block (000000000000000a14da313e33fe2012b95c82ae03c58739888a440a845642f3) to set the difficulty, how is it possible for the difficulty to double or triple? Wouldn't it need to get 16 times harder because of an extra zero?


Title: Re: Difficulty and zeroes?
Post by: gmaxwell on October 24, 2013, 02:13:02 AM
If Bitcoin uses the number of preceding zeroes in a block (000000000000000a14da313e33fe2012b95c82ae03c58739888a440a845642f3) to set the difficulty, how is it possible for the difficulty to double or triple? Wouldn't it need to get 16 times harder because of an extra zero?
Perceptive. It doesn't.

Bitcoin doesn't use the number of zeros. Instead it converts the hash into a single big integer and requires that the value be less than a target value. The target value is adjusted every 2016 blocks as required to control the block rate and the "difficulty" number is just the ratio of the current hardness of the problem to the initial hardness.


Title: Re: Difficulty and zeroes?
Post by: Dabs on October 24, 2013, 04:59:29 AM
Okay. So bitcoin does not use zeros. I thought it used zeros in binary or something. Therefore, difficulty can be any number between zero and 2^256. It's not from 1 zero to 256 zeros in 256 bits.


Title: Re: Difficulty and zeroes?
Post by: gmaxwell on October 24, 2013, 06:45:16 AM
Okay. So bitcoin does not use zeros. I thought it used zeros in binary or something.
No, if it did that difficulty could only change by factors of 2.


Title: Re: Difficulty and zeroes?
Post by: Dabs on October 24, 2013, 07:39:00 AM
I get it now. Difficulty is currently at around 267731249.48242110, but this is derived from a 256 bit number. So the small numbers actually mean something.