summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Dashjr <luke_github1@dashjr.org>2020-08-20 22:22:06 +0000
committerGitHub <noreply@github.com>2020-08-20 22:22:06 +0000
commit9d44e594b0baa509f95609010c64ef2840da2233 (patch)
treec6bb1836c24b63383bd14339bbb9248009506523
parent76c3ced4b074866ffd3ae7bd28dbb96dd4cadd8a (diff)
parent25fe59882816d8e0c60a01999fe39c1eac1a667f (diff)
downloadbips-9d44e594b0baa509f95609010c64ef2840da2233.tar.xz
Merge pull request #970 from instagibbs/patch-12
BIP 342: be slightly more explicit about codesep_pos
-rw-r--r--bip-0342.mediawiki2
1 files changed, 1 insertions, 1 deletions
diff --git a/bip-0342.mediawiki b/bip-0342.mediawiki
index b337ea9..3cf87a3 100644
--- a/bip-0342.mediawiki
+++ b/bip-0342.mediawiki
@@ -110,7 +110,7 @@ To validate a signature ''sig'' with public key ''p'':
* Compute the tapscript message extension ''ext'', consisting of the concatenation of:
** ''tapleaf_hash'' (32): the tapleaf hash as defined in [[bip-0341.mediawiki#design|BIP341]]
** ''key_version'' (1): a constant value ''0x00'' representing the current version of public keys in the tapscript signature opcode execution.
-** ''codesep_pos'' (4): the opcode position of the last executed <code>OP_CODESEPARATOR</code> before the currently executed signature opcode, with the value in little endian (or ''0xffffffff'' if none executed). The first opcode in a script has a position of 0. A multi-byte push opcode is counted as one opcode, regardless of the size of data being pushed.
+** ''codesep_pos'' (4): the opcode position of the last executed <code>OP_CODESEPARATOR</code> before the currently executed signature opcode, with the value in little endian (or ''0xffffffff'' if none executed). The first opcode in a script has a position of 0. A multi-byte push opcode is counted as one opcode, regardless of the size of data being pushed. Opcodes in parsed but unexecuted branches count towards this value as well.
* If the ''sig'' is 64 bytes long, return ''Verify(p, hash<sub>TapSighash</sub>(0x00 || SigMsg(0x00, 1) || ext), sig)'', where ''Verify'' is defined in [[bip-0340.mediawiki#design|BIP340]].
* If the ''sig'' is 65 bytes long, return ''sig[64] &ne; 0x00 and Verify(p, hash<sub>TapSighash</sub>(0x00 || SigMsg(sig[64], 1) || ext), sig[0:64])''.
* Otherwise, fail.