I remember some where was table and python scrypt for do this , when reinstall my debian i was lose this script.

Example we hv uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); what is = 0x1d00ffff

1 Answer 1


The formula for the conversion can be found on the bitcoin wiki.

Essentially, the first byte indicates the number of trailing 0 bytes (minus 3 for some reason). The remaining 3 bytes are the next 3 bytes of the target.

So 0x1d00fffff has 0x00ffff followed by 0x1d - 3 = 26 trailing 0 bytes with the whole thing padded out to 32 bytes. So the final result is 0x00000000ffff00000000000000000000000000000000000000000000000000000.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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