1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-05-11 16:51:51 +00:00

BIP342: Fix anchor links

This commit is contained in:
Murch
2026-02-27 13:34:25 -08:00
parent 5137d59442
commit 32b7adf847

View File

@@ -47,8 +47,8 @@ Additionally, the new tapscript <code>OP_SUCCESS</code> opcodes allow introducin
The rules below only apply when validating a transaction input for which all of the conditions below are true:
* The transaction input is a '''segregated witness spend''' (i.e., the scriptPubKey contains a witness program as defined in [[bip-0141.mediawiki|BIP141]]).
* It is a '''taproot spend''' as defined in [[bip-0341.mediawiki#user-content-design|BIP341]] (i.e., the witness version is 1, the witness program is 32 bytes, and it is not P2SH wrapped).
* It is a '''script path spend''' as defined in [[bip-0341.mediawiki#user-content-design|BIP341]] (i.e., after removing the optional annex from the witness stack, two or more stack elements remain).
* It is a '''taproot spend''' as defined in [[bip-0341.mediawiki#design|BIP341]] (i.e., the witness version is 1, the witness program is 32 bytes, and it is not P2SH wrapped).
* It is a '''script path spend''' as defined in [[bip-0341.mediawiki#design|BIP341]] (i.e., after removing the optional annex from the witness stack, two or more stack elements remain).
* The leaf version is ''0xc0'' (i.e. the first byte of the last witness element after removing the optional annex is ''0xc0'' or ''0xc1''), marking it as a '''tapscript spend'''.
Validation of such inputs must be equivalent to performing the following steps in the specified order.
@@ -104,8 +104,8 @@ The following rules apply to <code>OP_CHECKSIG</code>, <code>OP_CHECKSIGVERIFY</
===Common Signature Message Extension===
We define the tapscript message extension ''ext'' to [[bip-0341.mediawiki#user-content-common-signature-message|BIP341 Common Signature Message]], indicated by ''ext_flag = 1'':
* ''tapleaf_hash'' (32): the tapleaf hash as defined in [[bip-0341.mediawiki#user-content-design|BIP341]]
We define the tapscript message extension ''ext'' to [[bip-0341.mediawiki#common-signature-message|BIP341 Common Signature Message]], indicated by ''ext_flag = 1'':
* ''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. Opcodes in parsed but unexecuted branches count towards this value as well.