<ul>
<li><p>Multiple outputs are usual, just like e-mail.</p></li>
<li><p>If one of your friends has sent you 5 BTC, and another friend has sent you 2 BTC, you should combine and spend them if you need to buy something for less than 7 BTC and greater than 5 BTC.</p></li>
</ul>

<p>(By the way, do you know what a <a href="https://bitcoin.stackexchange.com/q/736/38618">change</a> is?)</p>

<ul>
<li>There is no "This output gets its value from this input" All input values are summed, then spent.</li>
</ul>

CC BY-SA 3.0
2018-03-18T07:18:24.357Z
Thank you for the link to Change. I was aware of it, but the link provided a much better explanation.

If all inputs are summed, do we assume that all inputs are from the same account holder/entity?
EvilJordan
CC BY-SA 3.0
2018-03-18T07:37:09.627Z
@EvilJordan No, take a look at [SIGHASH_SINGLE](https://bitcoin.org/en/glossary/sighash-single). It's how CoinJoin works. For more information: https://en.bitcoin.it/wiki/CoinJoin
MCCCS
CC BY-SA 3.0
2018-03-18T07:57:46.667Z
Thanks for walking me through this. I thought I understood how this worked, but it's suddenly become a lot more complex. So, from what I gather, if Bob has 2 BTC and wants to send Alice 1 BTC, somehow Tom, with his 1 BTC he wants to go to Jane can also get in the mix, and a transaction will show two inputs (Bob:2, Tom:1) and three outputs (Alice:1,Bob(change):1,Jane:1). I guess my question is how did Tom's transaction to Jane end up in the mix? Is the software doing that to save on bandwidth?
EvilJordan
CC BY-SA 3.0
2018-03-18T08:33:55.013Z
@EvilJordan Oops, CoinJoin uses SIGHASH_ALL. If you're looking for how CoinJoin works, here's the answer. https://bitcoin.stackexchange.com/a/57276/38618
MCCCS
CC BY-SA 3.0
2018-03-18T17:46:41.683Z
Did you initially bring up CoinJoin because this particular transaction I referenced is using it? Seems like a very niche service.
EvilJordan
CC BY-SA 3.0
2018-03-18T05:43:52.037Z
2018-03-18T05:43:52.037Z
MCCCS
<p>I know this is a BCH address, but it's the best example I could find. The same concept holds for BTC, so understanding what's going on is relevant.</p>

<p><a href="https://explorer.bitcoin.com/bch/tx/5d0af59f43f8e8388839518243c743279e7c3dd526385fcc5bbcd907cd61bd2a" rel="nofollow noreferrer">https://explorer.bitcoin.com/bch/tx/5d0af59f43f8e8388839518243c743279e7c3dd526385fcc5bbcd907cd61bd2a</a></p>

<p>What one sees is one transactions with two inputs and two outputs.</p>

<ol>
<li>How does it happen that there are multiple inputs/outputs in a transaction?</li>
<li>How did <code>12WsyKG89bxTGWV1iguxPWh6UX2ye1X8hD</code> end up with 208.448 and <code>18Q43boBRU8Sk57SjSfjgFbjvXhBccBrKq</code> with 18.816 - where in that transactional data does it specify which address gets what from the inputs?</li>
</ol>

<transactions><bitcoin-cash><output><transaction-input>
Could someone explain how the TX operation here works?
EvilJordan
# Could someone explain how the TX operation here works?

(Asked by: username_0 on 2018-03-18)

I know this is a BCH address, but it's the best example I could find. The same concept holds for BTC, so understanding what's going on is relevant.

<https://explorer.bitcoin.com/bch/tx/5d0af59f43f8e8388839518243c743279e7c3dd526385fcc5bbcd907cd61bd2a>

What one sees is one transactions with two inputs and two outputs.

1. How does it happen that there are multiple inputs/outputs in a transaction?
2. How did `12WsyKG89bxTGWV1iguxPWh6UX2ye1X8hD` end up with 208.448 and `18Q43boBRU8Sk57SjSfjgFbjvXhBccBrKq` with 18.816 - where in that transactional data does it specify which address gets what from the inputs?

**Tags:** transactions, bitcoin-cash, output, transaction-input


---

## 1 answers

### Answer by username_1 on 2018-03-18. Score: 2

* Multiple outputs are usual, just like e-mail.
* If one of your friends has sent you 5 BTC, and another friend has sent you 2 BTC, you should combine and spend them if you need to buy something for less than 7 BTC and greater than 5 BTC.

(By the way, do you know what a [change](https://bitcoin.stackexchange.com/q/736/38618) is?)

* There is no "This output gets its value from this input" All input values are summed, then spent.

> **Comments:**
> **username_0**: Thank you for the link to Change. I was aware of it, but the link provided a much better explanation.  If all inputs are summed, do we assume that all inputs are from the same account holder/entity?  
> **username_1**: @username_0 No, take a look at [SIGHASH_SINGLE](https://bitcoin.org/en/glossary/sighash-single). It's how CoinJoin works. For more information: https://en.bitcoin.it/wiki/CoinJoin  
> **username_0**: Thanks for walking me through this. I thought I understood how this worked, but it's suddenly become a lot more complex. So, from what I gather, if Bob has 2 BTC and wants to send Alice 1 BTC, somehow Tom, with his 1 BTC he wants to go to Jane can also get in the mix, and a transaction will show two inputs (Bob:2, Tom:1) and three outputs (Alice:1,Bob(change):1,Jane:1). I guess my question is how did Tom's transaction to Jane end up in the mix? Is the software doing that to save on bandwidth?  
> **username_1**: @username_0 Oops, CoinJoin uses SIGHASH_ALL. If you're looking for how CoinJoin works, here's the answer. https://bitcoin.stackexchange.com/a/57276/38618  
> **username_0**: Did you initially bring up CoinJoin because this particular transaction I referenced is using it? Seems like a very niche service.  

---

