Here are the details.
- (Stone Man ) Bought 9,000 BTC on one of the exchanges over time.
- Transferred them to my client running on a linux live CD distro of Debian.
- Backed up the wallet file to a flash drive.
- Sent 1 BTC to myself
- Closed client before any confirmations
- Shut down system (wiped system disk loaded into memory and therefore the ./bitcoin folder
- Loaded system back up
- Copied old wallet.dat file into ./bitcoin folder
- After some confirmations appeared the balance was 1 BTC and there was a transaction saying I spent 8,900 BTC to an address I did not recognize
- I read on the forum threads that people have had problems like this but it seemed only when they were trying to double-spend by sending coins to another address and reloading an old wallet file
When you do a transaction you always spend ALL of the coins in that address, part of the money goes to whoever you’re paying, and there rest is returned to you an a new ‘change’ address. (This helps your anonymity as someone watching cannot tell which amount you spent and which amount you kept.)
- Before transaction:
- Address1: 9000
- Address2: 0
- After transaction:
- Address1: 0
- Address2: 1
- Address3: 8999 <- No backup, private key of this account NOT in his wallet
Today BTC uses a UTXO set, whenever you send a transaction, the unspent remainder, known as the change output, is saved to a separate address. Nowadays, that address automatically send back remaining sum to the sender.