diff options
Diffstat (limited to 'bip-0141.mediawiki')
-rw-r--r-- | bip-0141.mediawiki | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bip-0141.mediawiki b/bip-0141.mediawiki index ccf18b6..6df2624 100644 --- a/bip-0141.mediawiki +++ b/bip-0141.mediawiki @@ -125,6 +125,32 @@ 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 the next integer). + +''Base transaction size'' is the size of the transaction serialised with the witness data stripped. + +''Total transaction size'' is the transaction size in bytes serialized as described in [[bip-0144.mediawiki|BIP144]], including base data and witness data. + +=== New script semantics === + +Despite that the script language for P2WPKH and P2WSH looks very similar to pre-segregated witness script, there are several notable differences. Users MUST NOT assume that a script spendable in pre-segregated witness system would also be spendable as a P2WPKH or P2WSH script. Before large-scale deployment in the production network, developers should test the scripts on testnet with the default relay policy turned on, and with a small amount of money after BIP141 is activated on mainnet. + +A major difference at consensus level is described in [https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki BIP143], as a new transaction digest algorithm for signature verification in version 0 witness program. + +Three relay and mining policies are also included in the first release of segregated witness at reference implementation version 0.13.1. Softforks based on these policies are likely to be proposed in the near future. To avoid indefinite delay in transaction confirmation and permanent fund loss in a potential softfork, users MUST observe the new semantics carefully: + +# Only compressed public keys are accepted in P2WPKH and P2WSH (See [https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#Restrictions_on_public_key_type BIP143]) +# The argument of OP_IF/NOTIF in P2WSH must be minimal<ref>https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-August/013014.html</ref> +# Signature(s) must be null vector(s) if an OP_CHECKSIG or OP_CHECKMULTISIG is failed (for both pre-segregated witness script and P2WSH. See [https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki BIP146]) + == Examples == === P2WPKH === |