1

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?

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.