<blockquote>
<p>Must input UTXO references (txid + vout) be unique in a transaction, and/or be unique in a block?</p>
</blockquote>
<p>UTXO should be unique, period.
Having said that, there was at least one case where two different transactions (coinbase transactions in this case) had the same txid. This was fixed by BIP34</p>
<blockquote>
<p>Put another way, is it a rule that UTXOs can be consumed piecemeal in transactions and blocks, so long as the total amount spent is &lt;= to the UTXO's amount?</p>
</blockquote>
<p>UTXOs are consumed (or spent) in transactions.
Blocks register transactions.</p>
<blockquote>
<p>If a transaction was constructed in which different inputs referenced the same UTXO, would the transaction be standard or valid?</p>
</blockquote>
<p>It would be invalid: a UTXO can only be spent once.
If a transaction would use a UTXO twice as different inputs, that would mean it would be spending the UTXO twice, which it's not allowed.</p>
<blockquote>
<p>If a block was constructed in which different inputs in different transactions use the same UTXO, would the block be valid?</p>
</blockquote>
<p>No, the block would be invalid, because in this case the same UTXO would be spent twice on different transactions. Remember, a UTXO can only be spent once.</p>
<blockquote>
<p>In both cases, let's assume that the total amount consumed is less than the UTXO total.</p>
</blockquote>
<p>When a UTXO is spent, it's spent in its entirety. It's not possible to spend part of a UTXO. If the amount you want to spend is less than the UTXO, you generate a new UTXO with the change.</p>
<p>Imagine you have 2 UTXOs, one of 5.000 sats and the other of 6.000 sats, and you want to pay me 7.000 sats. In this case, the transaction would have:</p>
<ul>
<li>two inputs (the 2 UTXOs) with a total of 11.000 sats</li>
<li>two outputs:
<ul>
<li>one locked to my public key (my payment), of 7.000 sats</li>
<li>one locked to your public key (your change) of 4.000 sats</li>
</ul>
</li>
</ul>
<p>The two initial UTXOs are now spent and you can forget about them.
Now there are 2 new UTXOs:</p>
<ul>
<li>mine UTXO of 7.000 sats</li>
<li>your UTXO of 4.000 sats</li>
</ul>

CC BY-SA 4.0
2024-05-10T08:40:53.097Z
2024-05-10T15:40:49.290Z
2024-05-10T15:40:49.290Z
bordalix
<p>Must input UTXO references (txid + vout) be unique in a transaction, and/or be unique in a block?</p>
<p>Put another way, is it a rule that UTXOs can be consumed piecemeal in transactions and blocks, so long as the total amount spent is &lt;= to the UTXO's amount?</p>
<p>If a transaction was constructed in which different inputs referenced the same UTXO, would the transaction be standard or valid?</p>
<p>If a block was constructed in which different inputs in different transactions use the same UTXO, would the block be valid?</p>
<p>In both cases, let's assume that the total amount consumed is less than the UTXO total.</p>

<transactions><block><utxo>
Must input UTXO references be unique in a transaction, and/or unique in a block?
Lee
# Must input UTXO references be unique in a transaction, and/or unique in a block?

(Asked by: username_0 on 2024-05-10)

Must input UTXO references (txid + vout) be unique in a transaction, and/or be unique in a block?

Put another way, is it a rule that UTXOs can be consumed piecemeal in transactions and blocks, so long as the total amount spent is <= to the UTXO's amount?

If a transaction was constructed in which different inputs referenced the same UTXO, would the transaction be standard or valid?

If a block was constructed in which different inputs in different transactions use the same UTXO, would the block be valid?

In both cases, let's assume that the total amount consumed is less than the UTXO total.

**Tags:** transactions, block, utxo


---

## 1 answers

### Answer by username_1 on 2024-05-10. Score: 2 | Accepted answer

> Must input UTXO references (txid + vout) be unique in a transaction, and/or be unique in a block?

UTXO should be unique, period.
Having said that, there was at least one case where two different transactions (coinbase transactions in this case) had the same txid. This was fixed by BIP34

> Put another way, is it a rule that UTXOs can be consumed piecemeal in transactions and blocks, so long as the total amount spent is <= to the UTXO's amount?

UTXOs are consumed (or spent) in transactions.
Blocks register transactions.

> If a transaction was constructed in which different inputs referenced the same UTXO, would the transaction be standard or valid?

It would be invalid: a UTXO can only be spent once.
If a transaction would use a UTXO twice as different inputs, that would mean it would be spending the UTXO twice, which it's not allowed.

> If a block was constructed in which different inputs in different transactions use the same UTXO, would the block be valid?

No, the block would be invalid, because in this case the same UTXO would be spent twice on different transactions. Remember, a UTXO can only be spent once.

> In both cases, let's assume that the total amount consumed is less than the UTXO total.

When a UTXO is spent, it's spent in its entirety. It's not possible to spend part of a UTXO. If the amount you want to spend is less than the UTXO, you generate a new UTXO with the change.

Imagine you have 2 UTXOs, one of 5.000 sats and the other of 6.000 sats, and you want to pay me 7.000 sats. In this case, the transaction would have:

* two inputs (the 2 UTXOs) with a total of 11.000 sats
* two outputs:
  + one locked to my public key (my payment), of 7.000 sats
  + one locked to your public key (your change) of 4.000 sats

The two initial UTXOs are now spent and you can forget about them.
Now there are 2 new UTXOs:

* mine UTXO of 7.000 sats
* your UTXO of 4.000 sats


---

