4

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:

"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 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.

5

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.

  • 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 Jan 17 '15 at 15:36
  • @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 Jan 17 '15 at 15:58

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.