3

If I generate too many, they go red for some reason. So what is the maximum amount of addresses that a seed can make?

Shamoon
  • 2,849
  • 3
  • 35
  • 52

1 Answers1

4

You don't need to worry about red addresses. Just remember roughly how many of those there were if you ever send money to one of them.

There is no practical limit of how many addresses Electrum can generate from a seed. To figure out, how much money you have in your wallet, Electrum needs to sum up the funds in your addresses sequence – of which I just said that it doesn't have a practical limit in the number of its elements. This causes a problem: When should Electrum stop checking for more money further down the address sequence? The solution is to introduce a gap limit g.

When Electrum sums up the money in the addresses, it has a counter c which is incremented every time an address has no recorded transactions and set to 0 every time it does. If c > g, Electrum stops.

By default, g is set to 20 since Electrum 2.0. Addresses beyond the gap limit are red. If money is sent to one of them but never to the g addresses before them, Electrum will not look for it.

The gap limit also determines how many unused addresses you're shown if you don't generate new ones.

UTF-8
  • 3,224
  • 1
  • 15
  • 29
  • Can I change the gap limit? – Shamoon Aug 16 '16 at 20:52
  • Sure. Just type wallet.storage.put('gap_limit',100) (or whatever value in the end) into the Electrum console. – UTF-8 Aug 16 '16 at 20:55
  • If I recover my Electrum wallet, I just need to remember that I may have money in addresses that are not listed, right? – Shamoon Aug 16 '16 at 20:58
  • No.You need to remember the number you set the gap limit to (more specifically:the size of the gap you caused which can also be done via creating addresses from the console) so you can set it to at least that value again. Bigger ones are also fine, just not smaller. Of course, if you set the gap limit to 100 now, use at least 80 of those 100 addresses, set the gap limit back to 20, (maybe use the wallet some more, doesn't matter) and then have to recover your wallet at some point, that's also fine without setting the gap limit to a higher value because then there can't be a gap better than 20. – UTF-8 Aug 16 '16 at 21:12
  • To clarify: You only need to set the gap limit higher when recovering if you actually used addresses with a gap of 20 or more addresses in-between. – UTF-8 Aug 16 '16 at 23:31
  • No practical limit? I have 10,000 addresses, so is that ok? Cause I'm randomly having issues sending from my wallet now and suspect that's the reason. – sudo Feb 11 '18 at 04:34
  • 1
    @sudo Unfortunately, I don't know whether there is a bug or some other problem which emerges when you have many addresses. For example, the server you're using might have a limit as to how many different addresses' balances you may request in a short period of time. I merely meant to state that there is no practical limit as to how many different addresses Electrum can generate from a single seed, not that there definitely are no complications when using many addresses. – UTF-8 Feb 11 '18 at 12:54
  • 1
    @sudo If you're using that many addresses, experience problems, and don't know why, you should probably inform the developers of Electrum. – UTF-8 Feb 11 '18 at 12:55
  • Thanks, I've informed them and given them an example failed transaction. In the meantime, I've sent everything I can to a new wallet. The issue seems to be with transactions with many inputs, which happens if I have many addresses with balances, and I was only able to send if it sent only from a few. This in 3.0.6 BTW. – sudo Feb 12 '18 at 02:04
  • Link to github issue @sudo ? – user5477 Mar 28 '18 at 01:08
  • @user5477 https://github.com/spesmilo/electrum/issues/3890 They had a concurrency bug. Not sure if it's fixed in the latest release, but should be. – sudo Mar 28 '18 at 07:51
  • Their example in the FAQ where they say to create new address in a loop was hitting a race condition. Whether that caused undesired behavior depended on how many you generated, hardware, OS, etc. So just update past 3.0.6 if you haven't already. – sudo Mar 28 '18 at 18:26