1

How do I manage my wallet and addresses when spending bitcoins?

For example, let's say I have address abcdefgh, and I have 10 Euros there. I read that when I buy something worth say 4 euros in bitcoins, I must then spend the rest on another unused address, zyxcvbnm, as the first address becomes unsafe or the change is lost in mining fees or something. It this true? Are all spends a double spend? For example, once for the item you want and once to your savings address?

1
  • Stop thinking in EUR! It's only complicating the question. Also: sending money to two addresses is not a double-spend. en.bitcoin.it/wiki/Double-spending
    – kaoD
    Commented Jan 10, 2014 at 21:09

2 Answers 2

4

I assume you're using Bitcoin-Qt, i.e. the reference implementation.

Bitcoin-Qt works with accounts, not addresses. The balance of your wallet is the sum of each account balance. The purpose of accounts is to compartmentalize payments in labels such as "Savings", "Salary", "Friends", etc. for your own convenience.

Each account has many Bitcoin addresses associated with it, though you'll only see one at a time (the last one). As soon as you get a payment in the displayed address, its address will change. You can still receive payments at that address, though that is considered bad practice due to anonimity issues.

Now to answer your question: "I read that when I buy something [...] I must then spend the rest to another unused address [...] as the first address becomes unsafe or the change is lost in mining fees or something."

Bitcoin works a bit different than money. A payment is:

  1. References to earlier payments you received (i.e. the sources of money)
  2. A list of pairs of (address + amount) (i.e. destinations)

When you reference an earlier payment you must spend it as a whole. You can't split it, like you wouldn't be able to split a 10€ bill in two 5€ bills.

For example: let's say you receive 10BTC payment. If you want to spend 1BTC you can't split it in 1BTC (paid) + 9BTC (left in address). You have to spend it all!

On the other hand, that's pretty much like paying 1BTC to someone else and sending 9BTC back to yourself. You could pay yourself to your original address, but Bitcoin-QT is smart enough to create a new (invisible to you) address which receives this change. The advantage of this "change address" is that I can no longer link your payment back to yourself:

Did you spend 1BTC and sent 9BTC as change, or perhaps spent 9BTC and sent 1BTC back as change? If you reused the same address, the change is obviously the one with the same address. If you let Bitcoin-Qt take care of it both will be new addresses and the money can't be traced back to you. This is what you meant with "the address becomes unsafe".

The key is: don't worry about this! Bitcoin-Qt will take care of all this for you! As long as you understand your accounts, addresses are disposable.

Now... what happens if Bitcoin-Qt somehow didn't send the change back to you? Imagine you just said "I want to send 1BTC out of this 10BTC" but Bitcoin-Qt forgets to send the change (this WON'T happen using Bitcoin-Qt, it's just a thought experiment).

Transaction fees are the difference between input and output, i.e. input - output. If somehow you only send 1BTC but forget to send back 9BTC of change to yourself, whoever mines this block will get the leftovers!

4
  • Thanks to you both - especially kaoD for the long answer. I was not using Bitcoin QT, but I think I under stand what you are trying to say because i do have litecoint-qt (but no money there yet). Commented Jan 10, 2014 at 23:02
  • For BitCoin I followed advice saying that a paper wallet is best as it cant be hacked. So I booted up livedvd of mint linux, stayed offline, printed 50 or so addresses using a saved copy of bitaddress.org. I have a few euros to test moving into some of these addresses. If I move 10 euros (0.0143603 BTC)to my first address then pay for something in a shop for 2 euros (0.00287414 BTC) then Do I manually need to spend the remainder to my saving address before the block gets mined which will happen inside 10 minutes. question mark. Commented Jan 10, 2014 at 23:16
  • I was trying ellectrum on linux but it feels too spartan for my taste. I dont have much confidence in trusting it to my cash at the moment. Commented Jan 10, 2014 at 23:19
  • I was also tring out multibit on windows but I dont have confidence that windows can remain secure - yes I do my online banking with windows but it has 3rd parrty security software, 3 passwords etc. Commented Jan 10, 2014 at 23:21
0

Think of it as spending a £10 note (or your local currency). You can only spend ALL the note, you can't give £2 of it to someone. What you can do is give them £2 and receive back £8 in a different form.

It's the same on bitcoin, you can only spend ALL the amount in an address. Some of that amount will go to the person you want to pay and some back to an address you control (as change). It's possible in theory to send the amount back to the original address but in practice wallets create a new address to send it to. (SOmething to do with security but I'm not sure what)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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