Thursday, December 26, 2024

transactions – SIGHASH mediated tx modification

With SIGHASH_ALL, Alice’s signature commits to ALL outputs, which implies if Bob adjustments or provides outputs to the tx, Alice’s signature will change into invalid. This implies Bob has no incentive so as to add an enter to this transaction (until Bob desires to ship some sats to miners).

For the remainder of the reply, I’ll assume you meant SIGHASH_NONE or SIGHASH_SINGLE, i.e. Bob is ready to re-use Alice’s signature whereas altering or including outputs.

Does this new transaction substitute the previous one within the mempool? Is it added individually?

By including a brand new enter, the hash of the serialized transaction will change (i.e. the transaction id), which implies it is going to be a brand new transaction on the mempool. At the moment, nodes will determine two transactions spending the identical UTXO (Alice’s enter) and can choose one in all them (in precept the one which pays extra charges to the miners). The opposite one will probably be discarded.

Additionally what does that imply for spenders of the unique tx_out1 Alice constructed if the latter is the case?

Is dependent upon the SIGHASH utilized by Alice in her signature:

  • SIGHASH_NONE: the output might be modified or eliminated
  • SIGHASH_SINGLE: the output should stay as is within the transaction

Wouldn’t that second transaction create one other UTXO which means the spender can create a tx_in that will have two decisions of UTXOs to reference?

No, an UTXO can solely be spent as soon as, so you can not have 2 transactions spending the identical UTXO.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles