Bitcoin Forum
October 13, 2025, 08:48:23 AM *
News: Latest Bitcoin Core release: 29.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why are my newly generated addresses showing as red in Electrum?  (Read 71 times)
jedlee (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 5


View Profile
October 10, 2025, 02:22:08 AM
 #1

Hi everyone,

I’m using Electrum 4.6.1 (Windows 10).
I manually generated about 1000 receiving addresses by running this command in the console:

[wallet.create_new_address(False) for i in range(1000)]

However, after that, many of those new addresses appear red in the “Addresses” tab,
even though they have never been used on the blockchain and have zero balance / zero transactions.

It looks like Electrum marked them as “used”, but they are actually new addresses that I just created manually.

https://i.postimg.cc/DJ6GDhps/8cf0dce9-dd51-4815-924e-d36bbab84945.png

Could someone please explain:

Why are these addresses shown in red?

How can I make them appear as normal (green) again?

Is there a way to safely generate many addresses via script without triggering the “used” color?

Thanks in advance for your help!
retaur
Newbie
*
Offline Offline

Activity: 14
Merit: 7


View Profile
October 10, 2025, 02:30:17 AM
Merited by Pmalek (3)
 #2

It's because they exist beyond the gap limit.

To fix it, go back to the console and run this:
Code:
wallet.change_gap_limit(1020)  

The gap limit is essentially how much of a "gap" there is before electrum decides it doesn't need to generate new addresses from the first unused one onwards.

Replace 1020 with the number of addresses in your wallet. The screenshot is too hard to work out, it looks like it's closer to 1025 or 1030.
Cookdata
Legendary
*
Online Online

Activity: 1456
Merit: 1092


Not Your Keys, Not Your Bitcoin


View Profile
October 10, 2025, 03:20:14 AM
Merited by Pmalek (3), Mia Chloe (2), Charles-Tim (1)
 #3

Could someone please explain:

Why are these addresses shown in red?



The size of your image is too blur, I downloaded the image and uploaded it to Talkimg for better view.

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.

Here is what I found from an old thread, you have exceeded the gap limit, those wallet address are going to disappear if eventually you delete the wallet and try to restore back the wallet. If you deposit Bitcoin to any of the Bitcoin address marked in red, you may have to generate back the wallet address by increasing the gap limit to be able to see the balance.

Quote
How can I make them appear as normal (green) again?

Is there a way to safely generate many addresses via script without triggering the “used” color?

Thanks in advance for your help!

Increase the gap limit to 1057, the red should disappear. I'm not sure if there is a script that can tell electrum to increase the gap limit when you exceed the gap limit, you have to increase the gap limit to avoid that color.


███████▄▄███▄███▄
███▄▄████████▌██
▄█████████████▐██▌
██▄███████████▌█▌
███████▀██████▐▌█
██████████████▌▌▐
████████▄███████▐▐
█████████████████
███████████████▄██▄
██████████████▀▀▀
█████▀███▀▀▀

▄▄▄██████▄▄▄███████▄▄▄
███████████████████████████
███▌█████▀███▌█████▀▀███████████▄▄▄▄▄▄▄▄
███▌█████▄███▌█████▄███▐███████████████████▄
▐████████████▀███████▄██████████▀▀▀▀▀▀▀▀████▀
▐████████████▄██▄███████████▌█████████▄████▀
▐█████████▀█████████▌█████████████▄▄████▀
██████████▄███████████▐███▌██▄██████▀
██████████████▀███▐███▌██████████████████████
████▀██████▀▀█████████▌███▀▀▀▀███▀▀▀▀▀▀▀████▌
 
      P R E M I E R   B I T C O I N   C A S I N O   &   S P O R T S B O O K      

█▀▀









▀▀▀

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  98%  
RTP

 
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

▀▀█









▀▀▀

█▀▀









▀▀▀

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

 HIGH 
ODDS

 
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

▀▀█









▀▀▀
 
..PLAY NOW..
Mia Chloe
Hero Member
*****
Offline Offline

Activity: 854
Merit: 1431


Contact me for your designs...


View Profile
October 10, 2025, 04:32:16 AM
 #4

~snip
The red simply indicates that your wallet's default gap limit has been exceeded normally most wallets use 20 or 30 as the gap limit. Because none of the addresses are used (no transactions yet), Electrum sees a huge unused gap between the last used address and the new ones so the wallet marks all addresses beyond the “gap limit” as beyond gap and colors them red to visually warn that they’re outside of the normal synchronization range. So they’re not used, not compromised, and not invalid but actually just outside the active scan range.

Increasing the gap limit is a temporary fix because you'll still repeat it if you restore the wallet. At best you can try to receive some coins in one of them so Electrum recognises them. A bigger gap limit majorly makes the syncing process longer.

nc50lc
Legendary
*
Offline Offline

Activity: 2926
Merit: 7765


Self-proclaimed Genius


View Profile
October 10, 2025, 05:00:28 AM
Merited by Pmalek (3), hosemary (2), Charles-Tim (2), Mia Chloe (2)
 #5

Is there a way to safely generate many addresses via script without triggering the “used” color?
It's just telling you that the red addresses will not be automatically show when you restore the seed phrase to another Electrum or other wallets.
If one of those non-red address has received a transaction, it'll count 20 addresses below it and remove their red highlight indicating that it's now covered by most wallet's default gap limit of 20.

Based from the command, this is related your other thread where you needed to export 1000 addresses but not via xpub, here: /index.php?topic=5561497.0
If so, if online, that wallet will be able to see and spend without issues once those addresses receive any bitcoins.
If offline, it can still sign PSBT created by an online watch-only wallet whether it's beyond the gap limit, not generated yet or not. (all it needs is the xprv key in the wallet if the PSBT is properly created)

You may increase the gap limit to 1000 to mark them green but that will always pre-generate 1000 more addresses on top of the last used one. (in case of online wallet)
Since you only exported a specific number of addresses for that website, you don't need those extra addresses.
But if you're going to add more in the future, then go ahead; but we warned that there's a non-specific limit on how many addresses Electrum can handle.

And it's not "unsafe" since those are all backed-up by your seed phrase.
The only issue is if you've used the <x>th address without using the previous ones then restore the seed phrase which usually only generates 20.
Like if you didn't use the first 20 previously (0~19 address index), the wallet will miss the ones with transactions in (let's say) 20th+ index until you generate those again or increase the wallet's gap limit.
The same issue applies to both method since it's not the default gap limit used by most wallets.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!