1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-01-18 21:35:13 +01:00

Merge pull request #1141 from sanket1729/patch-3

BIP118: Key version should be 0x01
This commit is contained in:
kallewoof 2021-07-12 21:23:26 +09:00 committed by GitHub
commit 99701f68a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,8 +131,8 @@ Note that if ''hash_type & 0x40'' is zero, ''SigMsg118(hash_type,ext_flag) == Si
To verify a signature ''sig'' for a BIP 118 public key ''p'':
* If the ''sig'' is 64 bytes long, return ''Verify(p, hash<sub>TapSigHash</sub>(0x00 || SigMsg118(0x00, 1) || SigExt118(0x00, 0x02), sig)'', where ''Verify'' is defined in [[bip-0340.mediawiki|BIP 340]].
* If the ''sig'' is 65 bytes long, return ''sig[64] &ne; 0x00 and Verify(p, hash<sub>TapSighash</sub>(0x00 || SigMsg118(sig[64], 1) || SigExt118(sig[64], 0x02), sig[0:64])''.
* If the ''sig'' is 64 bytes long, return ''Verify(p, hash<sub>TapSigHash</sub>(0x00 || SigMsg118(0x00, 1) || SigExt118(0x00, 0x01), sig)'', where ''Verify'' is defined in [[bip-0340.mediawiki|BIP 340]].
* If the ''sig'' is 65 bytes long, return ''sig[64] &ne; 0x00 and Verify(p, hash<sub>TapSighash</sub>(0x00 || SigMsg118(sig[64], 1) || SigExt118(sig[64], 0x01), sig[0:64])''.
* Otherwise, fail.
The key differences from [[bip-0342.mediawiki|BIP 342]] signature verification are: