Bitcoin Forum
May 06, 2024, 12:39:12 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 581 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
1714999152
Hero Member
*
Offline Offline

Posts: 1714999152

View Profile Personal Message (Offline)

Ignore
1714999152
Reply with quote  #2

1714999152
Report to moderator
1714999152
Hero Member
*
Offline Offline

Posts: 1714999152

View Profile Personal Message (Offline)

Ignore
1714999152
Reply with quote  #2

1714999152
Report to moderator
1714999152
Hero Member
*
Offline Offline

Posts: 1714999152

View Profile Personal Message (Offline)

Ignore
1714999152
Reply with quote  #2

1714999152
Report to moderator
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714999152
Hero Member
*
Offline Offline

Posts: 1714999152

View Profile Personal Message (Offline)

Ignore
1714999152
Reply with quote  #2

1714999152
Report to moderator
1714999152
Hero Member
*
Offline Offline

Posts: 1714999152

View Profile Personal Message (Offline)

Ignore
1714999152
Reply with quote  #2

1714999152
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


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: 3388
Merit: 6581


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!