Default share difficulty is 1 (big-endian target for difficulty 1 is 0x00000000ffff0000000000000000000000000000000000000000000000000000)
How to calculate this?
How it look like on Java code?
What algorithm of calculate this value?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityDefault share difficulty is 1 (big-endian target for difficulty 1 is 0x00000000ffff0000000000000000000000000000000000000000000000000000)
How to calculate this?
How it look like on Java code?
What algorithm of calculate this value?
The difficulty is a part of the block header called "bits". It is the 72nd to 75th bytes of the block header and looks like this in hex:
bits = 0x76270618
Remember this is little-endian! Actual big-endian version is 0x18062776 Take the first byte as the “exponent” and the other three bytes as the “coefficient”
Exponent = 0x18 = 24
Coefficient = 0x062776
Plug into this formula:
Coefficient * 2**(8*(Exponent - 3)) = 0x0000000000000000062776000000000000000000000000000000000000000000
And that's how you can calculate difficulty from bits.