I'm writing my own proxy pool implementation. I have problem with share verification.
I received a job from upsteam mining pool:
job={ "blob": "0c0ccdb490f2053f393023bdc102f7bf4c63be5c64569dc0b57ab94e9881fd66157995b679adc700000000767cb11fc62b2bde9fb8eae21058d99ad317482bfdbcc1956d766888dd4d475709", "job_id": "333", "target": "dc460300", "seed_hash": "154eb7a21cd32a597f985644187297607bad491650091620550877239c4178e1", "next_seed_hash": "", "height": 2032062 } Sent this work to the miner. And miner submitted work with following result:
share={ 'id': '1', 'job_id': '333', 'nonce': '38870000', 'result': 'f54a858a87f0f5bc9f3e75fba670a11cfdaf87b650d4189f50601597c8650200' } I want verify if the solution is correct. I'm using python and pyrx. The steps that I take to complete the verification:
Insert share['nonce'] from miner into job['blob'] to 39...43 bytes:
0c0ccdb490f2053f393023bdc102f7bf4c63be5c64569dc0b57ab94e9881fd66157995b679adc7*00000000*767cb11fc62b2bde9fb8eae21058d99ad317482bfdbcc1956d766888dd4d475709
0c0ccdb490f2053f393023bdc102f7bf4c63be5c64569dc0b57ab94e9881fd66157995b679adc7*38870000*767cb11fc62b2bde9fb8eae21058d99ad317482bfdbcc1956d766888dd4d475709
Hash this blob:
In [24]: blob = '0c0ccdb490f2053f393023bdc102f7bf4c63be5c64569dc0b57ab94e9881fd66157995b679adc738870000767cb11fc62b2bde9fb8eae21058d99ad317482bfdbcc1956d766888dd4d475709' In [25]: hashing_blob = pyrx.get_rx_hash(blob, job['seed_hash'], job['height']).hex() But I got unequal results with share['result']. I am sure that the answer is correct. The original pool accepted this work. Where am i wrong?
In [37]: hashing_blob == share['result'] Out[37]: False In [38]: hashing_blob Out[38]: '4fa368b991c8320c9c2ad1b80566f67439e789b329e0c33119b072aa7f2782e9' In [39]: share['result'] Out[39]: 'f54a858a87f0f5bc9f3e75fba670a11cfdaf87b650d4189f50601597c8650200'