Wednesday, July 3, 2024

transactions – SIGHASH mediated tx modification

With SIGHASH_ALL, Alice’s signature commits to ALL outputs, which implies if Bob modifications or provides outputs to the tx, Alice’s signature will develop into invalid. This implies Bob has no incentive so as to add an enter to this transaction (except Bob needs 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 change 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 will likely 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 considered one of 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 determined by the SIGHASH utilized by Alice in her signature:

  • SIGHASH_NONE: the output may 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 might 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