Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: TracaChang on March 24, 2022, 06:39:18 PM



Title: keypool default is now 3000? 20Kb only for 3000.
Post by: TracaChang on March 24, 2022, 06:39:18 PM
Hi

After creating a wallet with bitcoin core 22.0 and descriptors true, when typing getwalletinfo it shows:

{
  "walletname": "wallet",
  "walletversion": 169900,
  "format": "sqlite",
  "balance": 0.00000000,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "txcount": 0,
  "keypoolsize": 3000,
  "keypoolsize_hd_internal": 3000,
  "unlocked_until": 0,
  "paytxfee": 0.00000000,
  "private_keys_enabled": true,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": true
}

I thought the default keypool was 1000, so now the default has changed to 3000? What also surprises me is the size, having a keypool of 3000 and only 20Kb.

Thank you


Title: Re: keypool default is now 3000? 20Kb only for 3000.
Post by: TracaChang on March 24, 2022, 10:32:13 PM
I think I've found the answer about 3000, since listdescriptors shows 3 kind of addresses and each descriptor has range from 0-999, so 1000, that makes the 3000


Title: Re: keypool default is now 3000? 20Kb only for 3000.
Post by: BitMaxz on March 24, 2022, 11:59:57 PM
The default keypool size is 1000 and I think if you enable the descriptor it will change to 3000.

I can't find the answer to this but you can able to change the keypool size if you want to reduce or increase your address limit by adding this keypool=1001 in your bitcoin.conf file.

Read my old post here https://bitcointalk.org/index.php?topic=5390009.msg59547432#msg59547432


Title: Re: keypool default is now 3000? 20Kb only for 3000.
Post by: nc50lc on March 25, 2022, 03:09:59 AM
-snip-
I thought the default keypool was 1000, so now the default has changed to 3000? What also surprises me is the size, having a keypool of 3000 and only 20Kb.
I think because descriptor wallets store descriptors instead of private keys, so it has a keypool of 1000 descriptors for each address type,
while with private keys, all three address types can be derived from it.

You can test it by using the config: keypool=100n (some value higher than the default);
then you'll see that the result of getwalletinfo for a descriptor wallet has three time the keypoolsize of what you've set.

For the size, it's partly because the database used for descriptor wallet "SQLite" is lighter than legacy wallets' "Berkeley DB".
But mostly because the newly created wallet only stores the "parent descriptors" for each script type which are very small is size compared to storing individual private keys.


Title: Re: keypool default is now 3000? 20Kb only for 3000.
Post by: TracaChang on March 25, 2022, 08:22:57 PM
Yes BitMaxz, of course I've read your old post.

Thanks for the answers BitMaxz& nc50lc!