summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2016-03-30 21:43:36 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2016-03-30 22:46:18 +0000
commita5447e0c4b219acbbc1e09ccd9419e8dff94f1e8 (patch)
tree85b743010130f13302cb2f873554d94589e5dd8c
parentba16f16742f841461b045ba3ad1cbc04694bcb97 (diff)
downloadbips-a5447e0c4b219acbbc1e09ccd9419e8dff94f1e8.tar.xz
BIP 141 & 145: Clarify sigop interaction
-rw-r--r--bip-0141.mediawiki6
-rw-r--r--bip-0145.mediawiki6
2 files changed, 8 insertions, 4 deletions
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 ==
diff --git a/bip-0145.mediawiki b/bip-0145.mediawiki
index b90725e..712e422 100644
--- a/bip-0145.mediawiki
+++ b/bip-0145.mediawiki
@@ -24,8 +24,6 @@ The template Object is revised to include these keys:
|-
| costlimit || {{No}} || Number || total cost allowed in blocks
|-
-| sigoplimit || {{No}} || Number || total sigop cost allowed in blocks divided by 4
-|-
| version || {{Yes}} || Number || block version; clients MUST understand the implications of the version they use (eg, comply with [[bip-0141.mediawiki|BIP 141]] for version 5)
|}
@@ -47,6 +45,10 @@ The Objects listed in the response's "transactions" key is revised to include th
Transactions with witness data may only be included if the template's block version is at least 5.
+===Sigops===
+
+For version 5 blocks, the "sigoplimit" and "sigops" keys must use the new values as calculated in [[bip-0141.mediawiki#Sigops|BIP 141]].
+
===Block Assembly with Witness Transactions===
When block assembly is done without witness transactions, no changes are made by this BIP, and it should be assembled as previously.