I'm trying to understand the basics of mining and have a very specific question about hashing a blob. When I start a miner and capture the packets, I get a job from the pool and then the work submitted by the miner.
Job recieved from the pool:
{
"jsonrpc": "2.0",
"result": {
"job": {
"blob": "0b0befdeecee051358860383d8e14f3529859e0c2f64c31a631addef3f9ca97eedcc738324fbd9000000009e18d5ad6a814f39bb79c9558f292aea7101e154c114e57c2205732d2e8b7eca02",
"target": "37894100",
"job_id": "8241143554386990819",
"time_to_live": 5,
"height": 1974336,
"algo": "cn/r"
},
"status": "OK",
"id": "1177745781301023725"
},
"id": 1,
"error": null
}
I think that I have classified these right, if not please correct me:
- Versions: 0b0b
- Timestamp: efdeecee05
- Prev Id: 1358860383d8e14f3529859e0c2f64c31a631addef3f9ca97eedcc738324fbd9
- Nonce: 00000000
- Transactions Tree Root: 9e18d5ad6a814f39bb79c9558f292aea7101e154c114e57c2205732d2e8b7eca
- Transaction Count: 02
- Hashing blob: 0b0befdeecee051358860383d8e14f3529859e0c2f64c31a631addef3f9ca97eedcc738324fbd9000000009e18d5ad6a814f39bb79c9558f292aea7101e154c114e57c2205732d2e8b7eca02
Share that the pool accepted:
{
"id": 2,
"jsonrpc": "2.0",
"method": "submit",
"params": {
"id": "1177745781301023725",
"job_id": "8241143554386990819",
"nonce": "41000000",
"result": "78aeeba968470a2b000c42e46ce60e3e422efbd2fb58fa275384855cd8131d00"
}
}
My question boils down to: Where in the blob 0b0befdeecee051358860383d8e14f3529859e0c2f64c31a631addef3f9ca97eedcc738324fbd9000000009e18d5ad6a814f39bb79c9558f292aea7101e154c114e57c2205732d2e8b7eca02 do I need to insert the nonce 41000000 to get the result 78aeeba968470a2b000c42e46ce60e3e422efbd2fb58fa275384855cd8131d00 after feeding the blob through the CryptoNight hashing algorithm?
If my understanding is correct, I need to replace the bytes 00000000 with the 41000000 found nonce, but when I do that, the resulting hash is different from the miner submitted hash.
I'm using a C implementation of CryptoNight and I'm checking the results with an online implementation that I found here.