# Why do transactions send coins to the same address as they spent it from?

I often notice transactions such as:

364efe5a906de5971e242f9711008e58a5ab79f136a8044b66615e8662d35f09

Where funds from the address `3PU` with 1.38 BTC are split to itself (1.35 BTC) and `37Ek` (0.027BTC):

``````3PUui (1.38 BTC) -> 37Ekc (0.0278 BTC)
-> 3Puui (1.3519 BTC)
``````

I am wondering why the transaction doesn't look like:

``````3PUui (0.0279 BTC) -> 37Ekc (0.0278 BTC)
``````

I read from this question that an input must be completely consumed in the transaction, so if I have received 1.35 BTC during the last transaction, if I refer to it, I must consume the 1.35 BTC.

However on https://coinb.in/#newTransaction I can see the amount can be specified for each input. So why should I need to mention the input amount if it is already set by the previous transaction?

## 1 Answer

Likely the sender didn't have an unspent output that had exactly the amount he wanted to send. So he choose an unspent output that had enough and sent the remainder back to himself.

Accounts do not automatically combine the funds they receive. They have a bundle of unspent transaction outputs which they can only use by completely consuming them.

You might ask the same question if you see a person pay with a \$10 bill and get a \$5 bill back. You might wonder why they didn't just pay with a \$5 bill. Well, probably it's because they didn't have one, so they got a \$5 bill back as change. Essentially, each of the transactions you have received remains available to you as an input to a future transaction. But using an output as an input consumes it, so if it has too much, you send the remains back to yourself as "change".

• Good analogy with bills. – Zepplock Feb 6 '17 at 22:38