From a5447e0c4b219acbbc1e09ccd9419e8dff94f1e8 Mon Sep 17 00:00:00 2001
From: Luke Dashjr <luke-jr+git@utopios.org>
Date: Wed, 30 Mar 2016 21:43:36 +0000
Subject: BIP 141 & 145: Clarify sigop interaction

---
 bip-0141.mediawiki | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'bip-0141.mediawiki')

diff --git a/bip-0141.mediawiki b/bip-0141.mediawiki
index 12b0eba..543e5a2 100644
--- a/bip-0141.mediawiki
+++ b/bip-0141.mediawiki
@@ -114,9 +114,11 @@ The new rule is total ''block cost'' ≤ 4,000,000.
 
 Sigops per block is currently limited to 20,000. We change this restriction as follows:
 
-''Sigop cost'' is defined. The cost of a sigop in traditional script is 4, while the cost of a sigop in witness program is 1.
+Sigops in the current pubkey script, signature script, and P2SH check script are counted at 4 times their previous value.
+The sigop limit is likewise quadrupled to ≤ 80,000.
 
-The new rule is total ''sigop cost'' ≤ 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.
 
 == Examples ==
 
-- 
cgit v1.2.3


From 2fa7fb9b5cf9a4dbe2affe44267014fc486cbcf6 Mon Sep 17 00:00:00 2001
From: Luke Dashjr <luke-jr+git@utopios.org>
Date: Wed, 30 Mar 2016 22:43:33 +0000
Subject: BIP 141: Specify VB name

---
 bip-0141.mediawiki | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'bip-0141.mediawiki')

diff --git a/bip-0141.mediawiki b/bip-0141.mediawiki
index 543e5a2..647ec69 100644
--- a/bip-0141.mediawiki
+++ b/bip-0141.mediawiki
@@ -251,7 +251,7 @@ As a soft fork, older software will continue to operate without modification.  N
 
 == Deployment ==
 
-This BIP is to be deployed by version-bits BIP9. Exact details TDB.
+This BIP is to be deployed by version-bits BIP9 with the name "segwit". Exact details TDB.
 
 == Credits ==
 
-- 
cgit v1.2.3


From cacf39b057e15fc273b3ddea7dde78e4fb696b83 Mon Sep 17 00:00:00 2001
From: Johnson Lau <jl2012@users.noreply.github.com>
Date: Thu, 31 Mar 2016 14:22:36 +0800
Subject: BIP141: Sigop clarification

---
 bip-0141.mediawiki | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'bip-0141.mediawiki')

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 ==
 
-- 
cgit v1.2.3


From a6cc319846c4baaecbdd489dfc3143239189b4d5 Mon Sep 17 00:00:00 2001
From: Johnson Lau <jl2012@users.noreply.github.com>
Date: Tue, 5 Apr 2016 13:03:34 +0800
Subject: Update bip-0141.mediawiki

---
 bip-0141.mediawiki | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'bip-0141.mediawiki')

diff --git a/bip-0141.mediawiki b/bip-0141.mediawiki
index 09a5556..3cbcd13 100644
--- a/bip-0141.mediawiki
+++ b/bip-0141.mediawiki
@@ -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 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.
+That is, CHECKSIG in a witness program is counted as only 1 sigop, and CHECKMULTISIG in a witness program is counted as 1 to 20 sigops according to the arguments. This rule applies to both native witness program and P2SH witness program.
 
 == Examples ==
 
-- 
cgit v1.2.3

