Bitcoin Forum
June 16, 2024, 07:55:56 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Noob question on wallet.dat file size  (Read 885 times)
MrsHitchcock (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
October 10, 2015, 03:01:51 PM
 #1

Hello!

First of all: sorry in case this question has already been asked elsewhere. I did a search, but didn't come up with an answer to my question.

I increased my keypool from the default of 100 premade bitcoin addresses to 500, in order to make a long-time future-proof backup.

The command line (put inside a bitcoin.bat file) when starting up Bitcoin Core 0.11.0 on Windows 10 looks as follows:

Quote
bitcoin-qt.exe -datadir=./data -keypool=500 -onlynet=onion

The application starts and works. I also can see my specified commandline options did have an effect, as the wallet.dat in the /data subfolder gets used and only connections to .onion URLs are made.

However, the file size of my wallet.dat did not increase! And that makes me become suspicious. Shouldn't the wallet.dat file size increase by five times when 500 instead of 100 public/private bitcoin keypairs are stored in it?

Sorry when asking a stupid question, but this drives me crazy ATM.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3430
Merit: 6705


Just writing some code


View Profile WWW
October 10, 2015, 03:54:23 PM
 #2

It should increase.

Is your wallet unlocked or unencrypted? I don't know if setting the keypool in the startup command will work if the wallet is encrypted.

I would suggest that you go to the debug console and use the keypoolrefill (https://bitcoin.org/en/developer-reference#keypoolrefill)  command in order to fill your keypool with however many keys. You will need to use the walletpassphrase (https://bitcoin.org/en/developer-reference#walletpassphrase) command to unlock the wallet if it is locked.

MrsHitchcock (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
October 10, 2015, 04:14:59 PM
 #3

Is your wallet unlocked or unencrypted? I don't know if setting the keypool in the startup command will work if the wallet is encrypted.

My wallet is encrypted. And it was locked all the time, as I didn't do anything that would need it to be unlocked (e.g. sending funds) after setting up the -keypool=500 command line option.

I would suggest that you go to the debug console and use the keypoolrefill (https://bitcoin.org/en/developer-reference#keypoolrefill)  command in order to fill your keypool with however many keys. You will need to use the walletpassphrase (https://bitcoin.org/en/developer-reference#walletpassphrase) command to unlock the wallet if it is locked.

This worked instantly. Thanks!

You could watch the wallet.dat file size increase gradually while Bitcoin Core created a new and larger keypool.
MrsHitchcock (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
October 10, 2015, 04:26:47 PM
 #4

Update: After some testing I just found out that unlocking the wallet with the walletpassphrase command is sufficient. Bitcoin Core will then increase the keypool automatically. Alternatively you can send out some funds, as your wallet needs to be unlocked for this operation.

The more I think about this, the more it makes sense: Writing new private keys to the wallet.dat of course needs this very file to be unlocked with the correct passphrase.
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
October 10, 2015, 07:30:48 PM
 #5

Update: After some testing I just found out that unlocking the wallet with the walletpassphrase command is sufficient. Bitcoin Core will then increase the keypool automatically. Alternatively you can send out some funds, as your wallet needs to be unlocked for this operation.

The more I think about this, the more it makes sense: Writing new private keys to the wallet.dat of course needs this very file to be unlocked with the correct passphrase.

Yes, it will try to maintain 500 (100 by default) hidden private key/address pairs for you. Whenever the wallet gets unlocked it will check and generate new if needed. You can also use getwalletinfo to see whether the hidden keypool is full or not.

Im not really here, its just your imagination.
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!