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

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

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

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

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

CC BY-SA 3.0
2016-08-16T20:52:17.433Z
Can I change the gap limit?
Shamoon
CC BY-SA 3.0
2016-08-16T20:55:03.610Z
Sure. Just type `wallet.storage.put('gap_limit',100)` (or whatever value in the end) into the Electrum console.
UTF-8
CC BY-SA 3.0
2016-08-16T20:58:09.260Z
If I recover my Electrum wallet, I just need to remember that I may have money in addresses that are not listed, right?
Shamoon
CC BY-SA 3.0
2016-08-16T21:12:26.047Z
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
CC BY-SA 3.0
2016-08-16T23:31:28.137Z
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
CC BY-SA 3.0
2018-02-11T04:34:31.277Z
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
CC BY-SA 3.0
2018-02-11T12:54:06.820Z
@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
CC BY-SA 3.0
2018-02-11T12:55:29.917Z
@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
CC BY-SA 3.0
2018-02-12T02:04:37.117Z
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
CC BY-SA 3.0
2018-03-28T01:08:42.940Z
Link to github issue @sudo ?
user5477
CC BY-SA 3.0
2018-03-28T07:51:09.073Z
@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
CC BY-SA 3.0
2018-03-28T18:26:02.987Z
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
CC BY-SA 3.0
2016-08-16T17:39:18.507Z
2018-01-03T20:03:37.453Z
2018-01-03T20:03:37.453Z
UTF-8
<p>If I generate too many, they go <code>red</code> for some reason. So what is the maximum amount of addresses that a seed can make?</p>

<electrum>
How many addresses can an Electrum Seed generate?
Shamoon
# How many addresses can an Electrum Seed generate?

(Asked by: username_0 on 2016-08-16)

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

**Tags:** electrum


---

## 1 answers

### Answer by username_1 on 2016-08-16. Score: 4 | Accepted answer

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.

> **Comments:**
> **username_0**: Can I change the gap limit?  
> **username_1**: Sure. Just type `wallet.storage.put('gap_limit',100)` (or whatever value in the end) into the Electrum console.  
> **username_0**: If I recover my Electrum wallet, I just need to remember that I may have money in addresses that are not listed, right?  
> **username_1**: 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.  
> **username_1**: 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.  
> **username_2**: 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.  
> **username_1**: @username_2 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.  
> **username_1**: @username_2 If you're using that many addresses, experience problems, and don't know why, you should probably inform the developers of Electrum.  
> **username_2**: 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.  
> **username_3**: Link to github issue @username_2 ?  
> **username_2**: @username_3 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.  
> **username_2**: 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.  

---

