summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonnynewbs <jonnynewbs@gmail.com>2016-09-15 16:39:10 -0400
committerjonnynewbs <jonnynewbs@gmail.com>2016-09-16 13:55:19 -0400
commitc2213ed1fdabc671c8b3c46b3f7dcfedacf7dafb (patch)
treebc8f215b88118a6dd19b844c34bcfaf87b12f49b
parent2fceaf98a9d58b548af1d8a2308a71c9c3bb6c25 (diff)
downloadbips-c2213ed1fdabc671c8b3c46b3f7dcfedacf7dafb.tar.xz
Update BIP 141 to include definition of Virtual transaction size and Transaction weight
-rw-r--r--bip-0141.mediawiki14
1 files changed, 14 insertions, 0 deletions
diff --git a/bip-0141.mediawiki b/bip-0141.mediawiki
index ccf18b6..2b2360b 100644
--- a/bip-0141.mediawiki
+++ b/bip-0141.mediawiki
@@ -125,6 +125,20 @@ The sigop limit is likewise quadrupled to ≤ 80,000.
Each P2WPKH input is counted as 1 sigop. In addition, opcodes within a P2WSH <code>witnessScript</code> are counted identically as previously within the P2SH <code>redeemScript</code>. That is, CHECKSIG is counted as only 1 sigop, and CHECKMULTISIG is counted as 1 to 20 sigops according to the arguments. This rule applies to both native witness program and P2SH witness program.
+=== Additional definitions ===
+
+The following definitions are not used for consensus limits, but are suggested to provide language consistent with the terminology introduced above.
+
+==== Transaction size calculations ====
+
+''Transaction weight'' is defined as ''Base transaction size'' * 3 + ''Total transaction size'' (ie. the same method as calculating ''Block weight'' from ''Base size'' and ''Total size'').
+
+''Virtual transaction size'' is defined as ''Transaction weight'' / 4 (rounded up to nearest integer).
+
+''Base transaction size'' is the transaction size in bytes with the original transaction serialization without any witness-related data.
+
+''Total transaction size'' is the transaction size in bytes serialized as described in [[bip-0144.mediawiki|BIP144]], including base data and witness data.
+
== Examples ==
=== P2WPKH ===