Title: Calculating Difficulty from Getwork "Target" Value Post by: BinaryMage on April 02, 2013, 09:02:21 AM According to the wiki (https://en.bitcoin.it/wiki/Difficulty), difficulty can be calculated by dividing the maximum target by the current target.
However, I'm unclear on how exactly the target value returned from a getwork call is encoded (and more importantly, how it should be de-encoded to calculate difficulty using this method). Do I simply swap it to little-endian (and if so, how?), or is there a more complicated process? Example code (Python) using the current target: Code: >> target = "00000000000000000000000000000000000000000000006e8102000000000000" Any advice would be appreciated. Title: Re: Calculating Difficulty from Getwork "Target" Value Post by: BinaryMage on April 02, 2013, 09:25:16 AM Simply swapping to little-endian does the trick.
For reference: Code: >> target = "00000000000000000000000000000000000000000000006e8102000000000000" |