After decoding the amount from ecdh amount, we get the numbers which is obvious not in decimal, e.g. "0010a5d4e8000000".

Then we can transfer them into integer with the following python code and get "1000000000000" which means 1.0 xmr:

def hexToInt(h):
    s = binascii.unhexlify(h) #does hex to bytes
    bb = len(h) * 4 #I guess 8 bits / b
    return sum(2**i * ed25519.bit(s,i) for i in range(0,bb)) #does to int

Therefore, I am curious about what the standard it follows?

1 Answer 1


It's just the hex of a little-endian byte-order encoded number (i.e. when swapped around you get 0xE8D4A51000).

Perhaps this will help you see:

import struct
import binascii
bin = binascii.unhexlify('0010a5d4e8000000')
print(struct.unpack('<Q', bin)[0])

unhexlify converts the hex to binary and the format specifier <Q used by unpack means unpack a 64 bit number which is stored little-endian byte-order.

MiniNero's hexToInt is just doing the same thing in a different way.


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.