Author

Topic: Electrum - How to create more Receiving Addresses? (Read 222 times)

newbie
Activity: 23
Merit: 7
Thank you guys. It's clear now finally.
legendary
Activity: 3374
Merit: 3095
Playbet.io - Crypto Casino and Sportsbook
Edit: While going to work, I thought about what I said. So I did some research and it indeed looks like you do require a full-node with BTCPay Server, but it comes with the installation. Sorry for giving you the wrong information initially.

Yes, it's required to have a full node with BTCpayserver but they also have options to use a 3rd party if you don't have a budget to build a full node.

@zkquality

If you are looking for 3rd party BTCpay hosts you can find them from the link below
- https://directory.btcpayserver.org/filter/hosts

Some of them are free and paid but if you care about your privacy then you would need to build a full node.
newbie
Activity: 23
Merit: 7
Thank you very much for that! I was searching for it long time ago.

P.S Is there any way to reduce bitcoin node stroage & data usage?
If you are talking about running a full-node, you have to download and verify the entire Bitcoin blockchain. After that, you can use pruned mode that requires only a few GBs of storage on your hard disk.

But Electrum is an SPV client, so you don't have to worry about storage limitations.
And if you decide to go for a payment processor such as BTCPay Server, you would also not be dealing with full-nodes.

Edit: While going to work, I thought about what I said. So I did some research and it indeed looks like you do require a full-node with BTCPay Server, but it comes with the installation. Sorry for giving you the wrong information initially.

Thank you for replying. I've read their docs that why I asked for that no problem at all friend.
legendary
Activity: 2730
Merit: 7065
Thank you very much for that! I was searching for it long time ago.

P.S Is there any way to reduce bitcoin node stroage & data usage?
If you are talking about running a full-node, you have to download and verify the entire Bitcoin blockchain. After that, you can use pruned mode that requires only a few GBs of storage on your hard disk.

But Electrum is an SPV client, so you don't have to worry about storage limitations.
And if you decide to go for a payment processor such as BTCPay Server, you would also not be dealing with full-nodes.

Edit: While going to work, I thought about what I said. So I did some research and it indeed looks like you do require a full-node with BTCPay Server, but it comes with the installation. Sorry for giving you the wrong information initially.
newbie
Activity: 23
Merit: 7
Have you considered using a non-custodial payment processor on your website to accept bitcoin payments?
On this list you will see both hosted and non-hosted services that you can try out.

BTCPay Server would be an obvious and recommended choice for many, but it requires a bit of time to set up.

Thank you very much for that! I was searching for it long time ago.

P.S Is there any way to reduce bitcoin node stroage & data usage?
legendary
Activity: 2268
Merit: 18711
Instead of this solution that requires to restart Electrum, I'm providing another one that doesn't have this requirement.
You don't need to restart Electrum with this. When you change the gap limit, it does so instantly and generates new addresses up to your new gap limit. If they show up with a red background, which signals they are still below your gap limit (this shouldn't happen), then a restart should remove the red background.

The solution you have given generates new addresses beyond the gap limit. Since these addresses are beyond the gap limit, they will always have a red background until you use the original command to increase your gap limit to cover these addresses or you start receiving coins to earlier addresses.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
wallet.change_gap_limit(number)

Instead of this solution that requires to restart Electrum, I'm providing another one that doesn't have this requirement.



Go to View -> Console and type:
Code:
for i in range (n): print (wallet.create_new_address(False))

If you want to generate receiving addresses or:
Code:
for i in range (n): print (wallet.create_new_address(True))

If you want change addresses. Replace n with the number of addresses you want to generate.
legendary
Activity: 2730
Merit: 7065
Have you considered using a non-custodial payment processor on your website to accept bitcoin payments?
On this list you will see both hosted and non-hosted services that you can try out.

BTCPay Server would be an obvious and recommended choice for many, but it requires a bit of time to set up.
legendary
Activity: 3472
Merit: 10611
I'm coding a win server application to do that. Do you suggest an other way to do that?
Your other topic would be a better place to discuss this, but it's locked already. Electrum has it's limits, if you're expecting to use thousands of addresses on your website, you'll probably need your own node instead of Electrum.
It is always best to run your own node if you are running a business and want to accept payment, but technically you can still use Electrum with some small modification. The problem with Electrum for large number of addresses is only the wallet file. It is a JSON file ergo the whole thing is being read and written each time instead of being a database where only a small part of it is read or updated each time. If that small part is changed, the issue will be solved.

I wonder if anyone has ever done this modification?
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip-
wallet.change_gap_limit(number)
It worked thanks!, but why many addresses are marked as red? this is normal? I've generated 1000x address
Means that it reverted back to default gap limit or just need time to display as "within the gap limit",
as mentioned above, those "marked red" are addresses beyond the wallet's gap limit (gap limit is saved in the wallet file itself);
However, it actually means your current gap_limit is only up to the last non-red-highlighted address.
If you'll use the wallet in that state, it will only generate 20 more addresses (instead of another 1000) after the 1000th is used.

Restart Electrum first, then check if those addresses are still red, if still red, there may be something preventing the setting.
But I bet it just needs a restart/time.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I'm coding a win server application to do that. Do you suggest an other way to do that?
Your other topic would be a better place to discuss this, but it's locked already. Electrum has it's limits, if you're expecting to use thousands of addresses on your website, you'll probably need your own node instead of Electrum.
legendary
Activity: 2268
Merit: 18711
Running your own Electrum server to point your Electrum client to would be a good start, as many Electrum servers will throttle users who try to query thousands of addresses at once or implement some form of DDoS protection which will slow things down. It's also better for the privacy of you and your customers.

Beyond that, Electrum is not designed to hold tens of thousands of addresses in a single wallet. Given that each address should only be single use and you should present each customer with a new address for each new deposit, then you should not need to constantly monitor old addresses. Having them accessible in an old wallet file in the event a customer accidentally sends coins to an old address should be sufficient. With that in mind, then once you hit (say) 10k addresses (or whenever you start to notice significant lag), simply open a new wallet with the same seed phrase but the next account number, so at derivation path m/84'/0'/1' instead of m/84'/0'/0', for example. Keep several copies of the old wallets as a buck up so you can recover any funds mistakenly sent to them.

Or use a different client altogether.
newbie
Activity: 23
Merit: 7
Also, if you make the gap limit too high, your wallet will be very slow, take a long time to sync, or might crash altogether. Don't generate thousands of addresses just for the sake of it.

The main goal is run my electrum as merchant system for users to deposit / withdraw on a website, I'm coding a win server application to do that. Do you suggest an other way to do that?
legendary
Activity: 2268
Merit: 18711
It worked thanks!, but why many addresses are marked as red? this is normal? I've generated 1000x address
Yes, it's normal. It's just Electrum's way of telling you that these addresses are beyond the default gap limit and so won't appear automatically when you recover the wallet until you again increase the gap limit.

If you try restarting Electrum and reopening your wallet, the red background may disappear.

Also, if you make the gap limit too high, your wallet will be very slow, take a long time to sync, or might crash altogether. Don't generate thousands of addresses just for the sake of it.
legendary
Activity: 2758
Merit: 6830
It worked thanks!, but why many addresses are marked as red? this is normal? I've generated 1000x address
Probably because they are too far away from the used addresses on the default gap limit, so if you later import your wallet (from the seed), Electrum won't search that far away and will miss the addresses that may have some balance (until you increase the gap again).
newbie
Activity: 23
Merit: 7
How do I create more receiving addresses (more than 20) by UI or Terminal/CMD?

You have to change the gap limit. Go to the Console (enable it first by selecting View -> Show Console) and type in the following command.

wallet.change_gap_limit(number)

It worked thanks!, but why many addresses are marked as red? this is normal? I've generated 1000x address
legendary
Activity: 1876
Merit: 3132
How do I create more receiving addresses (more than 20) by UI or Terminal/CMD?

You need to change the gap limit. Go to the Console (enable it first by selecting View -> Show Console) and type in the following command.

wallet.change_gap_limit(number)
newbie
Activity: 23
Merit: 7
Electrum

How do I create more receiving addresses (more than 20) by UI or Terminal/CMD?

I can't find a button even on the UI.

https://i.ibb.co/Zdt5NBJ/ddd.png

Thanks a lot great community.
Jump to: