From 80df41818ecbd2a16f351513da8e33e0ac17a4fd Mon Sep 17 00:00:00 2001
From: Andrew Chow <achow101-github@achow101.com>
Date: Thu, 14 Jan 2021 13:52:07 -0500
Subject: Include PSBT versions that can or must include field

---
 bip-0174.mediawiki | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

(limited to 'bip-0174.mediawiki')

diff --git a/bip-0174.mediawiki b/bip-0174.mediawiki
index 3ea95d5..9e1de13 100644
--- a/bip-0174.mediawiki
+++ b/bip-0174.mediawiki
@@ -91,6 +91,9 @@ The currently defined global types are as follows:
 ! <tt><keydata></tt> Description
 ! <tt><valuedata></tt>
 ! <tt><valuedata></tt> Description
+! Versions Requiring Inclusion
+! Versions Requiring Exclusion
+! Versions Allowing Inclusion
 |-
 | Unsigned Transaction
 | <tt>PSBT_GLOBAL_UNSIGNED_TX = 0x00</tt>
@@ -98,6 +101,9 @@ The currently defined global types are as follows:
 | No key data
 | <tt><transaction></tt>
 | The transaction in network serialization. The scriptSigs and witnesses for each input must be empty. The transaction must be in the old serialization format (without witnesses).
+| 0
+|
+| 0
 |-
 | Extended Public Key
 | <tt>PSBT_GLOBAL_XPUB = 0x01</tt>
@@ -105,6 +111,9 @@ The currently defined global types are as follows:
 | The 78 byte serialized extended public key as defined by BIP 32. Extended public keys are those that can be used to derive public keys used in the inputs and outputs of this transaction. It should be the public key at the highest hardened derivation index so that the unhardened child keys used in the transaction can be derived.
 | <tt><32-bit uint> <32-bit uint>*</tt>
 | The master key fingerprint as defined by BIP 32 concatenated with the derivation path of the public key. The derivation path is represented as 32-bit little endian unsigned integer indexes concatenated with each other. The number of 32 bit unsigned integer indexes must match the depth provided in the extended public key.
+|
+|
+| 0
 |-
 | PSBT Version Number
 | <tt>PSBT_GLOBAL_VERSION = 0xFB</tt>
@@ -112,6 +121,9 @@ The currently defined global types are as follows:
 | No key data
 | <tt><32-bit uint></tt>
 | The 32-bit little endian unsigned integer representing the version number of this PSBT. If ommitted, the version number is 0.
+|
+|
+| 0
 |-
 | Proprietary Use Type
 | <tt>PSBT_GLOBAL_PROPRIETARY = 0xFC</tt>
@@ -119,6 +131,9 @@ The currently defined global types are as follows:
 | Compact size unsigned integer <tt><identifierlen></tt>, followed by identifier prefix of that length <tt><identifer></tt>, followed by a subtype <tt><subtype></tt>, followed by the key data itself <tt><subkeydata></tt>.
 | <tt><data></tt>
 | Any value data as defined by the proprietary type user.
+|
+|
+| 0
 |}
 
 The currently defined per-input types are defined as follows:
@@ -130,6 +145,9 @@ The currently defined per-input types are defined as follows:
 ! <tt><keydata></tt> Description
 ! <tt><valuedata></tt>
 ! <tt><valuedata></tt> Description
+! Versions Requiring Inclusion
+! Versions Requiring Exclusion
+! Versions Allowing Inclusion
 |-
 | Non-Witness UTXO
 | <tt>PSBT_IN_NON_WITNESS_UTXO = 0x00</tt>
@@ -137,6 +155,9 @@ The currently defined per-input types are defined as follows:
 | No key data
 | <tt><transaction></tt>
 | The transaction in network serialization format the current input spends from. This should be present for inputs that spend non-segwit outputs and can be present for inputs that spend segwit outputs. An input can have both <tt>PSBT_IN_NON_WITNESS_UTXO</tt> and <tt>PSBT_IN_WITNESS_UTXO</tt>. <ref>'''Why can both UTXO types be provided?''' Many wallets began requiring the full previous transaction (i.e. <tt>PSBT_IN_NON_WITNESS_UTXO</tt>) for segwit inputs when PSBT was already in use. In order to be compatible with software which were expecting <tt>PSBT_IN_WITNESS_UTXO</tt>, both UTXO types must be allowed.</ref>
