From 24421925193cc2b702829dc92a3367ca28fe568e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 3 Jan 2022 22:32:57 +0000 Subject: [PATCH] ZIP 244: Change semantics of `sequence_sig_digest` Co-authored-by: Daira Hopwood --- zip-0244.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/zip-0244.rst b/zip-0244.rst index f210c98e..230cc1b9 100644 --- a/zip-0244.rst +++ b/zip-0244.rst @@ -531,8 +531,7 @@ S.2b: sequence_sig_digest This is a BLAKE2b-256 hash initialized with the personalization field value ``ZTxIdSequencHash``. -If the ``SIGHASH_ANYONECANPAY`` flag is not set, and the sighash type is neither -``SIGHASH_SINGLE`` nor ``SIGHASH_NONE``:: +If the ``SIGHASH_ANYONECANPAY`` flag is not set:: identical to the value of ``sequence_digest`` as specified for the transaction identifier in section T.2b. @@ -736,6 +735,17 @@ happens in the block that activates this ZIP. The block header byte format and version are not altered by this ZIP. +========= +Rationale +========= + +Several changes in this ZIP (relative to ZIP 243 [#zip-0243]_) were made to +align with BIP 341 [#bip-0341]_: + +- The semantics of ``sequence_sig_digest`` were changed, to commit to ``nSequence`` + even if ``SIGHASH_SINGLE`` or ``SIGHASH_NONE`` is set. The rationale for this + change is inherited from BIP 341 [#bip-0341-nSequence]_. + ======================== Reference implementation ======================== @@ -754,3 +764,5 @@ References .. [#zip-0143] `ZIP 143: Transaction Signature Validation for Overwinter `_ .. [#zip-0243] `ZIP 243: Transaction Signature Validation for Sapling `_ .. [#zip-0307] `ZIP 307: Light Client Protocol for Payment Detection `_ +.. [#bip-0341] `BIP 341: Taproot: SegWit version 1 spending rules `_ +.. [#bip-0341-nSequence] `Why does the signature message commit to all input nSequence if SIGHASH_SINGLE or SIGHASH_NONE are set? `_