summaryrefslogtreecommitdiff
path: root/bip-0141.mediawiki
diff options
context:
space:
mode:
authorJohnson Lau <jl2012@users.noreply.github.com>2016-03-31 14:22:36 +0800
committerJohnson Lau <jl2012@users.noreply.github.com>2016-03-31 14:22:36 +0800
commitcacf39b057e15fc273b3ddea7dde78e4fb696b83 (patch)
treee1a546236ef841b77b721cc8a82270f499bb60c9 /bip-0141.mediawiki
parent2fa7fb9b5cf9a4dbe2affe44267014fc486cbcf6 (diff)
BIP141: Sigop clarification
Diffstat (limited to 'bip-0141.mediawiki')
-rw-r--r--bip-0141.mediawiki6
1 files changed, 3 insertions, 3 deletions
diff --git a/bip-0141.mediawiki b/bip-0141.mediawiki
index 647ec69..09a5556 100644
--- a/bip-0141.mediawiki
+++ b/bip-0141.mediawiki
@@ -80,8 +80,8 @@ If there are more than one scriptPubKey matching the pattern, the one with highe
A scriptPubKey (or redeemScript as defined in BIP16/P2SH) that consists of a 1-byte push opcode (for 0 to 16) followed by a data push between 2 and 32 bytes gets a new special meaning. The value of the first push is called the "version byte". The following byte vector pushed is called the "witness program".
There are two cases in which witness validation logic are triggered. Each case determines the location of the witness version byte and program, as well as the form of the scriptSig:
-# Triggered by a scriptPubKey that is exactly a push of a version byte, plus a push of a witness program. The scriptSig must be exactly empty or validation fails.
-# Triggered when a scriptPubKey is a P2SH script, and the BIP16 redeemScript pushed in the scriptSig is exactly a push of a version byte plus a push of a witness program. The scriptSig must be exactly a push of the BIP16 redeemScript or validation fails.
+# Triggered by a scriptPubKey that is exactly a push of a version byte, plus a push of a witness program. The scriptSig must be exactly empty or validation fails. (''"native witness program"'')
+# Triggered when a scriptPubKey is a P2SH script, and the BIP16 redeemScript pushed in the scriptSig is exactly a push of a version byte plus a push of a witness program. The scriptSig must be exactly a push of the BIP16 redeemScript or validation fails. (''"P2SH witness program"'')
If the version byte is 0, and the witness program is 20 bytes:
* It is interpreted as a pay-to-witness-public-key-hash (P2WPKH) program.
@@ -118,7 +118,7 @@ Sigops in the current pubkey script, signature script, and P2SH check script are
The sigop limit is likewise quadrupled to ≤ 80,000.
In addition, opcodes within the witness program are counted identical to as previously within the P2SH check script.
-That is, CHECKSIG is counted as only 1 sigop in a witness program, despite P2SH check script's CHECKSIG becoming 4 sigops with the forementioned change.
+That is, CHECKSIG in a witness program is counted as only 1 sigop, and m-of-n CHECKMULTISIG in a witness program is counted as n sigop. This rule applies to both native witness program and P2SH witness program.
== Examples ==