+|
+|
+| 0
 |-
 | Witness UTXO
 | <tt>PSBT_IN_WITNESS_UTXO = 0x01</tt>
@@ -144,6 +165,9 @@ The currently defined per-input types are defined as follows:
 | No key data
 | <tt><64-bit uint> <scriptPubKeylen> <scriptPubKey></tt>
 | The entire transaction output in network serialization which the current input spends from. This should only be present for inputs which spend segwit outputs, including P2SH embedded ones. An input can have both <tt>PSBT_IN_NON_WITNESS_UTXO</tt> and <tt>PSBT_IN_WITNESS_UTXO</tt>
+|
+|
+| 0
 |-
 | Partial Signature
 | <tt>PSBT_IN_PARTIAL_SIG = 0x02</tt>
@@ -151,6 +175,9 @@ The currently defined per-input types are defined as follows:
 | The public key which corresponds to this signature.
 | <tt><signature></tt>
 | The signature as would be pushed to the stack from a scriptSig or witness.
+|
+|
+| 0
 |-
 | Sighash Type
 | <tt>PSBT_IN_SIGHASH_TYPE = 0x03</tt>
@@ -158,6 +185,9 @@ The currently defined per-input types are defined as follows:
 | No key data
 | <tt><32-bit uint></tt>
 | The 32-bit unsigned integer specifying the sighash type to be used for this input. Signatures for this input must use the sighash type, finalizers must fail to finalize inputs which have signatures that do not match the specified sighash type. Signers who cannot produce signatures with the sighash type must not provide a signature.
+|
+|
+| 0
 |-
 | Redeem Script
 | <tt>PSBT_IN_REDEEM_SCRIPT = 0x04</tt>
@@ -165,6 +195,9 @@ The currently defined per-input types are defined as follows:
 | No key data
 | <tt><redeemScript></tt>
 | The redeemScript for this input if it has one.
+|
+|
+| 0
 |-
 | Witness Script
 | <tt>PSBT_IN_WITNESS_SCRIPT = 0x05</tt>
@@ -172,6 +205,9 @@ The currently defined per-input types are defined as follows:
 | No key data
 | <tt><witnessScript></tt>
 | The witnessScript for this input if it has one.
+|
+|
+| 0
 |-
 | BIP 32 Derivation Path
 | <tt>PSBT_IN_BIP32_DERIVATION = 0x06</tt>
@@ -179,6 +215,9 @@ The currently defined per-input types are defined as follows:
 | The public key
 | <tt><32-bit uint> <32-bit uint>*</tt>
 | The master key fingerprint as defined by BIP 32 concatenated with the derivation path of the public key. The derivation path is represented as 32 bit unsigned integer indexes concatenated with each other. Public keys are those that will be needed to sign this input.
+|
+|
+| 0
 |-
 | Finalized scriptSig
 | <tt>PSBT_IN_FINAL_SCRIPTSIG = 0x07</tt>
@@ -186,6 +225,9 @@ The currently defined per-input types are defined as follows:
 | No key data
 | <tt><scriptSig></tt>
 | The Finalized scriptSig contains a fully constructed scriptSig with signatures and any other scripts necessary for the input to pass validation.
+|
+|
+| 0
 |-
 | Finalized scriptWitness
 | <tt>PSBT_IN_FINAL_SCRIPTWITNESS = 0x08</tt>
@@ -193,6 +235,9 @@ The currently defined per-input types are defined as follows:
 | No key data
 | <tt><scriptWitness></tt>
 | The Finalized scriptWitness contains a fully constructed scriptWitness with signatures and any other scripts necessary for the input to pass validation.
+|
+|
+| 0
 |-
 | Proof-of-reserves commitment
 | <tt>PSBT_IN_POR_COMMITMENT = 0x09</tt>
@@ -200,6 +245,9 @@ The currently defined per-input types are defined as follows:
 | No key data
 | <tt><porCommitment></tt>
 | The UTF-8 encoded commitment message string for the proof-of-reserves.  See [[bip-0127.mediawiki|BIP 127]] for more information.
+|
+|
+| 0
 |-
 | RIPEMD160 preimage
 | <tt>PSBT_IN_RIPEMD160 = 0x0a</tt>
