Bitcoin Forum
July 27, 2024, 11:48:33 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin core wallet keys  (Read 588 times)
samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
December 20, 2015, 04:21:58 PM
 #1

Hi,

Made a new wallet, a fresh start. I initially had a keypool of 5000, so I won't need to back up that often.
After encryption, the keypool is 10000, according to the debug.log.

Now , without having done any transactions, I noticed that the keypool is 10017.

Why are there keys being added, without transactions? Does anyone know?

Thanks, Sam
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3458
Merit: 6793


Just writing some code


View Profile WWW
December 20, 2015, 04:26:56 PM
 #2

How did you set the keypool? The increase to 10000 might have been caused by the way that you had set the keypool size.

Did you get a new address 17 times? It looks like Bitcoin Core is trying to keep 10000 address in the keypool, so if you request a new address, it will generate another and add it to the keypool. This will happen even if you don't have any transactions.

samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
December 20, 2015, 04:57:58 PM
 #3

How did you set the keypool? The increase to 10000 might have been caused by the way that you had set the keypool size.

Did you get a new address 17 times? It looks like Bitcoin Core is trying to keep 10000 address in the keypool, so if you request a new address, it will generate another and add it to the keypool. This will happen even if you don't have any transactions.

I set the keypool size in the .conf via -keypool=5000. After wallet encryption, I noticed that in the debug.log it said it loaded 10000 keys, all encrypted.

Yes, I manually created addresses via 'getnewaddress'. I tested it just now by manually making a new one, but the keys after a restart were still 10017. But it might be that though.
How the 5000 turned into 10000 is still a mystery.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3458
Merit: 6793


Just writing some code


View Profile WWW
December 20, 2015, 05:34:39 PM
 #4

Yes, I manually created addresses via 'getnewaddress'. I tested it just now by manually making a new one, but the keys after a restart were still 10017. But it might be that though.
I think the wallet needs to be unlocked in order to generate new keys, so the keypool size will probably increase the next time you unlock the wallet.

How the 5000 turned into 10000 is still a mystery.
I think the wallet marks all of the keys in the keypool before an encryption as used so it regenerates the keypool after encrypting which is how 5000 became 10000

samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
December 20, 2015, 06:26:48 PM
 #5

Yes, I manually created addresses via 'getnewaddress'. I tested it just now by manually making a new one, but the keys after a restart were still 10017. But it might be that though.
I think the wallet needs to be unlocked in order to generate new keys, so the keypool size will probably increase the next time you unlock the wallet.

How the 5000 turned into 10000 is still a mystery.
I think the wallet marks all of the keys in the keypool before an encryption as used so it regenerates the keypool after encrypting which is how 5000 became 10000

Ah ok, makes sense! Thanks.
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!