<p>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.</p>

<p>Taken from this page here: <a href="https://bitcoin.stackexchange.com/questions/14069/key-pool-in-wallet-softwares">Key pool in wallet softwares</a></p>

<blockquote>
  <p>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</p>
</blockquote>

CC BY-SA 3.0
2013-11-18T13:32:20.697Z
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
CC BY-SA 3.0
2013-11-18T14:38:36.350Z
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
CC BY-SA 3.0
2013-11-18T13:25:19.380Z
2013-11-18T14:10:07.917Z
2017-04-13T12:47:33.743Z
Frankenmint
<p>Electrum uses a gap limit to stop looking for addresses in the deterministic wallet. The <a href="http://docs.electrum.org/en/latest/faq.html#what-is-the-gap-limit" rel="nofollow noreferrer">default gap limit is set to 20</a>, so the client get all addresses until 20 unused addresses are found.</p>

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

CC BY-SA 3.0
2013-11-18T17:54:27.877Z
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
CC BY-SA 3.0
2013-11-18T23:52:48.540Z
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
CC BY-SA 3.0
2013-11-19T13:05:04.360Z
Thanks for clarifying. Are those "things that can be done" detailed anywhere else?
occulus
CC BY-SA 3.0
2013-11-19T19:35:32.190Z
All over the forums and IRC chat history. I'll start the FAQs page somewhen this week, I wish.
rdymac
CC BY-SA 3.0
2013-11-18T16:50:19.227Z
2017-05-18T18:49:34.870Z
2017-05-18T18:49:34.870Z
rdymac
<p>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.</p>

<p>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?</p>

<p><strong>One possible technique I can imagine:</strong> 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.</p>

<wallet><client><electrum><seed><deterministic-wallets>
Electrum: "restoring" a wallet from a seed
occulus
# Electrum: "restoring" a wallet from a seed

(Asked by: username_0 on 2013-11-18)

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.

**Tags:** wallet, client, electrum, seed, deterministic-wallets


---

## 2 answers

### Answer by username_2 on 2013-11-18. Score: 3 | Accepted answer

Electrum uses a gap limit to stop looking for addresses in the deterministic wallet. The [default gap limit is set to 20](http://docs.electrum.org/en/latest/faq.html#what-is-the-gap-limit), 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.

> **Comments:**
> **username_0**: 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"?  
> **username_2**: 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.  
> **username_0**: Thanks for clarifying. Are those "things that can be done" detailed anywhere else?  
> **username_2**: All over the forums and IRC chat history. I'll start the FAQs page somewhen this week, I wish.  

---

### Answer by username_1 on 2013-11-18. Score: 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](https://bitcoin.stackexchange.com/questions/14069/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
> username_2
> 4947

> **Comments:**
> **username_0**: 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?".  
> **username_0**: 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".  

---

