Skip to content

Commit 8f8ac4f

Browse files
authored
Merge pull request bitcoin#444 from jonnynewbs/master
Update BIP 141 to include definition of Virtual transaction size and Transaction weight
2 parents 2fceaf9 + c2213ed commit 8f8ac4f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

bip-0141.mediawiki

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,20 @@ The sigop limit is likewise quadrupled to ≤ 80,000.
125125

126126
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.
127127

128+
=== Additional definitions ===
129+
130+
The following definitions are not used for consensus limits, but are suggested to provide language consistent with the terminology introduced above.
131+
132+
==== Transaction size calculations ====
133+
134+
''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'').
135+
136+
''Virtual transaction size'' is defined as ''Transaction weight'' / 4 (rounded up to nearest integer).
137+
138+
''Base transaction size'' is the transaction size in bytes with the original transaction serialization without any witness-related data.
139+
140+
''Total transaction size'' is the transaction size in bytes serialized as described in [[bip-0144.mediawiki|BIP144]], including base data and witness data.
141+
128142
== Examples ==
129143

130144
=== P2WPKH ===

0 commit comments

Comments
 (0)