0

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.

1 Answer 1

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.