Safer sighashes and more granular SIGHASH_NOINPUT



Summary:

In a Bitcoin development mailing list, Pieter Wuille proposed a combined proposal which includes three new sighash flags to be added: SIGHASH_NOINPUT, SIGHASH_NOFEE, and SIGHASH_SCRIPTMASK. A new opcode called OP_MASK is also expected to be added, which will act as a NOP during execution. SIGHASH is computed similarly to BIP143 with some differences, including the addition of scriptPubKey being spent to the sighash unless SIGHASH_SCRIPTMASK is set. The fee is also added to the sighash unless SIGHASH_NOFEE is set.SIGHASH_NONE should still be kept, according to one participant in the discussion, because it allows for the donation of dust UTXOs to miners. However, there was agreement that weird combinations like NOFEE|ALLINPUT|ALLOUTPUT should be refused to keep consensus logic simple. There was also a discussion on the complexity of OP_MASK and its usefulness only in avoidable edge cases. In contrast, committing to the scriptCode feels to reduce the "hackiness" of NOINPUT, but opinions were split, and the decision was not yet made. A suggestion was made to make it much simpler by using NOINPUT with or without SCRIPT.A proposal was also made to categorize input and output side options that affect the transaction's behavior, such as NONE, SINGLE, ALL_INPUTS, PARTIALSCRIPT, KNOWNSCRIPT, and KNOWNTX. There was agreement that some combinations like NOFEE|ALL|ALL_INPUTS would be peculiar and should be warned or even fail validation.


Updated on: 2023-05-20T18:00:49.252628+00:00