CheckTemplateVerify Does Not Scale Due to UTXO's Required For Fee Payment

CheckTemplateVerify Does Not Scale Due to UTXO's Required For Fee Payment

Original Postby Anthony Towns

Posted on: January 30, 2024 05:55 UTC

The discussion revolves around the specifics of BIP 118 as it stood in March 2021 and its relation to BIP 143 within the context of transaction digest algorithms used in Bitcoin.

BIP 118 proposed a change to the way signatures are verified by modifying certain aspects of the transaction digest algorithm originally defined in BIP 143.

In particular, BIP 118, at that time, had introduced the SIGHASH_NOINPUT signature type which omits certain elements from the transaction digest computation. Under this proposal, both the hashPrevouts and hashSequence, which are typically included as part of the transaction digest, were set to 32 bytes of zeros. Additionally, the outpoint was specified as 36 bytes of zeros and the scriptCode of the input was an empty script. These modifications signify that NOINPUT signatures do not commit to the previous outputs or the sequence numbers of other inputs.

BIP 143, on the other hand, established a new transaction digest algorithm applicable specifically to version 0 witness programs. This algorithm includes double SHA256 serialization of various components such as hashPrevouts, hashSequence, outpoint, and scriptCode of the input. Notably, BIP 143 also encompasses the nSequence of the input, indicating that with the implementation of the proposal mentioned, the nSequence would still be committed to even if the hashSequence were dropped.

The removal of hashSequence is highlighted as a removal of the commitment to other inputs being spent by the transaction, which is a significant detail when considering the implications on transaction malleability and flexibility.