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:
using the first method (converting to a 144-byte work chunk) or:
parsing the string byte for byte.
Do either of these results look correct?
Thank you in advance.