Author

Topic: Keypool command question [Answered] (Read 929 times)

hero member
Activity: 533
Merit: 500
^Bitcoin Library of Congress.
April 20, 2013, 09:07:30 AM
#8
As D&T advised keep several backups (naming according to date is not a bad idea at all) and also with any significant amounts you would be advised to use "cold storage".
Already covered. Wink  I even have them named by date.

Thanks for all the info, Grin
BookLover
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
April 19, 2013, 10:04:13 PM
#7
I was unclear in my previous post.  I encrypted manually using 7-zip, not the built in encryption option of bitcoin-qt.

Okay - that makes a *big* difference - and *yes* the "old backup" is fine provided you haven't used up all of the keypool from your original backup (noting that *change* addresses are taken from the keypool so assume 1 address used whether the tx is a send or receive).

If you encrypt the wallet *in* bitcoin-qt then the keypool is *discarded* making the scenario you described *a recipe for loss* (which has been reported by at one or two forum members before).

As D&T advised keep several backups (naming according to date is not a bad idea at all) and also with any significant amounts you would be advised to use "cold storage".
donator
Activity: 1218
Merit: 1079
Gerald Davis
April 19, 2013, 03:42:25 PM
#6
Let me make absolutely sure I understand correctly.

So if I encrypted a wallet with a keypool size of 100. 

Copied the encrypted wallet and decrypted the copy. 

Started bitcoin-qt with the copied wallet and the keypool=500 command. 

Sent coins. 

Deleted copied wallet.

Then my encrypted wallet still has the private keys to all my coins? (assuming it already had plenty of spare keys)

Thank you for you time and for promoting my sanity,
BookLover

Yes.  However I would recommend against "playing around" with money given that my understanding could be incomplete.

In your example backup A had 100 keys in keypool, you then added 400 new ones, then used the oldest one.  The keypool is actually a key queue the keys are used in sequential order.
So even if the current copy was lost "backup A" cointains the "used" key plus 99 more. 

Still as CIYAM indicated anytime you make changes to the wallet I would strongly recommend making a new both before AND after the change.  I would also strongly recommend you backup system be automated AND not replace prior backups (i.e. have date of backup in filename).  A decent sized keypool combined with good backup procedures should make the risk of key loss negligible.  If you are still paranoid using pywallet you can dump the keys from the keypool and print them out as an alternate backup method (would allow recovery even if wallet became corrupt and backups corrupt as well).
hero member
Activity: 533
Merit: 500
^Bitcoin Library of Congress.
April 19, 2013, 12:53:20 PM
#5
I was unclear in my previous post.  I encrypted manually using 7-zip, not the built in encryption option of bitcoin-qt.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
April 19, 2013, 09:29:19 AM
#4
Not quite sure "why" you would want to do this (especially the deleting of the copied wallet) but provided that you hadn't used keys that were already part of the encrypted wallet then yes they will be used by the new wallet before any later keys (if you re-encrypt before using though then all unused keys will first be discarded AFAIA).
hero member
Activity: 533
Merit: 500
^Bitcoin Library of Congress.
April 19, 2013, 09:24:20 AM
#3
Let me make absolutely sure I understand correctly.

So if I encrypted a wallet with a keypool size of 100. 

Copied the encrypted wallet and decrypted the copy. 

Started bitcoin-qt with the copied wallet and the keypool=500 command. 

Sent coins. 

Deleted copied wallet.

Then my encrypted wallet still has the private keys to all my coins? (assuming it already had plenty of spare keys)

Thank you for you time and for promoting my sanity,
BookLover
donator
Activity: 1218
Merit: 1079
Gerald Davis
April 19, 2013, 09:07:30 AM
#2
The later.  keypool sets the size of the keypool.  The wallet will create as many keys as necessary to achieve the keypool size.

If the wallet is encrypted the additional keys will not be created until the wallet is unlocked.
hero member
Activity: 533
Merit: 500
^Bitcoin Library of Congress.
April 19, 2013, 09:05:31 AM
#1
If I put keypool=500 in bitcoin.conf, then are 500 new address created for the keypool?  Or are the existing 100 preserved and 400 added to reach 500?

Questions and thoughts appreciated,
BookLover
Jump to: