<p>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.</p>

<p>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).  </p>

<p>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.</p>

CC BY-SA 3.0
2013-12-24T17:07:48.633Z
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
CC BY-SA 3.0
2013-12-24T17:22:05.700Z
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
CC BY-SA 3.0
2013-12-24T20:14:00.153Z
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
CC BY-SA 3.0
2013-12-24T21:44:46.153Z
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
CC BY-SA 3.0
2013-12-26T13:03:59.743Z
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
CC BY-SA 3.0
2013-12-26T14:48:33.407Z
It is a single transaction with two outputs.  So, yes, the entire transaction will be in the block chain (anything not in the block chain doesn't count).  This is the reason that it is recommended to use a new address for each change return.  It makes it harder to associate an address with a person (and it also increases security somewhat).
ScripterRon
CC BY-SA 3.0
2013-12-24T15:18:01.960Z
2013-12-24T15:18:01.960Z
ScripterRon
<p>If I backup a wallet what exactly gets backed up? All the bit coin addresses associated with every transfer? </p>

<p>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)</p>

<wallet>
What is backed up from the wallet
user11286
# What is backed up from the wallet

(Asked by: username_0 on 2013-12-24)

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)

**Tags:** wallet


---

## 1 answers

### Answer by username_1 on 2013-12-24. Score: 2

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.

> **Comments:**
> **username_0**: 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?  
> **username_1**: 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).  
> **username_0**: 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?  
> **username_1**: 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.  
> **username_0**: 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?  
> **username_1**: It is a single transaction with two outputs.  So, yes, the entire transaction will be in the block chain (anything not in the block chain doesn't count).  This is the reason that it is recommended to use a new address for each change return.  It makes it harder to associate an address with a person (and it also increases security somewhat).  

---

