I think I just managed to lose a large number of BTC. Here's what happened:
1. I had a wallet with all my BTC. I quit Bitcoin (version 0.3.21) and renamed the entire Bitcoin directory Bitcoin-checking.
2. I re-opened Bitcoin, which created a new Bitcoin directory and downloaded all the blocks again.
3. I copied the address shown, quit Bitcoin, renamed this directory Bitcoin-savings, encrypted it as Bitcoin-savings-encrypted, and saved it in multiple remote locations.
4. I renamed Bitcoin-checking to Bitcoin, then restarted the Bitcoin application.
5. I sent 0.02 BTC to the address from step 3.
6. I quit Bitcoin and renamed the Bitcoin directory to Bitcoin-checking.
7. I unencrypted a copy of Bitcoin-savings-encrypted, renamed the directory to Bitcoin, and restarted the Bitcoin application.
8. My 0.02 BTC showed up in this savings wallet.
9. I copied another address, quit Bitcoin again, renamed the directory as Bitcoin-savings, swapped in Bitcoin-checking and sent lots of BTC to this new savings address.
10. I never updated the Bitcoin-savings-encrypted file after step 3, because I thought the wallet automatically contained 100 pre-generated addresses to start.
11. I securely deleted my unencrypted Bitcoin-savings directory with multiple passes.
12. Later I unencrypted a copy of the Bitcoin-savings-encrypted directory, renamed it Bitcoin, opened the Bitcoin app, and only my original 0.02 BTC are shown even after all the new blocks are downloaded.
So it looks like I lost all the BTC I transferred to my savings wallet! I downloaded bitcointools from here:
https://github.com/gavinandresen/bitcointoolsand viewed the contents of my savings wallet.dat from Bitcoin-savings-encrypted with this command:
python dbdump.py --wallet
The output only shows a single PubKey and PrivKey pair (where I sent 0.02 BTC). It also shows two lines that say "Unknown key type: bestblock".
I was under the impression that wallets automatically have 100 pre-generated keys as soon as the wallet is created as mentioned here:
https://en.bitcoin.it/wiki/Securing_your_walletSo why did my savings wallet that I encrypted in step 3 only have a single address? I clearly completely screwed up by not updating Bitcoin-savings-encrypted after the large transfers, but I thought I only needed to do that after 100 keys had been used for 100 transactions. What went wrong? When does the Bitcoin application actually create those 100 queued keys? Does it only created the pool of pre-generated keys after the first address is actually used?
- Very Sad Puppy
more than one address if all you are doing is sending more money to that address. You only need more than one to