Published on: 2022-07-03T05:45:48+00:00
In a Bitcoin-dev mailing list, there is a proposal being discussed to control transaction flow by introducing new SIGHASH flags. The proposal suggests using these flags to apply sighashes to the previous transaction and create a stable txid, even if new inputs and outputs are added. This would allow for better control over transaction flow when using different sighashes like SIGHASH_SINGLE|SIGHASH_ANYONECANPAY. Currently, the Core client signs everything with SIGHASH_ALL by default, but the proposal suggests changing this behavior and proposing different sighashes based on the created transaction.The proposal also suggests displaying the transaction in a way that is visible in block explorers. Inputs and outputs would be highlighted or grayed out based on the selected sighashes, making it easier for users to control them. This would provide users with more control over the flow of transactions and ensure the stability of the txid.Another proposal made by John Law on the bitcoin-dev mailing list suggests using new sighash flags to calculate a transaction ID (txid) and have more control over the input and output of transactions. Currently, txid:vout is used as a previous transaction output to prevent modifications. However, with the introduction of SIGHASH_PREVOUT_XYZ flags, it would be possible to use different types of sighashes to commit to specific fields of the previous transaction output.For example, using SIGHASH_PREVOUT_SINGLE would allow the addition of new outputs to the previous transaction without affecting the replaced txid. On the other hand, using SIGHASH_PREVOUT_NONE would not check any outputs of the previous transaction but would still check the inputs. By applying sighashes to the previous transaction, instead of allowing for any transaction, there would be more control over the txid, ensuring that signatures sign what is intended and are not invalidated by changes unrelated to the currently-checked signature.The proposal suggests defaulting to SIGHASH_PREVOUT_ALL, but the three SIGHASH_PREVOUT_XYZ flags could also be combined with SIGHASH_PREVOUT_ANYONECANPAY to discard all inputs except for the input number matching "vout". Overall, the proposal aims to provide better control over the flow of transactions and ensure the stability of the txid.In summary, the use of SIGHASH_PREVOUT_XYZ flags would allow for greater control over transaction flow and create a stable txid. By applying sighashes to the previous transaction, users can ensure that signatures sign what is intended and prevent invalidation due to changes in unrelated inputs and outputs. The proposal suggests defaulting to SIGHASH_PREVOUT_ALL but also provides options for different combinations of flags to achieve specific control over transactions.
Updated on: 2023-08-02T06:28:20.828027+00:00