4

I see that there is a flag --generate-from-keys for monero-wallet-cli that requires an argument, so I tried the hexadecimal seed, which was the same as the private key I generated here https://xmr.llcoins.net/addresstests.html. (Maybe the argument is for the file name, but that is not clear from the --help documentation.)

After I enter the seed though, I am prompted monero-wallet-cli to provide other information, like the standard address, then the spend key, and then the view key! I thought that the hexadecimal key should be just as good as the mnemonic seed to recover all that information. Am I mistaken? And is there a way to do that in monero-wallet-cli at all?

Also, I wanted to test various things in testnet, but couldn't find an equivalent web page for generating addresses in testnet... Does anyone know one? EDIT: That is already implemented in the website provided above. Just use the toggle on the upper left corner to change Standard XMR --> XMR Testnet.

user141
  • 3,337
  • 14
  • 34

3 Answers3

4

The generate from keys switch requires the private spend key, view key, and public address in order to recreate the wallet. The first piece of info it requested was probably a filename to save to, not the seed. It is what you use when you have all the raw information, but not the seed.

It you want to restore from seed, you need to use the

--restore-deterministic-wallet

switch.

ferretinjapan
  • 6,494
  • 2
  • 20
  • 47
4

The argument is the filename to be used. It would be bad practice to enter the seed as an argument when starting the program, as your command shell could keep logs of recent commands which would then leave some record of your seed somewhere on your HDD. So, only the filename is provided as the starting argument, and all the other info (password, keys, address) is asked for by the program and typed directly into it.

It's important to understand that the --generate-from-keys can be used to restore literally anything. Fact is, it is possible to create a non-deterministic wallet where the 2 private keys (private spend and private view) are generated independently. In such case, to restore that kind of wallet, you need to have both of them, as the view key can't be derived from the spend key.

It's true that the address could be calculated from the keys, so we could consider that part redundant, but useful for error-checking considering addresses have a built-in checksum, and the keys do not.

I'd like to highlight that, on a protocol level, all you need are the 2 keys. The way to generate them from some seed is a convention, and you could come up with your own as well and it'll still work, provided that the keys generated satisfy some criteria.

With the above in mind, the program (for the particular argument --generate-from-keys) shouldn't assume that a certain convention was used. There is the --restore-deterministic-wallet to restore from the 25-word mnemonic. If you'd want to restore directly from the base16 seed, you would have to encode it to a mnemonic first by using some external tool like the one you provided the link to, and then use the command mentioned above to restore it.

JollyMort
  • 20,004
  • 3
  • 49
  • 105
1

Since all other keys emanate from the private spend key, you can simply enter your private spend key on the link you posted, generate the rest of the keys and enter them afterwards in monero-wallet-cli.

Edit: Assuming that you can verify that the page is not transmitting your keys to the server, just calculating them locally. Better download it and use it while not connected to the internet if you're unsure.

antanst
  • 609
  • 6
  • 8