Author: Gregory Maxwell 2018-07-02 18:23:48
Published on: 2018-07-02T18:23:48+00:00
In a message to the bitcoin-dev mailing list, Johnson Lau explained how different values in hashtype affect the signature and certain parameters in a transaction. For example, if bit 0 to 3 of hashtype is 1, the signature is invalid; if it is 7 or below, outpoint is the COutPoint of the current input; if it is even (including 0), nSequence is the nSequence of the current input; if it is 11 or below, nAmount is the value of the current input. Additionally, bit 4 and 5 denote a value between 0 and 3, which affects hashOutputs, and bit 6-9 set certain parameters such as nFees, nLockTime, nVersion, and scriptCode. The post did not capture SIGHASH_SINGLE | SIGHASH_LAST_OUTPUT, which allows for signing both a change output and joint-payment output, often used in "kickstarter" joint-payment transactions.
Updated on: 2023-05-20T16:39:26.054133+00:00