@@ -207,6 +255,9 @@ The currently defined per-input types are defined as follows:
 | The resulting hash of the preimage
 | <tt><preimage></tt>
 | The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>RIPEMD160</tt> algorithm
+|
+|
+| 0
 |-
 | SHA256 preimage
 | <tt>PSBT_IN_SHA256 = 0x0b</tt>
@@ -214,6 +265,9 @@ The currently defined per-input types are defined as follows:
 | The resulting hash of the preimage
 | <tt><preimage></tt>
 | The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>SHA256</tt> algorithm
+|
+|
+| 0
 |-
 | HASH160 preimage
 | <tt>PSBT_IN_HASH160 = 0x0c</tt>
@@ -221,6 +275,9 @@ The currently defined per-input types are defined as follows:
 | The resulting hash of the preimage
 | <tt><preimage></tt>
 | The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>SHA256</tt> algorithm followed by the <tt>RIPEMD160</tt> algorithm
+|
+|
+| 0
 |-
 | HASH256 preimage
 | <tt>PSBT_IN_HASH256 = 0x0d</tt>
@@ -228,6 +285,9 @@ The currently defined per-input types are defined as follows:
 | The resulting hash of the preimage
 | <tt><preimage></tt>
 | The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>SHA256</tt> algorithm twice
+|
+|
+| 0
 |-
 | Proprietary Use Type
 | <tt>PSBT_IN_PROPRIETARY = 0xFC</tt>
@@ -235,6 +295,9 @@ The currently defined per-input types are defined as follows:
 | Compact size unsigned integer <tt><identifierlen></tt>, followed by identifier prefix of that length <tt><identifer></tt>, followed by a subtype <tt><subtype></tt>, followed by the key data itself <tt><subkeydata></tt>.
 | <tt><data></tt>
 | Any value data as defined by the proprietary type user.
+|
+|
+| 0
 |}
 
 The currently defined per-output <ref>'''Why do we need per-output data?''' Per-output data allows signers
@@ -248,6 +311,9 @@ determine which outputs are change outputs and verify that the change is returni
 ! <tt><keydata></tt> Description
 ! <tt><valuedata></tt>
 ! <tt><valuedata></tt> Description
+! Versions Requiring Inclusion
+! Versions Requiring Exclusion
+! Versions Allowing Inclusion
 |-
 | Redeem Script
 | <tt>PSBT_OUT_REDEEM_SCRIPT = 0x00</tt>
@@ -255,6 +321,9 @@ determine which outputs are change outputs and verify that the change is returni
 | No key data
 | <tt><redeemScript></tt>
 | The redeemScript for this output if it has one.
+|
+|
+| 0
 |-
 | Witness Script
 | <tt>PSBT_OUT_WITNESS_SCRIPT = 0x01</tt>
@@ -262,6 +331,9 @@ determine which outputs are change outputs and verify that the change is returni
 | No key data
 | <tt><witnessScript></tt>
 | The witnessScript for this output if it has one.
+|
+|
+| 0
 |-
 | BIP 32 Derivation Path
 | <tt>PSBT_OUT_BIP32_DERIVATION = 0x02</tt>
@@ -269,6 +341,9 @@ determine which outputs are change outputs and verify that the change is returni
 | The public key
 | <tt><{32-bit uint> <32-bit uint>*</tt>
 | The master key fingerprint concatenated with the derivation path of the public key. The derivation path is represented as 32-bit little endian unsigned integer indexes concatenated with each other. Public keys are those needed to spend this output.
+|
+|
+| 0
 |-
 | Proprietary Use Type
 | <tt>PSBT_OUT_PROPRIETARY = 0xFC</tt>
@@ -276,6 +351,9 @@ determine which outputs are change outputs and verify that the change is returni
 | Compact size unsigned integer <tt><identifierlen></tt>, followed by identifier prefix of that length <tt><identifer></tt>, followed by a subtype <tt><subtype></tt>, followed by the key data itself <tt><subkeydata></tt>.
 | <tt><data></tt>
 | Any value data as defined by the proprietary type user.
+|
+|
+| 0
 |}
 
 Types can be skipped when they are unnecessary. For example, if an input is a witness
-- 
cgit v1.2.3

