Bitcoin Forum
November 21, 2018, 09:34:36 PM *
News: Latest Bitcoin Core release: 0.17.0 [Torrent].
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Understanding keypool in Bitcoin Core  (Read 87 times)
kobik
Jr. Member
*
Offline Offline

Activity: 39
Merit: 3


View Profile
February 13, 2018, 11:27:03 AM
 #1

The default keypool is set to 1000. What does it mean exactly? That I have a pool of 1000 keys/address to use?
If I reduce the -keekpool to say 20 the wallet size is drastically reduced from 1.5M  to 50k. and loads much faster?
Will I be able to add more keys later? or after I finish the 20 pool I must re-use addresses? Is there any danger in a keypol of 20?

Any will help be appreciated.
1542836076
Hero Member
*
Offline Offline

Posts: 1542836076

View Profile Personal Message (Offline)

Ignore
1542836076
Reply with quote  #2

1542836076
Report to moderator
1542836076
Hero Member
*
Offline Offline

Posts: 1542836076

View Profile Personal Message (Offline)

Ignore
1542836076
Reply with quote  #2

1542836076
Report to moderator
PLAY NOW
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
LoyceV
Legendary
*
Online Online

Activity: 1316
Merit: 2279


Self-made Legendary!


View Profile WWW
February 13, 2018, 11:57:03 AM
 #2

The default keypool is set to 1000. What does it mean exactly? That I have a pool of 1000 keys/address to use?
If you have a HD wallet (check the icon on the bottom-right corner in Bitcoin Core), it doesn't matter.

If you've created your wallet in an older version of Bitcoin Core, it's not an HD wallet. If that's the case, your keypool is important for backups: your backup has the same 1000 keys, which means you only need to make a new backup after using many different new addresses.
If you would limit the keypool size to 20, you'll quickly run out of addresses, and you need to make new backups very often. That's the reason the keypool was increased from 100 to 1000.
I highly doubt it will load faster with a smaller keypool, other factors ("Loading block index") take much longer.

kobik
Jr. Member
*
Offline Offline

Activity: 39
Merit: 3


View Profile
February 13, 2018, 02:07:38 PM
 #3

The default keypool is set to 1000. What does it mean exactly? That I have a pool of 1000 keys/address to use?
If you have a HD wallet (check the icon on the bottom-right corner in Bitcoin Core), it doesn't matter.

Thanks for a clear answer. just to make it sure, if my wallet(s) are HD (which I do by default) I should not mind about keypool size and I can use 10 of 20 for that matter?

Also I made a mistake:

Quote
and loads much faster?

Should have been a fact, not a question.
When I tried to load/create 100 wallets (in multi-wallet mode), they were loaded/created in no time. as opposed when using the default 1000 keypool.
ranochigo
Legendary
*
Offline Offline

Activity: 1596
Merit: 1094

Somewhat inactive.


View Profile WWW
February 13, 2018, 02:18:38 PM
 #4

Thanks for a clear answer. just to make it sure, if my wallet(s) are HD (which I do by default) I should not mind about keypool size and I can use 10 of 20 for that matter?
Yes. The existence for the keypool previously is mainly to ensure that the backups that the user makes will be at least valid for 100 or 1000 transactions by default. With the introduction of HD wallet, they don't matter anymore since the keys generated will be consistent across every of your wallet files, no matter how many transactions. This is correct only if you haven't changed your password after saving the wallet files.

achow101
Moderator
Legendary
*
Offline Offline

Activity: 1596
Merit: 1758


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
February 13, 2018, 06:57:52 PM
 #5

The default keypool is set to 1000. What does it mean exactly? That I have a pool of 1000 keys/address to use?
It means that 1000 keys have been pre-generated and added to your wallet. If you restore a wallet backup, any keys that you had used that weren't marked as used in your backup are likely still in your backup's keypool. So when you restore it, the keys are already there and it knows to look for transactions related to those keys.

Even though Bitcoin Core uses BIP 32 HD wallets, it is not guaranteed that the software will be able to find all of your transactions if they keys are not in the keypool. Thus it is better to have a larger keypool to make sure that all transactions are caught during a restore.

The keypool also lets you get keys (specifically public keys and their associated address) without having to unlock your wallet. If there were no keypool, every time you wanted a new address, you would need to unlock your wallet in order for new keys to be added.

If I reduce the -keekpool to say 20 the wallet size is drastically reduced from 1.5M  to 50k. and loads much faster?
In theory yes since less data needs to be loaded.

Will I be able to add more keys later? or after I finish the 20 pool I must re-use addresses?
The keypool automatically regenerates keys when it is able to.

Is there any danger in a keypol of 20?
If you use more than 20 keys and then you restore an old backup, Bitcoin Core may not catch all of your transactions during a rescan. It is advised to keep the keypool larger than what you expect to use between backups.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!