<p><strong>If you have your wallet seed it is fine:</strong><br>
From what I understand, your coins are safe, they will not be lost as long as you have wallet seed. When reimporting, Electrum would just not look far enough to find everything, until you nudge it a bit.</p>

<p><strong>Explanation:</strong><br>
The gap limit gives the number of addresses that Electrum will generate from the seed starting from the last address that it found a balance on.</p>

<p>The error message tells you that Electrum wouldn't find some of your addresses by itself, because Electrum would think that it arrived at the end of your transaction history, before all your transaction history is discovered.</p>

<p><strong>Example to make it graphic:</strong> </p>

<ul>
<li>Gap limit = <strong>3</strong></li>
<li><strong>S</strong> is Seed</li>
<li><strong>I</strong> address with balance</li>
<li><strong>•</strong> address without balance.</li>
<li><strong>X</strong> address with balance beyond gap-limit</li>
</ul>

<p>An arbitrary transaction history:<br>
You have a balance on a few addresses, already spent/didn't use some addresses intermittently, and then you skipped a bunch (five here) for some reason before receiving balances on some more.</p>

<pre><code>SIIII•III••I•III•I•IIII•••••XXX
                       ^gap^
</code></pre>

<p>The gap of five is bigger than the currently set gap limit of three, so now, reimporting the seed, Electrum would only regenerate to:</p>

<pre><code>SIIII•III••I•III•I•IIII•••
    last used address ^ +3
</code></pre>

<p>Because it will only regenerate <code>gap-limit</code> unused addresses after an address with a balance.</p>

<p><strong>If you set the gap limit higher (in the example to six), or use the previously unused addresses that make up the gap, Electrum will rediscover the addresses.</strong></p>

<p>The imported wallet so far:</p>

<pre><code>SIIII•III••I•III•I•IIII•••
</code></pre>

<p>Receive 4 new transactions <strong>N</strong>:</p>

<pre><code>SIIII•III••I•III•I•IIIINNNN••XXX
                             ^ oh, that "new address" was used!
</code></pre>

<p>Recovery of all addresses with balances plus <code>gap-limit</code> new addresses:</p>

<pre><code>SIIII•III••I•III•I•IIIIIIII••III•••
</code></pre>

<p>Altogether, it shouldn't be much of a problem. Electrum should probably be able to safely store thousands of addresses, so unless you created a humongous gap, probably no need to think about any problems there.</p>

<p>So, what you might want to do, is figure out just how many addresses you have now generated from your wallet seed. If you then want to recover your wallet on another computer, just generate the same amount of addresses or temporarily increase the gap limit until you have the same number of addresses.</p>

CC BY-SA 3.0
2015-01-17T15:36:06.517Z
Thanks for that thorough answer. Do you know why the change was sent to an address beyond the gap-limit in the first place?
Miles Bardan
CC BY-SA 3.0
2015-01-17T15:58:56.990Z
@MilesBardan: I can only guess, but e.g. BitcoinCore treats addresses differently whether you requested them explicitly (i.e. as addresses to receive funds to), or they were generated to refill your pool of unused addresses. If Electrum behaves similarly, I would assume that one of the commands you used created such "visible" addresses, so Electrum would probably not send change to one of those, because they might already be known as yours to another party. So, if there was such a gap of "explicitly requested addresses" the change would flow to an unused address beyond the gap instead.
Murch
CC BY-SA 3.0
2015-01-17T02:18:57.070Z
2015-01-17T02:33:33.583Z
2015-01-17T02:33:33.583Z
Murch
<p>There is a lot of red highlighting in the 'Label' column of my online/watch-only Electrum client, including for addresses which contain considerable balances.</p>

<p>After trying to find out what this meant, I found out that it is something to do with the gap limit, and I read in the thread <a href="https://bitcointalk.org/index.php?topic=324614.msg3604887#msg3604887" rel="noreferrer">Electrum 1.9 released on BCT</a>: </p>

<blockquote>
  <p>"red means that the address is beyond the gap limit, so it will not be recovered if you restore from seed
  the red color will disappear once other (preceding) addresses receive coins."</p>
</blockquote>

<p>This makes me think, that if my hardware is damaged and I need to restore the wallet from seed, that I will lose the BTC which I have stored in those red-labelled addresses. I don't know why this would be, as I didn't think it worked that way, but I don't know enough about it to know, and this is coming from the lead developer.</p>

<ul>
<li>First, what exactly does it mean, that I have this red highlighting?</li>
<li>Second, should I be concerned about it, do I need to do anything about it?</li>
<li>Third, if I should do something about it, what should I do?</li>
</ul>

<p>Thanks.</p>

<p>Additional information: In the past, there was a time when I was signing a transaction with my offline wallet, and I did not have all the addresses generated which were involved with the transaction from the online wallet. Because of this, I used some command in the Electrum command-line interface of the offline wallet to generate new addresses, I think by increasing the gap limit possibly. In fact, I used the thread <a href="https://bitcointalk.org/index.php?topic=344115.msg3690179#msg3690179" rel="noreferrer">Offline send - can't send from change address</a> for guidance on how to do whatever it was I did:<br>
I used a mixture of those three commands, but in the end I think I did it mainly by using the command, <code>wallet.storage.put( 'gap_limit', 20 )</code>. I may have done this repeatedly, or with a large number, to make sure I definitely generated the addresses I was looking for; I don't know if this was excessive and may have caused problems.</p>

<p>Edit: I should probably add, that all of these red-highlighted addresses are change addresses.</p>

<electrum><address-generation><gap-limit>
What does it mean when addresses are labelled "beyond the gap limit (highlighted red)"?
Miles Bardan
# What does it mean when addresses are labelled "beyond the gap limit (highlighted red)"?

(Asked by: username_0 on 2015-01-17)

There is a lot of red highlighting in the 'Label' column of my online/watch-only Electrum client, including for addresses which contain considerable balances.

After trying to find out what this meant, I found out that it is something to do with the gap limit, and I read in the thread [Electrum 1.9 released on BCT](https://bitcointalk.org/index.php?topic=324614.msg3604887#msg3604887):

> "red means that the address is beyond the gap limit, so it will not be recovered if you restore from seed
> the red color will disappear once other (preceding) addresses receive coins."

This makes me think, that if my hardware is damaged and I need to restore the wallet from seed, that I will lose the BTC which I have stored in those red-labelled addresses. I don't know why this would be, as I didn't think it worked that way, but I don't know enough about it to know, and this is coming from the lead developer.

* First, what exactly does it mean, that I have this red highlighting?
* Second, should I be concerned about it, do I need to do anything about it?
* Third, if I should do something about it, what should I do?

Thanks.

Additional information: In the past, there was a time when I was signing a transaction with my offline wallet, and I did not have all the addresses generated which were involved with the transaction from the online wallet. Because of this, I used some command in the Electrum command-line interface of the offline wallet to generate new addresses, I think by increasing the gap limit possibly. In fact, I used the thread [Offline send - can't send from change address](https://bitcointalk.org/index.php?topic=344115.msg3690179#msg3690179) for guidance on how to do whatever it was I did:  
I used a mixture of those three commands, but in the end I think I did it mainly by using the command, `wallet.storage.put( 'gap_limit', 20 )`. I may have done this repeatedly, or with a large number, to make sure I definitely generated the addresses I was looking for; I don't know if this was excessive and may have caused problems.

Edit: I should probably add, that all of these red-highlighted addresses are change addresses.

**Tags:** electrum, address-generation, gap-limit


---

## 1 answers

### Answer by username_1 on 2015-01-17. Score: 6 | Accepted answer

**If you have your wallet seed it is fine:**  
From what I understand, your coins are safe, they will not be lost as long as you have wallet seed. When reimporting, Electrum would just not look far enough to find everything, until you nudge it a bit.

**Explanation:**  
The gap limit gives the number of addresses that Electrum will generate from the seed starting from the last address that it found a balance on.

The error message tells you that Electrum wouldn't find some of your addresses by itself, because Electrum would think that it arrived at the end of your transaction history, before all your transaction history is discovered.

**Example to make it graphic:**

* Gap limit = **3**
* **S** is Seed
* **I** address with balance
* **•** address without balance.
* **X** address with balance beyond gap-limit

An arbitrary transaction history:  
You have a balance on a few addresses, already spent/didn't use some addresses intermittently, and then you skipped a bunch (five here) for some reason before receiving balances on some more.

```
SIIII•III••I•III•I•IIII•••••XXX
                       ^gap^

```

The gap of five is bigger than the currently set gap limit of three, so now, reimporting the seed, Electrum would only regenerate to:

```
SIIII•III••I•III•I•IIII•••
    last used address ^ +3

```

Because it will only regenerate `gap-limit` unused addresses after an address with a balance.

**If you set the gap limit higher (in the example to six), or use the previously unused addresses that make up the gap, Electrum will rediscover the addresses.**

The imported wallet so far:

```
SIIII•III••I•III•I•IIII•••

```

Receive 4 new transactions **N**:

```
SIIII•III••I•III•I•IIIINNNN••XXX
                             ^ oh, that "new address" was used!

```

Recovery of all addresses with balances plus `gap-limit` new addresses:

```
SIIII•III••I•III•I•IIIIIIII••III•••

```

Altogether, it shouldn't be much of a problem. Electrum should probably be able to safely store thousands of addresses, so unless you created a humongous gap, probably no need to think about any problems there.

So, what you might want to do, is figure out just how many addresses you have now generated from your wallet seed. If you then want to recover your wallet on another computer, just generate the same amount of addresses or temporarily increase the gap limit until you have the same number of addresses.

> **Comments:**
> **username_0**: Thanks for that thorough answer. Do you know why the change was sent to an address beyond the gap-limit in the first place?  
> **username_1**: @username_0: I can only guess, but e.g. BitcoinCore treats addresses differently whether you requested them explicitly (i.e. as addresses to receive funds to), or they were generated to refill your pool of unused addresses. If Electrum behaves similarly, I would assume that one of the commands you used created such "visible" addresses, so Electrum would probably not send change to one of those, because they might already be known as yours to another party. So, if there was such a gap of "explicitly requested addresses" the change would flow to an unused address beyond the gap instead.  

---

