3

I am trying to build an exercise. I want to produce a random 256-bit seed to give as an input for creating a Monero stealth address.

1) What are the restrictions on this seed in practice? I know it must be a legitimate scalar, but is that satisfied by it being 256-bit length? Can it be any random 256-bit number? If not, is there a javascript library for that calculation?

2) I have to write this exercise's grading program in nodejs (it is part of a bigger project). Does anyone know where I can find a javascript library that supports the needed calculations? (e.g. keccak, bytes_to_words, words_to_bytes, sc_reduce32, private_key_to_public_key).

For reference, the process for the calculation of a Monero stealth address is explained here very well.

jtgrassie
  • 19,111
  • 4
  • 14
  • 51
fallen_angel
  • 105
  • 4

1 Answers1

2

1) Private keys are a randomly chosen 256-bit number mod l. l being 2^252 + 27742317777372353535851937790883648493.

2) All the functions needed are in the source files of the site linked in the questions answer you linked to. Just use your browser debugger to access them.

jtgrassie
  • 19,111
  • 4
  • 14
  • 51