<p>A transaction can have multiple inputs, so any of the scenarios you describe are possible.</p>

<p>Let's call David's transaction to Alice T, and its outputs T0 and T1.  Here are three ways Alice could make a transaction to achieve the desired results.</p>

<ul>
<li><p>One input: T0.  Two outputs: 5 BTC to Eve, 5 BTC to Alice.  (In this case T1 remains available for Alice to spend in some future transaction.)</p></li>
<li><p>One input: T1.  Two outputs: 5 BTC to Eve, 15 BTC to Alice.  (T0 remains unspent.)</p></li>
<li><p>Two inputs: T0 and T1.  Two outputs: 5 BTC to Eve, 25 BTC to Alice. </p></li>
</ul>

CC BY-SA 3.0
2015-02-13T18:17:00.813Z
2015-02-13T18:17:00.813Z
Nate Eldredge
<p>I have read that entire bitcoins received in one transaction have to be spend in other transaction. The actual amount to be transferred is deducted from the total bitcoins and the change is returned back to sender's bitcoin address.</p>

<p>Suppose, David Sends Alice the amount in form of two outputs, output0: 10 bitcoins and output1: 20 bitcoins in the same transaction. Now Alice wants to transfer 5 bitcoin to Eve. Does Alice has to spend entire 30 bitcoins, by transfering 5 to Eve and remaining 25 to herself?</p>

<p>Or can she choose any of the output e.g. output0: 10, transfer 5 bitcoins to Eve and change 5 bitcoins to herself? If this is the case, how is this tracked, as the hash of the David's transaction can be used to spend the output1: 20 bitcoins.</p>

<transactions>
Transaction with multiple outputs
Curious
# Transaction with multiple outputs

(Asked by: username_0 on 2015-02-13)

I have read that entire bitcoins received in one transaction have to be spend in other transaction. The actual amount to be transferred is deducted from the total bitcoins and the change is returned back to sender's bitcoin address.

Suppose, David Sends Alice the amount in form of two outputs, output0: 10 bitcoins and output1: 20 bitcoins in the same transaction. Now Alice wants to transfer 5 bitcoin to Eve. Does Alice has to spend entire 30 bitcoins, by transfering 5 to Eve and remaining 25 to herself?

Or can she choose any of the output e.g. output0: 10, transfer 5 bitcoins to Eve and change 5 bitcoins to herself? If this is the case, how is this tracked, as the hash of the David's transaction can be used to spend the output1: 20 bitcoins.

**Tags:** transactions


---

## 1 answers

### Answer by username_1 on 2015-02-13. Score: 1

A transaction can have multiple inputs, so any of the scenarios you describe are possible.

Let's call David's transaction to Alice T, and its outputs T0 and T1. Here are three ways Alice could make a transaction to achieve the desired results.

* One input: T0. Two outputs: 5 BTC to Eve, 5 BTC to Alice. (In this case T1 remains available for Alice to spend in some future transaction.)
* One input: T1. Two outputs: 5 BTC to Eve, 15 BTC to Alice. (T0 remains unspent.)
* Two inputs: T0 and T1. Two outputs: 5 BTC to Eve, 25 BTC to Alice.


---

