1

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?

1 Answer 1

3

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 02 ff. 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.

1
  • 02ff (little endian == starts with little)
    – qertoip
    Commented Nov 18, 2018 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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