I was going to start a new thread, but I figure I'll just a bump a relevant thread to reduce clutter (please let me know if that's not good mojo on these boards).
I'm currently running Bitcoin-QT on both Windows and Mac. The Windows software was just a test, the Mac is mine and likely where I'll keep any actual store of bitcoins. I use the OSX backup software "Time Machine" (for those who don't know, it does a differential backup every hour). I assumed this was sufficient and in the case that wallet.dat was corrupted, I could restore from the most recent uncorrupted version. However, some of the keypool stuff I'm reading in threads like these, as well as the info on deterministic wallets, is really throwing me for a loop.
Please bear with me, I geek out over this stuff and I really like to understand how it works so I don't make any mistakes (and because BTC is such an incredible idea)
How I thought it works:
- wallet.dat contains the private keys associated with each address (each address is really just a hash of the private key?)
- the balance in your wallet is based on using the private keys for each addresss and verifying against the Block Chain.
- if the wallet is corrupted after the creation of a new address but before it's freshly backed up, you could lose any coins sent to that new address
After reading about the keypool I assumed that this addressed the above problem scenario, but further reading made me realize that this is not the case
How I now think the keypool works:
- wallet.dat contains 100 private/public key pairs
- key pairs are associated with your addresses as well as some (but not all?) transactions
- when a new address is created or a transaction occurs to/from an address a key is pulled "from the bottom" of the key pool, with remaining keys left to be used at a future date and a new key repopulates "at the top"
- my wallet balance is based on private keys for both addresses and transactions, and then verified against the block chain
- restoring from a backup will maintain my current balance, so long as fewer than 100 actions have taken place since the backup (address creation and transactions)
- the keypool can be made larger (in some way that I haven't figured out how to do on my mac yet)
How I now think a deterministic wallet works:
- wallet.dat stores a seed or some other piece of info that determines all future key-pairs (based on the seed? that part might be beyond my current ability to understand)
- in the case of a corrupt wallet.dat, restoration from any backup, even the original, will restore your full address list, balance, and transaction history to the client, re-generating the "determined" keys and verifying against the block chain.
I think that's it. Am I completely far off? In the ballpark? Assuming I've got the basics down, further questions:
- How tested are deterministic wallets? Has the re-generation ever been shown to be incorrect?
- I assume that my current system backup is fine (I have 2 addresses and 3 transactions to date, not exactly a power user)?
Thanks in advance for any help.