Post
Topic
Board Bitcoin Discussion
Re: Solve this riddle
by
giszmo
on 01/03/2014, 03:18:36 UTC
Suppose I have 1 BTC.

I send my 1 BTC to an address XXX that has a balance of 50 BTC.

Next, 5 BTC are sent from XXX to YYY.

Where is my 1 BTC now? Does XXX or YYY have it?

Not sure if trolling but maybe it is educative to the one or the other:

In Bitcoin you don't spend coins or "from addresses" but "from transactions" (and miners may also spend new coins into existence).

This said, if the 1Ƀ was accumulated over time and the 50Ƀ in XXX were accumulated over time, they are really many transactions and not one address that you could spend.
Assume that XXX got transaction X1, X2 and X3.
Now that you send 1Ƀ there you create just another X4 and X1 – X4 are now spendable if you have the private key to XXX.
To send 5Ƀ from XXX to YYY you could send a new transaction Z1 consisting of X1 or X2 and X4 and if none of your addresses contains exactly 5Ƀ + fee, you end up with some left over that you could either send to a new address of yours, or back to YYY.

So bitcoins are actually never in addresses but in transactions and the private key of the recipient of the transaction can create new such transactions.