Sunday, December 22, 2024

Should enter UTXO references be distinctive in a transaction, and/or distinctive in a block?

Should enter UTXO references (txid + vout) be distinctive in a transaction, and/or be distinctive in a block?

UTXO ought to be distinctive, interval.
Having mentioned that, there was at the very least one case the place two totally different transactions (coinbase transactions on this case) had the identical txid. This was mounted by BIP34

Put one other method, is it a rule that UTXOs may be consumed piecemeal in transactions and blocks, as long as the entire quantity spent is <= to the UTXO’s quantity?

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

If a transaction was constructed by which totally different inputs referenced the identical UTXO, would the transaction be commonplace or legitimate?

It might be invalid: a UTXO can solely be spent as soon as.
If a transaction would use a UTXO twice as totally different inputs, that might imply it could be spending the UTXO twice, which it is not allowed.

If a block was constructed by which totally different inputs in several transactions use the identical UTXO, would the block be legitimate?

No, the block could be invalid, as a result of on this case the identical UTXO could be spent twice on totally different transactions. Keep in mind, a UTXO can solely be spent as soon as.

In each instances, let’s assume that the entire quantity consumed is lower than the UTXO whole.

When a UTXO is spent, it is spent in its entirety. It is not doable to spend a part of a UTXO. If the quantity you wish to spend is lower than the UTXO, you generate a brand new UTXO with the change.

Think about you’ve gotten 2 UTXOs, certainly one of 5.000 sats and the opposite of 6.000 sats, and also you and to pay me 7.000 sats. On this case, the transaction would have:

  • two inputs (the two UTXOs) with a complete of 11.000 sats
  • two outputs:
    • one locked to my public key (my fee), of seven.000 sats
    • one locked to your public key (your change) of 4.000 sats

The 2 preliminary UTXOs are actually spent and you may neglect about them.
Now there are 2 new UTXOs:

  • mine UTXO of seven.000 sats
  • your UTXO of 4.000 sats

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles