One seed, one wallet

2 minute read

It is very common to find questions about if it is possible to use the same seed on two (or more) different wallets. Yes, it is possible but not the best thing to do. Most of the answers found online are “yes, sure!”, “no problem” and other positive sentences. But it is not quite like that.

1. How does it work?

When the user generates a new receiving address (E1), the wallet W1 takes his public key into a KDF (Key Derivation Function) and generates a new address for the user. The user receives a payment in this address E1. Wallet W2 is turned off and doesn’t know this transaction.

When wallet W2 is turned on, it downloads the new blocks and verifies if in these blocks exist transactions for its previously generated addresses (E0 so far, known in both wallets and not shown in the next figure). If the user decides to create a receiving address (E1) in this wallet W2, the wallet will take the public key into a KDF and the address (E1) will be generated. The address E1 is generated because wallet W2 hasn’t used this address yet and doesn’t know it has already been used by wallet W1. Wallet W2 then writes the block number when this address was generated. In the example from figure 1 it would be block #200107. This way it would never search previous blocks starting from #200106 for that address E1.

Figure 1 - Using the same seed on different wallets
Figure 1 - Using the same seed on different wallets

Reference: https://docs.decred.org/faq/wallets-and-seeds/

1.1. How does the wallets generate the same addresses?

Address generation is deterministic, not random. In a very simple explanation, KDF takes the user’s public key and an incremental number written in the wallet file. Because the public key is generated from the private key (seed), all the user needs to know is the seed. The wallet can generate all keys from the point where the seed is entered, no matter the device, because there is no randomness.

2. Recommendation

One should always use one seed per wallet. Using the same seed on two wallets implies in having to scan the blockchain from time to time to search for the addresses generated in only one of the wallets.

Create an strategy to store your resources:

  • Resources that will not be used in the short term (think of a safe)
  • Resources that may be necessary to pay bills and make purchases (from one to a few times a week)
  • Resources for small purchases, like a coffee or a book, that may be stored in a mobile wallet for daily usage.