<h3>Short answer</h3>
<p>Your questions, in order: Yes. Yes. No.</p>
<h3>Long answer</h3>
<p>When spending the output of a transaction, it is not enough to know the txid. You also need to know the index of the output. (In other words, whether it is the first, second, third, etc. output.)</p>
<p>The hash of the transaction you're spending and the index of the output you're spending is collectively known as an <em>outpoint</em>.</p>
<p><a href="https://en.bitcoin.it/wiki/Protocol_specification#tx" rel="nofollow noreferrer">Quoting the Bitcoin wiki:</a></p>
<blockquote>
<p>The OutPoint structure consists of the following fields:</p>
<ul>
<li>Field Size: 32<br />
Description: hash<br />
Data Type: char[32]<br />
The hash of the referenced transaction.</li>
<li>Field Size: 4 bytes<br />
Description: index<br />
Data Type: uint32_t<br />
The index of the specific output in the transaction. The first output is 0, etc.</li>
</ul>
</blockquote>
<p>See also the <a href="https://bitcoin.org/en/glossary/outpoint" rel="nofollow noreferrer">bitcoin.org docs</a>.</p>

CC BY-SA 3.0
2014-11-27T04:33:19.707Z
Thank you very much, Nick. Also thank you for correcting my English. I consume a node first got tx2 and then got tx3. When the node check tx3 is valid or not, it found it already had a trasanction tx2, which already used tx1.hash. would it continue to check the index of output ? If it found also t3 and t2 use the same index of output. It mark the tx3 as invalid? Am I correct?
Eleven
CC BY-SA 3.0
2014-11-27T04:43:33.547Z
@Eleven Yes. Two transactions that spend the same outpoint cannot both be valid. The first one is valid, and the second is invalid. (However, if the second one got into the blockchain, it would be valid and the first would be invalid. This could happen if another node saw the second one before the first one.)
Nick ODell
CC BY-SA 3.0
2014-11-27T04:16:40.613Z
2016-09-09T03:03:49.293Z
2020-06-16T11:10:03.350Z
Nick ODell
<p>I am reading the transaction part. I don't know how to get the transaction hash. Does the whole transaction (include its vins and vouts) get hashed?</p>

<p>If a transaction has two vouts (spent by different transaction tx2 and t3), when t2 and t3 spent the vout, they will get the same prevout hash. Is that correct? </p>

<p>For example:</p>

<pre><code>tx1:  tx1_out1  --------&gt; node_A ----tx2(using tx1_out1)---&gt; 
      tx1_out2  --------&gt; node_B ----tx3(using tx1_out2)---&gt;  
</code></pre>

<p>Will tx2 and tx3 have conflicts, since tx1_out1 and tx1_out2 are spending the same hash?</p>

<transactions>
Can two outputs from the same transaction be spent separately?
Eleven
# Can two outputs from the same transaction be spent separately?

(Asked by: username_0 on 2014-11-27)

I am reading the transaction part. I don't know how to get the transaction hash. Does the whole transaction (include its vins and vouts) get hashed?

If a transaction has two vouts (spent by different transaction tx2 and t3), when t2 and t3 spent the vout, they will get the same prevout hash. Is that correct?

For example:

```
tx1:  tx1_out1  --------> node_A ----tx2(using tx1_out1)---> 
      tx1_out2  --------> node_B ----tx3(using tx1_out2)--->  

```

Will tx2 and tx3 have conflicts, since tx1\_out1 and tx1\_out2 are spending the same hash?

**Tags:** transactions


---

## 1 answers

### Answer by username_1 on 2014-11-27. Score: 5

### Short answer

Your questions, in order: Yes. Yes. No.

### Long answer

When spending the output of a transaction, it is not enough to know the txid. You also need to know the index of the output. (In other words, whether it is the first, second, third, etc. output.)

The hash of the transaction you're spending and the index of the output you're spending is collectively known as an *outpoint*.

[Quoting the Bitcoin wiki:](https://en.bitcoin.it/wiki/Protocol_specification#tx)

> The OutPoint structure consists of the following fields:
>
> * Field Size: 32  
>   Description: hash  
>   Data Type: char[32]  
>   The hash of the referenced transaction.
> * Field Size: 4 bytes  
>   Description: index  
>   Data Type: uint32\_t  
>   The index of the specific output in the transaction. The first output is 0, etc.

See also the [bitcoin.org docs](https://bitcoin.org/en/glossary/outpoint).

> **Comments:**
> **username_0**: Thank you very much, username_1. Also thank you for correcting my English. I consume a node first got tx2 and then got tx3. When the node check tx3 is valid or not, it found it already had a trasanction tx2, which already used tx1.hash. would it continue to check the index of output ? If it found also t3 and t2 use the same index of output. It mark the tx3 as invalid? Am I correct?  
> **username_1**: @username_0 Yes. Two transactions that spend the same outpoint cannot both be valid. The first one is valid, and the second is invalid. (However, if the second one got into the blockchain, it would be valid and the first would be invalid. This could happen if another node saw the second one before the first one.)  

---

