Hello,
I have been reading over this thread:
and have been working on my own implementation of a miner.
I have come to the point of actually calculating the hashes for the compiled units of work received from the stratum server. I have tested my calculation engine against the “classic” rfc7693 calculation and result for “abc.” Everything checks out. I have also compiled and done a few checks against this implementation:
Things check out there as well, until I get to calculating the full hash on the 144-byte work (represented by the 288-byte string). At that point things seem to diverge, and I was wondering whether someone would be willing to check my results.
As a start, I need to ask one question. Am I correct in understanding that what I am processing will be the 144 bytes once the string is converted from hex to a byte array (i.e. the string “04000000” would be the bytes 0x04, 0x00, 0x00, 0x00)? Or am I supposed to process the string directly converted to bytes, in which case the previous example would become 0x30, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30? The second option wouldn’t seem likely to me as the specification calls for a 144 byte work segment, and that would produce a 288 byte segment. I just wanted to make sure, though.
Anyway, for this input:
040000007003225F30E1015EE14609B222E6036B7572963E18355688A966BB0E00000000E53B8DC142BBF69584F26B5F1D2125B79F238E77D04A37CDFAE64D3CFE9B2E730000000000000000000000000000000000000000000000000000000000000000C85BDA595DB6121C4FFFFFFF0500000000000000000000000000000000000000000000000000000000000000
I receive:
10a71c3968181c4feb7b615f2e11ca551b5d41abb2d09818a1b20d2a4e3760f9d13aed079ffe3b1bac2b69c09239b955b260
using the first method (converting to a 144-byte work chunk) or:
82b56b82381ec3efca8ce131e90320706a17f0587109e34fa84ee60d60bff3310f8125657ccdd750b1ffd3f8e9ff4397d943
parsing the string byte for byte.
Do either of these results look correct?
Thank you in advance.