I've tcpdump'ed a session with my miner and xmr pool (port difficulty 1063). My miner sent the pool this result:

{ "id":2, "jsonrpc":"2.0", "method":"submit", "params":{ "id":......, "job_id":......., "nonce":**"38000000"**, "result":**"1af55da342371e2f1aca3063bb478ebb0e1e004d7937dd1392687c1e7bf23b00"** } }

but here, the nonce and result hash are byte reversed. Why is it so? See (python):
get difficulty from resulted hash (which i copied from tpcdump session):
>>> ((2 ** 256) - 1) / int("1af55da342371e2f1aca3063bb478ebb0e1e004d7937dd1392687c1e7bf23b00", 16) **9.496091376910952**
For this hash we have difficulty 9, but port difficulty 1063. Try byte-reversing it:
>>> ((2 ** 256) - 1)/ int("003bf27b1e7c689213dd37794d001e0ebb8e47bb6330ca1a2f1e3742a35df51a", 16) **1093.2288693564817**
you get difficulty 1093. Good. Similarly for the nonce value.

I can't find any information about for how this workse? Can someone explain to me? Or is it STRATUM future?

up vote 2 down vote accepted

Computers are byte based, and can store numbers in little endian and big endian (and other more esoteric variants). The Intel architecture uses little endian, so 257 will be represented as ff02. Monero hashes are stored in little endian format. Python reads numbers in big endian format. Endianess in this case is the ordering of bytes when interpreting them as a number.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.