Author

Topic: This artical needs fixing on the bitcoin wiki (Read 824 times)

member
Activity: 65
Merit: 10
What makes you think that this procedure returns the current difficulty?  The page says pretty clearly that it returns the average number of hashes required to solve a block.

Or are you just forgetting to divide by 232 to convert hashes to difficulty?

Because this page defined difficulty as max target/current target

https://en.bitcoin.it/wiki/Difficulty
kjj
legendary
Activity: 1302
Merit: 1026
What makes you think that this procedure returns the current difficulty?  The page says pretty clearly that it returns the average number of hashes required to solve a block.

Or are you just forgetting to divide by 232 to convert hashes to difficulty?
member
Activity: 65
Merit: 10
https://en.bitcoin.it/wiki/Generation_Calculator

  • Get the current target.
  • Divide by 115792089237316195423570985008687907853269984665640564039457584007913129639935, which is the maximum value of a 256-bit number. You now have the probability of a single hash solving a block
  • Take the reciprocal of the probability to get the average number of hashes to solve a block.
  • Divide the average number of hashes by your hash/s (not khash/s) to get the average number of seconds required to solve a block.

***(I HAD AN ISSUE WITH THESE INSTRUCTIONS because the current target is not a decimal number)
*** we need a step to convert the hexadecimal target to a decimal number
*** the target might not even be a hexadecimal value because when i converted it, and did the math I didnt get the current difficulty


When looking at steps 1-3 they say:

Step 1 is get current target
Step 2 is divided current target by max target
Step 3 is take reciprocal

Why not say:

Step 1 - get max target.  Also, instead of writing out that number write out 2^256 for brevity.
Step 2 - get current target.  
Step 3 - convert the current target from hexadec to decimal.
Step 4  - divide step 1 by step 2 (max target/current target), which is equivalent to the average number of hashes needed to solve a block and is also the current difficulty.
Step 5 - Divide the average number of hashes by your hash/s (not khash/s) to get the average number of seconds required to solve a block.

(Additional Info) - The recipricol of step 4 is the probability of a single hash solving a block



Jump to: