I’m trying to make a miner, but can’t quite figure stratum out - keep getting invalid solution replies.
Here is an example of the exchange: http://pastebin.com/MkdbstyX
The miner works just fine as stand-alone, both on mainnet and testnets, so i don’t expect any issues like sha256 endianness. Whatever is wrong, it’s in the stratum part.
I tried flipping the endianness of anything suspicious, including nonce_1 they sent, nonce i reply, time i reply, solution and so on.
Figured it out with some help on slack.
I was missing the size part of the solution - you should send it in script encoding, not just as-is.
Here is a more detailed doc that mentioned it: