Bitcoin Forum
May 12, 2024, 04:10:07 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Gap limit change - too many receiving addresses  (Read 1121 times)
OldFaceAndre (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
April 14, 2017, 05:05:24 PM
 #1

Hello,
I used these commands to create 250 receiving addresses.
wallet.change_gap_limit(250)
wallet.storage.write()
After I received and sent btc from 2 of the addresses, the gap limit automatically changed to (252) (checked it when i opened my unencrypted wallet file with notepad) - this is normal, right? But today, after listing all of my addresses, I get a number of 346 total addresses (the gap limit is still 252) instead of 252 total addresses. How and why?
1715487007
Hero Member
*
Offline Offline

Posts: 1715487007

View Profile Personal Message (Offline)

Ignore
1715487007
Reply with quote  #2

1715487007
Report to moderator
1715487007
Hero Member
*
Offline Offline

Posts: 1715487007

View Profile Personal Message (Offline)

Ignore
1715487007
Reply with quote  #2

1715487007
Report to moderator
"There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715487007
Hero Member
*
Offline Offline

Posts: 1715487007

View Profile Personal Message (Offline)

Ignore
1715487007
Reply with quote  #2

1715487007
Report to moderator
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
April 14, 2017, 05:30:02 PM
 #2

i don't know why the gap limit increased to 252 rather than 250. does it say the following when you view the file in notepad:

Code:
"gap_limit": 252,

Or are you counting the addresses manually and determining the gap limit that way?

To answer your second question the gap limit is the number of unused addresses, beyond the index of the last used address in your wallet, that electrum keeps track off. So 250 gap limit doesn't mean you have just 250 addresses in your wallet. I've explained it here:

https://bitcointalk.org/index.php?topic=1845025.msg18535357#msg18535357
OldFaceAndre (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
April 14, 2017, 06:17:48 PM
 #3

i don't know why the gap limit increased to 252 rather than 250. does it say the following when you view the file in notepad:

Code:
"gap_limit": 252,

Or are you counting the addresses manually and determining the gap limit that way?

To answer your second question the gap limit is the number of unused addresses, beyond the index of the last used address in your wallet, that electrum keeps track off. So 250 gap limit doesn't mean you have just 250 addresses in your wallet. I've explained it here:

https://bitcointalk.org/index.php?topic=1845025.msg18535357#msg18535357
Well, I used 2 of the 250 addresses, so I guess that had to do something with gap limit.
Yes, it says "gap_limit": 252,
As for counting the addresses, I'm using
listaddresses() - receiving addresses + change addresses
or
print "\n".join(i for i in wallet.get_receiving_addresses() ) - only receiving addresses

Then copy all of the addresses to excel and I get 346 or 352 rows.

Just read your posts, can we clarify this. If i set my gap limit to 250, and received some coins to the 166th address then electrum will look up to my gap limit (250) and create additional addresses until I have (166+250=416) total addresses? And it's not possible for me to lose some addresses/bitcoins, as long as I remember my seed words and have the ability to increase the gap limit, because the default one is 20, right?
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
April 15, 2017, 12:39:03 PM
 #4

Just read your posts, can we clarify this. If i set my gap limit to 250, and received some coins to the 166th address then electrum will look up to my gap limit (250) and create additional addresses until I have (166+250=416) total addresses?

Yep on the "receiving" chain.

The change address chain also has a gap limit but it is a fixed number. New change addresses are generated to maintain unused addresses just like with the main chain but the gap limit there is not user configurable.

Quote
And it's not possible for me to lose some addresses/bitcoins, as long as I remember my seed words and have the ability to increase the gap limit, because the default one is 20, right?

Yes this is correct. But you should know that electrum is not optimized to support thousands of addresses. It tends to get slow if there are a lot of addresses in a wallet. So periodically you will have to migrate your funds to fresh electrum wallet that you create using the file> new/restore option.

BTW you can generate addresses for ecommerce applications using scripts. All the script will need is the master public key.
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
April 15, 2017, 12:40:50 PM
 #5

Well, I used 2 of the 250 addresses, so I guess that had to do something with gap limit.
Yes, it says "gap_limit": 252,

This shouldn't have happened. If you configured it to 250 then that's where it should have remained. If you can reproduce it then it looks like you found a bug.
OldFaceAndre (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
April 15, 2017, 01:49:45 PM
 #6

Just read your posts, can we clarify this. If i set my gap limit to 250, and received some coins to the 166th address then electrum will look up to my gap limit (250) and create additional addresses until I have (166+250=416) total addresses?

Yep on the "receiving" chain.

The change address chain also has a gap limit but it is a fixed number. New change addresses are generated to maintain unused addresses just like with the main chain but the gap limit there is not user configurable.

Quote
And it's not possible for me to lose some addresses/bitcoins, as long as I remember my seed words and have the ability to increase the gap limit, because the default one is 20, right?

Yes this is correct. But you should know that electrum is not optimized to support thousands of addresses. It tends to get slow if there are a lot of addresses in a wallet. So periodically you will have to migrate your funds to fresh electrum wallet that you create using the file> new/restore option.

BTW you can generate addresses for ecommerce applications using scripts. All the script will need is the master public key.
Alright, I really like electrum so far, coming from creating manual wallets via coinb.in, and I really appreciate your help. What would you say is a healthy number of addresses that electrum can handle? I don't mind creating a new wallet every month or so, will it handle my load if I get few hundred transactions per month and create a new wallet every month or so?
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
April 16, 2017, 06:55:11 PM
 #7

Alright, I really like electrum so far, coming from creating manual wallets via coinb.in, and I really appreciate your help. What would you say is a healthy number of addresses that electrum can handle? I don't mind creating a new wallet every month or so, will it handle my load if I get few hundred transactions per month and create a new wallet every month or so?

I honestly don't know how large a wallet electrum can handle. I only know what I've picked up reading and answering questions here. It would be in the thousands of addresses though.

BTW in that other thread you talk about uploading addresses as a text file. You do realize that you can generate addresses with just the master public key of the wallet, don't you? You cannot spend money with just the master public key so it is safe to install that on a server. You can then generate address on the fly on the server. I've tried explaining this to you above too:

BTW you can generate addresses for ecommerce applications using scripts. All the script will need is the master public key.

As an example you can see this plugin I made for wordpress that does that:

https://wordpress.org/plugins/bitcoin-address/

There are scripts available for a lot of programming languages so if you tell us which language you prefer I can perhaps point one out for you.
OldFaceAndre (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
April 16, 2017, 07:43:32 PM
 #8

Alright, I really like electrum so far, coming from creating manual wallets via coinb.in, and I really appreciate your help. What would you say is a healthy number of addresses that electrum can handle? I don't mind creating a new wallet every month or so, will it handle my load if I get few hundred transactions per month and create a new wallet every month or so?

I honestly don't know how large a wallet electrum can handle. I only know what I've picked up reading and answering questions here. It would be in the thousands of addresses though.

BTW in that other thread you talk about uploading addresses as a text file. You do realize that you can generate addresses with just the master public key of the wallet, don't you? You cannot spend money with just the master public key so it is safe to install that on a server. You can then generate address on the fly on the server. I've tried explaining this to you above too:

BTW you can generate addresses for ecommerce applications using scripts. All the script will need is the master public key.

As an example you can see this plugin I made for wordpress that does that:

https://wordpress.org/plugins/bitcoin-address/

There are scripts available for a lot of programming languages so if you tell us which language you prefer I can perhaps point one out for you.
Thanks. Can you point me to a php solution, preferably one that would work with cpanel hosting, i'm not using wordpress.
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
April 16, 2017, 08:02:16 PM
 #9

Thanks. Can you point me to a php solution, preferably one that would work with cpanel hosting, i'm not using wordpress.

Sure you can grab the code from that plugin itself. I've explained it here:

https://bitcointalk.org/index.php?topic=1722089.msg17241773#msg17241773
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!