1

Is there a way to pre-generate 1000 subaddresses from your monero private key? And then say I sent some xmr to the 979th subaddress, would the wallet see it or do I need to do something first?

2

I made an offline command-line tool, subaddress-derive-xmr, that derives any number of subaddresses from mnemonic, seed, or priv-view-key + pub-spend-key.

Usage would look like:

$ ./subaddress-derive-xmr --seed="66dcbb7490ee34dad1b04fa316b90ba1795ce70586298e2cc09455de1ae95273" -g --numderive=3

+-------------+-------------+-------------------------------------------------------------------------------------------------+
| major_index | minor_index | address                                                                                         |
+-------------+-------------+-------------------------------------------------------------------------------------------------+
|           0 |           0 | 49zf2PF7nLSHpRwWcPG8ePHxYnR6eFmYuKG8Akpq5vFALTzZzMdv3kC36fCSP3UfFdMrY51QAs5NGiGuwXK6YMa3Nk7549x |
|           0 |           1 | 87i7kA61fNvMboXiYWHVygPAggKJPETFqLXXcdH4mQTrECvrTxZMtt6e6owj1k8jUVjNR11eBuBMWHFBtxAwEVcm9dcSUxr |
|           0 |           2 | 8A9XmWsATrhfedtNhTMNKELwfCwMVAk2iVTdUJdFRb2AC4tV4VeBjsCLYR9cSQTwnvLo4MAuQFMLP6Si4xp6t6BS788db3t |
+-------------+-------------+-------------------------------------------------------------------------------------------------+

Just change to --numderive=1000 for 1000 addresses.

See usage docs for how to derive using mnemonic or view+spend keys or to change formatting of results.

  • How does one prove you don't have the seed to all those addresses? An offline computer isn't going to work. Just curious... – Patoshi パトシ yesterday
  • To be certain, one would have to review the code to one's own satisfaction. I can tell you that the code I use for generating the seed and performing the derivations is from the monerophp library by the monero-integrations project, which I understand has earned considerable trust/rep in the monero community. However I would very much welcome a code review/audit by a 3rd party. – danda 17 hours ago
3

Is there a way to pre-generate 1000 subaddresses from your monero private key?

Generating subaddresses from a private view key explained in this answer and on the monerodocs site here.

And then say I sent some xmr to the 979th subaddress, would the wallet see it or do I need to do something first?

The default wallet lookahead indices are set to 50:200 (50 accounts, 200 subaddresses). So if you are creating the subaddresses outside of the wallet (so manually constructing them from the wallet private view key), you will need to tell the wallet about them. You can do this in the monero-wallet-cli via the set command: set subaddress-lookahead 50:1000

  • The docs give the math and functions on how to generate it yourself, but isn't there just a simple command on the monero-cli to just output X number of subaddressses? – Patoshi パトシ Aug 18 at 14:55
  • Apologies I read the question as wanting to do this outside of the wallet (as you mentioned "private key"). There isn't a batch address new. You could easily script the cli though to run address new 1000 times. There are other answers on how to script the cli. If you script address new, you won't need to set the lookahead. – jtgrassie Aug 18 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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