Suppose I created and published
i=10 subaddresses from which
5 already received a payment.
After restoring my wallet from the 25-word seed, how would I know how many subaddresses were already generated?
How could I avoid giving out the same subaddress to two different individuals? Do I need to keep track of the amount of subaddresses generated to ensure to use the
i+1th subaddress after restoring from seed? (The same issue also applies to using the same wallet from multiple devices, the wallets somehow need to keep
i in syn)
An option to anonymously publish the number of generated subaddresses in the blockchain would be a nice feature to avoid reusing
i. This'd allow my wallet to know exactly with which
i to continue.
This could work as follows:
An optional transaction field (let's call it
hid) could be added which allows to store up to eg 8 byte of anonymous data. Whenever creating a new subaddress, a new transaction to myself is issued including the current value of
i (number of subaddresses) encrypted using a special format (or, prefix) in this field.
Upon sync (eg after restoring from a seed), my wallet checks the most recent transaction whose
hid field is not empty, decrypts its value, checks if it matches the special format (or, prefix) and immediately knows how many subaddresses were already generated.