I find it difficult to reason about as-written, even if implicitly it may be correct.
cc @ajtowns
I find it difficult to reason about as-written, even if implicitly it may be correct.
cc @ajtowns
I find it difficult to reason about as-written, even if implicitly it may be correct.
81@@ -82,7 +82,7 @@ We define the following constants using bits 6 and 7 of <code>hash_type</code>:
82 * <code>SIGHASH_ANYPREVOUT = 0x40</code>
83 * <code>SIGHASH_ANYPREVOUTANYSCRIPT = 0xc0</code>
84
85-As per [[bip-0341.mediawiki|BIP 341]], the parameter ''ext_flag'' is an integer in the range 0-127, used for indicating that extensions are added at the end of the message. The parameter ''key_version'' is an 8-bit unsigned value (an integer in the range 0-255) used for committing to the public key version.
86+As per [[bip-0341.mediawiki|BIP 341]], the parameter ''ext_flag'' is an integer in the range 0-127, used for indicating that extensions are added at the end of the message, with the value of ''0'' indicating no extension, and ''1'' indicating the presence of ''SigExt118(hash_type,key_version)''. The parameter ''key_version'' is an 8-bit unsigned value (an integer in the range 0-255) used for committing to the public key version.
What it’s intending to describe is:
SigMsg
behaviour is covered by SigMsg(h,0) = SigMsg118((h & ~0x40), 0)
SigMsg(h, 1) = SigMsg118((h & ~0x40), 1)
and ext = SigExt118(h, 0)
SigMsg118((h | 0x40), 1)
and SigExt118(h, 1)
But maybe it would be better to change it entirely, and describe it more like:
sig
is not 64 or 65 bytes, fail.sig
is 64 bytes:
hash_type = 0
sig_data = sig
sig
is 65 bytes:
hash_type = sig[64]
. If hash_type == 0
, fail.sig_data = sig[0:64]
Verify(p, hash<sub>TapSigHash</sub>(0x00 || msg_and_ext, sig_data)
where Verify
is as defined in BIP 340, and where msg_and_ext
is defined as:
hash_type & 0x40 = 0
, msg = SigMsg(hash_type, 1)
per BIP341.hash_type & 0x40 != 0
, msg = SigMsg118(hash_type)
as “above”.msg_and_ext = msg || Ext118(hash_type)
as “above”.Then the definition of SigMsg118
only needs to deal with ANYPREVOUT signatures, and Ext118
can hard code key version 0x01.
Yes
On Fri, Oct 7, 2022, 4:39 AM Anthony Towns @.***> wrote:
#1367 https://github.com/bitcoin/bips/pull/1367 was merged, so I guess this can be closed?
— Reply to this email directly, view it on GitHub https://github.com/bitcoin/bips/pull/1335#issuecomment-1271296927, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMAFUYOFHNOJZTF5L6E2ETWB7OVTANCNFSM5ZQS3W5A . You are receiving this because you authored the thread.Message ID: @.***>