If I backup a wallet what exactly gets backed up? All the bit coin addresses associated with every transfer?

If so does that imply if I "lose" a bit coin address that my final balance will be incorrect (since one's balance is calculated as the sum of transfers IN less the sum of transfers OUT)


Transactions are stored in the block chain, so you never lose them. However, if you lose the private key associated with an unspent output, then you can never spend it. So it is important to always back up your private keys (the public key and bitcoin address can be derived from just the private key). When you import a private key into a new wallet, the wallet will scan the block chain looking for transactions that match the associated bitcoin address. These transactions will then appear in your wallet without any further action on your part.

Some wallets use discrete private keys, which means you must backup the wallet each time a new private key is generated. For example, Bitcoin-Qt keeps a pool of 100 new private keys, so you only need to backup the wallet after every 100 send requests (since change is returned to a new private key).

Deterministic wallets only need to be backed up once since they generate new keys using a stored seed. If you need to restore the wallet, the private keys can be regenerated from this seed. Electrum is an example of a deterministic wallet.

| improve this answer | |
  • I noticed that every transaction has multiple inputs (the outputs of the previous transaction) and multiple outputs. I presume an "unspent output" means the sum_of_outputs < sum_of_inputs? – user11286 Dec 24 '13 at 17:07
  • No, an unspent output is an output that hasn't been included as an input in a later transaction. So, at any given point in time, a transaction can have a mix of spent and unspent outputs. And it isn't necessary to have multiple inputs as long as the single input is large enough to cover the outputs plus the miner fee. The simplest case is a transaction with one input and two outputs. One output goes to the designated recipient and the second output returns the change to your wallet (a transaction completely spends all of its inputs). – ScripterRon Dec 24 '13 at 17:22
  • OK so if I have a transaction with 1 input (of 1 BTC) and zero outputs and I need to pay someone 0.9BTC...the system will create 2 outputs of 1BTC to the B party and another output of 0.1 BTC that goes back as an input to this particular transaction? Why not just one output of 0.9 BTC to the B party? – user11286 Dec 24 '13 at 20:14
  • You can't have a transaction with 0 outputs. If you need to send 0.9 BTC, the wallet code will look for one or more unspent outputs belonging to one of your addresses until the total covers the 0.9 BTC plus the miner fee. These will be the inputs for the new transaction. The transaction will then have one output to send the 0.9 BTC. If there is any change left from the sum of the inputs, there will be a second output to return the change back to an address in your wallet. – ScripterRon Dec 24 '13 at 21:44
  • OK now I am starting to understand :) will the second output to return change also go onto the block chain or is it just an internal transfer to one of my existing addresses? – user11286 Dec 26 '13 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.