Bitcoin Forum
May 11, 2024, 05:30:08 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Keypool command question [Answered]  (Read 904 times)
BookLover (OP)
Hero Member
*****
Offline Offline

Activity: 533
Merit: 500


^Bitcoin Library of Congress.


View Profile
April 19, 2013, 02:05:31 PM
Last edit: April 20, 2013, 01:57:56 PM by BookLover
 #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

1715405408
Hero Member
*
Offline Offline

Posts: 1715405408

View Profile Personal Message (Offline)

Ignore
1715405408
Reply with quote  #2

1715405408
Report to moderator
1715405408
Hero Member
*
Offline Offline

Posts: 1715405408

View Profile Personal Message (Offline)

Ignore
1715405408
Reply with quote  #2

1715405408
Report to moderator
1715405408
Hero Member
*
Offline Offline

Posts: 1715405408

View Profile Personal Message (Offline)

Ignore
1715405408
Reply with quote  #2

1715405408
Report to moderator
According to NIST and ECRYPT II, the cryptographic algorithms used in Bitcoin are expected to be strong until at least 2030. (After that, it will not be too difficult to transition to different algorithms.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715405408
Hero Member
*
Offline Offline

Posts: 1715405408

View Profile Personal Message (Offline)

Ignore
1715405408
Reply with quote  #2

1715405408
Report to moderator
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
April 19, 2013, 02:07:30 PM
 #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.
BookLover (OP)
Hero Member
*****
Offline Offline

Activity: 533
Merit: 500


^Bitcoin Library of Congress.


View Profile
April 19, 2013, 02:24:20 PM
 #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

CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
April 19, 2013, 02:29:19 PM
 #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).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
BookLover (OP)
Hero Member
*****
Offline Offline

Activity: 533
Merit: 500


^Bitcoin Library of Congress.


View Profile
April 19, 2013, 05: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.

DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
April 19, 2013, 08: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).
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
April 20, 2013, 03:04:13 AM
 #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".

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
BookLover (OP)
Hero Member
*****
Offline Offline

Activity: 533
Merit: 500


^Bitcoin Library of Congress.


View Profile
April 20, 2013, 02:07:30 PM
 #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

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!