Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: netrin on May 25, 2011, 08:10:35 PM

Title: Database Backup and Wallet isolation
Post by: netrin on May 25, 2011, 08:10:35 PM
I use (or would like to use) multiple wallets. For example, 1. public and 2. secure/backup. However, because internet usage is very expensive and slow, I want to reuse much of the .bitcoin/database. Simply removing the wallet.dat file (bitcoin.conf keypool=1) and restarting will crash the client on close. Having a theory as to why, I removed both the addr.dat and wallet.dat files and relaunched the BitCoin client.

Are only the addr.dat and wallet.dat files associated with a particular set of address/key pairs?

Is everything else generic distributed database stuff?

Or, as I suspect, is there data related to my wallet and thus my identity still scattered among the files, such as log files and blkindex, etc.

It seems to me data related to my wallet and identity should be distinctly isolated from the public distributed database files. My wallet/identifying data should change at a minimum. In my opinion, generating new addresses for change (even when 0 BTC) is an implementation detail that should either be manual or optional. The default 100 address pool has unexpected consequences, giving a false sense of backup security until perhaps loosing all money much later in time when restoring from backup. The binary nature of the wallet keeps people from merging, spliting, and generally understanding and maintaining their own wallet. If I want to 'launder' money and increase anonymity, I should distribute coins multiple times and at random intervals, not as a predictable operation along with every transaction which decreases my ability to restore from failure.

Title: Re: Database Backup and Wallet isolation
Post by: bitpop on May 26, 2011, 08:48:52 AM

Title: Re: Database Backup and Wallet isolation
Post by: netrin on May 26, 2011, 02:01:58 PM
I've been playing around switching between wallets in my .bitcoin directory. Three files (wallet.dat, addr.dat, and blkindex.dat are tied to single wallet or need to be rescanned/deleted between wallet swaps). The blk0001.dat file expands linearly with every swap with seemingly no shared/resusable data (which is evident by my now 600 MB blk0001.dat file.

I'm going to assume the lack of block data sharing is a bug or an oversight, but as of bitcoin-0.3.21, a "reusable wallet" consists of nearly the entire datadir (.bitcoin).

I would have assumed the old block chain (from genesis to yesterday) would be static.

Ideally there would be a [database] directory containing the 'static' historical block chain, a [limbo] directory for the not-yet confirmed recent block chain, a [wallet] directory with my addresses, keys, and anything identifying/personal, and finally a [log] directory that can be safely deleted.

And the more files are plaintext, the better. The bottleneck is the network graph and connections, not local file handling. Let the miners optimize, the general user needs to understand and the power to modify.