Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Alex Beckenham on April 06, 2011, 12:46:50 PM



Title: do new installs automatically generate 100 addresses?
Post by: Alex Beckenham on April 06, 2011, 12:46:50 PM
Hi,

I backed up my wallet about 1-2 weeks ago, but since then I have received a rather large amount, and wallet.dat just disappeared today with a hard drive failure.

What I'm wondering is, if the default client generates 100 addresses, then the address that received the large amount should be backed up already, correct? Even though it received the money after the backup.

Thanks... you never know what minute of the day your hard drive is going to fail :)


Title: Re: do new installs automatically generate 100 addresses?
Post by: Cdecker on April 06, 2011, 02:00:44 PM
That's the main idea, but the addresses may have been used for change too. It's worth a try.
If you already had that address before the crash you'll definitely get your coins back, I myself used a deleted block chain several times, and I always got my coins ^^
Let us know what happens.


Title: Re: do new installs automatically generate 100 addresses?
Post by: MoonShadow on April 06, 2011, 02:48:23 PM
Hi,

I backed up my wallet about 1-2 weeks ago, but since then I have received a rather large amount, and wallet.dat just disappeared today with a hard drive failure.

What I'm wondering is, if the default client generates 100 addresses, then the address that received the large amount should be backed up already, correct? Even though it received the money after the backup.

Thanks... you never know what minute of the day your hard drive is going to fail :)


Yes.  If you have a good backup of your wallet.dat file, just reinstall the newest client and put a copy of your backup into the proper directory before starting it up.  It should find both your new and old funds as it bootstraps the blockchain.


Title: Re: do new installs automatically generate 100 addresses?
Post by: Stephen Gornick on April 06, 2011, 08:49:40 PM
When starting the bitcoin client when no wallet.dat existed, the client will show one address.  At that point is the bitcoin address pool really already populated with the 100 addresses?

I suspect it only adds them the first time you explicitly click "New".

Thus on a new installation if I were to simply to have shut down Bitcoin and backed up wallet.dat, that backup would not have any of the addresses that are then added to the wallet after the first time "New" is clicked.


Title: Re: do new installs automatically generate 100 addresses?
Post by: theymos on April 06, 2011, 09:17:45 PM
When starting the bitcoin client when no wallet.dat existed, the client will show one address.  At that point is the bitcoin address pool really already populated with the 100 addresses?

It starts filling the keypool immediately.


Title: Re: do new installs automatically generate 100 addresses?
Post by: randomguy7 on April 06, 2011, 09:27:32 PM
Btw, does someway somebody (typo) remember the cmd to change the default to another (higher) value? Is there a way to show how many of the addresses were replaced by new ones since the last backup? If not, a counter feature for this would be quite useful.


Title: Re: do new installs automatically generate 100 addresses?
Post by: theymos on April 06, 2011, 09:39:43 PM
Btw, does someway remember the cmd to change the default to another (higher) value?

-keypool=1000

Is there a way to show how many of the addresses were replaced by new ones since the last backup?

getinfo outputs "keypoololdest", which is the Unix timestamp when the oldest key was created. Your backup must be more recent than this.


Title: Re: do new installs automatically generate 100 addresses?
Post by: Alex Beckenham on April 06, 2011, 11:00:26 PM
This is all good news, and what I thought I had read, thanks.

I'll report back once it restored.

On that note, I do feel that there are many many threads/posts on backing up, and very very few on the correct way to restore after a backup.

(So thanks creighto for that note)


Title: Re: do new installs automatically generate 100 addresses?
Post by: Alex Beckenham on April 07, 2011, 05:50:43 AM
Okay after a bit of another scare, I got it all back!

The scare was that after restoring the old wallet and running the new install, it instantly listed all my transactions up until April 1st, but they were all greyed out on 0/conf.

Then after all the blocks downloaded it started populating with all the newer transactions, right up until yesterday's.

Anyway, what a great excuse it was to get my first SSD  ;D

To those that were working with me via Skype recently, I've had to get a new account, and I'll PM you with the new ID.



Title: Re: do new installs automatically generate 100 addresses?
Post by: legion050 on April 08, 2011, 04:58:18 AM
sorry to de-rail post.. but..

is there a limit or reason to not do something like

-keypool=20000

?

so i could have alot just sitting there


Title: Re: do new installs automatically generate 100 addresses?
Post by: BitterTea on April 08, 2011, 05:10:48 AM
sorry to de-rail post.. but..

is there a limit or reason to not do something like

-keypool=20000

?

so i could have alot just sitting there

I'd guess memory and disk space are the two big reasons.


Title: Re: do new installs automatically generate 100 addresses?
Post by: MoonShadow on April 08, 2011, 05:13:07 AM
sorry to de-rail post.. but..

is there a limit or reason to not do something like

-keypool=20000

?

so i could have alot just sitting there

Disk space, but if you are an online merchant, a keypool of 20K might be a reasonable number.  It would take the client quite some time to crap out so many on an average desktop, but this would only be an issue upon first startup.


Title: Re: do new installs automatically generate 100 addresses?
Post by: legion050 on April 08, 2011, 08:32:28 PM
so i tested it out

i used -keypool=1000000

file size went from 128kb to 680,076kb

and it took ~3hrs

very interesting..


Title: Re: do new installs automatically generate 100 addresses?
Post by: MoonShadow on April 08, 2011, 09:00:26 PM
Now I wonder if one must start the client with the large keypool settings in order to maintain said large keypool, or if doing this once only will result in the client using the very large keypool until it's down to only 100 unused keypairs.  This would be a reasonable way to back up for archival purposes, as such a large keypool would take most people years to consume.


Title: Re: do new installs automatically generate 100 addresses?
Post by: theymos on April 08, 2011, 09:21:34 PM
You only need to do it once if you don't need the pool to re-fill to that level.

I wonder if that many keys will slow Bitcoin down. I believe wallet.dat needs to be stored entirely in memory, so it will at least increase memory usage.


Title: Re: do new installs automatically generate 100 addresses?
Post by: legion050 on April 08, 2011, 09:24:02 PM
You only need to do it once if you don't need the pool to re-fill to that level.

I wonder if that many keys will slow Bitcoin down. I believe wallet.dat needs to be stored entirely in memory, so it will at least increase memory usage.

it does put it entirely in memory, and turning bitcoin on now takes almost entirely a minute.


Title: Re: do new installs automatically generate 100 addresses?
Post by: legion050 on April 08, 2011, 09:26:09 PM
Now I wonder if one must start the client with the large keypool settings in order to maintain said large keypool, or if doing this once only will result in the client using the very large keypool until it's down to only 100 unused keypairs.  This would be a reasonable way to back up for archival purposes, as such a large keypool would take most people years to consume.

just turning on bitcoin with the -keypool command does not start the creation. you must click the "new address" button in the address book for it to start creating the new pool of addresses.

and if i made the number say 50 it would create 50 every time i hit create new address.


Title: Re: do new installs automatically generate 100 addresses?
Post by: legion050 on April 08, 2011, 09:34:33 PM
sorry for so many posts one after another.

http://img858.imageshack.us/img858/8826/bitcoinlargememory.png