1

I implemented my own private (seed) spend and view key generator for learning purposes but I still don't fully understand. I ended up with a working implementation but I feel that I'm just swapping bytes for the sake of just doing it.

Is the 256-bit hex key that any wallet generates in Little or Big Endian format?

e.g.,

We got this private spend key.

f88c99d397c63ff261129a05ed678050ff6920efaddcb519dd82d18ed709f30b

If I want to convert it to an integer what would be its value?

1.124^77 or 5.40^77

1
  • 1
    "that any wallet" is not really answerable, how a particular wallet decides to encode keys is down to the wallet implementation. "We got this private spend key" from where did you get it?
    – jtgrassie
    Feb 22, 2022 at 14:59

1 Answer 1

2

Is the 256-bit hex key that any wallet generates in Little or Big Endian format?

How a particular wallet exports/displays a key is really implementation specific, but for official Monero code/wallets you'll see the keys in little endian byte order.

We got this private spend key.

f88c99d397c63ff261129a05ed678050ff6920efaddcb519dd82d18ed709f30b

If I want to convert it to an integer what would be its value?

Assuming you got that from some Monero code, it would be:

5404853098303265536527757675112388573511587645507532015181545700776929234168

(or with lost precision 5.40485e75)

2
  • Yes, I got the address from a Monero Key generator online. Now I think it makes sense, whenever we are dealing with a integer of 256 bits, either in hex or binary, we can assume that the scalar is in little-endian format.
    – 3af2
    Feb 22, 2022 at 21:27
  • 1
    I wouldn't assume anything when using some random online tool. But for official Monero code/wallets, it will be displayed in LE order.
    – jtgrassie
    Feb 22, 2022 at 22:03

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.