7

Suppose I set up a wallet with a deterministic seed passphrase. I then use it, moving bitcoins around, sending some change to change addresses. Electrum will apparently create more addresses when required; suppose it does so.

I later on 'restore' the wallet on a new Electrum install by entering the existing seed. How does Electrum know how many addresses to create? It may be the case that the original 8 addresses are now empty (0 BTC), and my btc are in addresses created later on. How does Electrum know how many deterministic addresses to create in order to see all of my existing btc?

One possible technique I can imagine: Electrum looks at the blockchain for the first addresses in the wallet. If it sees traffic to those addresses, it knows to keep trying more of the deterministic addresses until it sees no more traffic, at which point it stops generating addresses in your wallet.

3

Electrum uses a gap limit to stop looking for addresses in the deterministic wallet. The default gap limit is set to 20, so the client get all addresses until 20 unused addresses are found.

Change addresses have a gap limit of 3 and this is not modifiable by the user.

  • Thanks. Am I correct in thinking then that there's no way to "miss" previously used addresses that contain btc? When you say "unused address" do you mean "address does not appear in blockchain"? – occulus Nov 18 '13 at 17:54
  • Exactly, addresses that have not transactions, are unused addresses. There are situations where you can have addresses that are out of the gap limit like: having the same wallet in different computers with different gap limits set, using the MPK to generate addresses for a website, or generate a new address using the Console tab. In that case there are things that can be done, but too long to be explained in this comment. – rdymac Nov 18 '13 at 23:52
  • Thanks for clarifying. Are those "things that can be done" detailed anywhere else? – occulus Nov 19 '13 at 13:05
  • All over the forums and IRC chat history. I'll start the FAQs page somewhen this week, I wish. – rdymac Nov 19 '13 at 19:35
1

Seed is linked to master wallet which is linked to spendable address imho. I'd like to be proven wrong if so. I believe your technique could be right if the addresses are determined to be sourced from Electrum.

Taken from this page here: Key pool in wallet softwares

Being deterministic lets Electrum recover your entire wallet addresses from your seed, so you don't need to backup your wallet file every time you make a transaction. shareeditflag edited Oct 26 at 13:01 answered Oct 26 at 11:08 rdymac 4947

  • I agree with you re: your first sentence. But it's doesn't answer the question of "do the correct amount of addresses get created, and if so, how?". – occulus Nov 18 '13 at 13:32
  • From my question: "How does Electrum know how many addresses to create?" It is this detail that concerns me. I know that Electrum recreates "your entire wallet addresses". – occulus Nov 18 '13 at 14:38

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.