Skip to content

Commit 80df418

Browse files
committed
Include PSBT versions that can or must include field
1 parent a4fb1b9 commit 80df418

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

bip-0174.mediawiki

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,34 +91,49 @@ The currently defined global types are as follows:
9191
! <tt><keydata></tt> Description
9292
! <tt><valuedata></tt>
9393
! <tt><valuedata></tt> Description
94+
! Versions Requiring Inclusion
95+
! Versions Requiring Exclusion
96+
! Versions Allowing Inclusion
9497
|-
9598
| Unsigned Transaction
9699
| <tt>PSBT_GLOBAL_UNSIGNED_TX = 0x00</tt>
97100
| None
98101
| No key data
99102
| <tt><transaction></tt>
100103
| 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).
104+
| 0
105+
|
106+
| 0
101107
|-
102108
| Extended Public Key
103109
| <tt>PSBT_GLOBAL_XPUB = 0x01</tt>
104110
| <tt><xpub></tt>
105111
| 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.
106112
| <tt><32-bit uint> <32-bit uint>*</tt>
107113
| 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.
114+
|
115+
|
116+
| 0
108117
|-
109118
| PSBT Version Number
110119
| <tt>PSBT_GLOBAL_VERSION = 0xFB</tt>
111120
| None
112121
| No key data
113122
| <tt><32-bit uint></tt>
114123
| The 32-bit little endian unsigned integer representing the version number of this PSBT. If ommitted, the version number is 0.
124+
|
125+
|
126+
| 0
115127
|-
116128
| Proprietary Use Type
117129
| <tt>PSBT_GLOBAL_PROPRIETARY = 0xFC</tt>
118130
| <tt><identifierlen> <identifier> <subtype> <subkeydata></tt>
119131
| 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>.
120132
| <tt><data></tt>
121133
| Any value data as defined by the proprietary type user.
134+
|
135+
|
136+
| 0
122137
|}
123138

124139
The currently defined per-input types are defined as follows:
@@ -130,111 +145,159 @@ The currently defined per-input types are defined as follows:
130145
! <tt><keydata></tt> Description
131146
! <tt><valuedata></tt>
132147
! <tt><valuedata></tt> Description
148+
! Versions Requiring Inclusion
149+
! Versions Requiring Exclusion
150+
! Versions Allowing Inclusion
133151
|-
134152
| Non-Witness UTXO
135153
| <tt>PSBT_IN_NON_WITNESS_UTXO = 0x00</tt>
136154
| None
137155
| No key data
138156
| <tt><transaction></tt>
139157
| 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>
158+
|
159+
|
160+
| 0
140161
|-
141162
| Witness UTXO
142163
| <tt>PSBT_IN_WITNESS_UTXO = 0x01</tt>
143164
| None
144165
| No key data
145166
| <tt><64-bit uint> <scriptPubKeylen> <scriptPubKey></tt>
146167
| 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>
168+
|
169+
|
170+
| 0
147171
|-
148172
| Partial Signature
149173
| <tt>PSBT_IN_PARTIAL_SIG = 0x02</tt>
150174
| <tt><pubkey></tt>
151175
| The public key which corresponds to this signature.
152176
| <tt><signature></tt>
153177
| The signature as would be pushed to the stack from a scriptSig or witness.
178+
|
179+
|
180+
| 0
154181
|-
155182
| Sighash Type
156183
| <tt>PSBT_IN_SIGHASH_TYPE = 0x03</tt>
157184
| None
158185
| No key data
159186
| <tt><32-bit uint></tt>
160187
| 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.
188+
|
189+
|
190+
| 0
161191
|-
162192
| Redeem Script
163193
| <tt>PSBT_IN_REDEEM_SCRIPT = 0x04</tt>
164194
| None
165195
| No key data
166196
| <tt><redeemScript></tt>
167197
| The redeemScript for this input if it has one.
198+
|
199+
|
200+
| 0
168201
|-
169202
| Witness Script
170203
| <tt>PSBT_IN_WITNESS_SCRIPT = 0x05</tt>
171204
| None
172205
| No key data
173206
| <tt><witnessScript></tt>
174207
| The witnessScript for this input if it has one.
208+
|
209+
|
210+
| 0
175211
|-
176212
| BIP 32 Derivation Path
177213
| <tt>PSBT_IN_BIP32_DERIVATION = 0x06</tt>
178214
| <tt><pubkey></tt>
179215
| The public key
180216
| <tt><32-bit uint> <32-bit uint>*</tt>
181217
| 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.
218+
|
219+
|
220+
| 0
182221
|-
183222
| Finalized scriptSig
184223
| <tt>PSBT_IN_FINAL_SCRIPTSIG = 0x07</tt>
185224
| None
186225
| No key data
187226
| <tt><scriptSig></tt>
188227
| The Finalized scriptSig contains a fully constructed scriptSig with signatures and any other scripts necessary for the input to pass validation.
228+
|
229+
|
230+
| 0
189231
|-
190232
| Finalized scriptWitness
191233
| <tt>PSBT_IN_FINAL_SCRIPTWITNESS = 0x08</tt>
192234
| None
193235
| No key data
194236
| <tt><scriptWitness></tt>
195237
| The Finalized scriptWitness contains a fully constructed scriptWitness with signatures and any other scripts necessary for the input to pass validation.
238+
|
239+
|
240+
| 0
196241
|-
197242
| Proof-of-reserves commitment
198243
| <tt>PSBT_IN_POR_COMMITMENT = 0x09</tt>
199244
| None
200245
| No key data
201246
| <tt><porCommitment></tt>
202247
| The UTF-8 encoded commitment message string for the proof-of-reserves. See [[bip-0127.mediawiki|BIP 127]] for more information.
248+
|
249+
|
250+
| 0
203251
|-
204252
| RIPEMD160 preimage
205253
| <tt>PSBT_IN_RIPEMD160 = 0x0a</tt>
206254
| <tt><20-byte hash></tt>
207255
| The resulting hash of the preimage
208256
| <tt><preimage></tt>
209257
| The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>RIPEMD160</tt> algorithm
258+
|
259+
|
260+
| 0
210261
|-
211262
| SHA256 preimage
212263
| <tt>PSBT_IN_SHA256 = 0x0b</tt>
213264
| <tt><32-byte hash></tt>
214265
| The resulting hash of the preimage
215266
| <tt><preimage></tt>
216267
| The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>SHA256</tt> algorithm
268+
|
269+
|
270+
| 0
217271
|-
218272
| HASH160 preimage
219273
| <tt>PSBT_IN_HASH160 = 0x0c</tt>
220274
| <tt><20-byte hash></tt>
221275
| The resulting hash of the preimage
222276
| <tt><preimage></tt>
223277
| 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
278+
|
279+
|
280+
| 0
224281
|-
225282
| HASH256 preimage
226283
| <tt>PSBT_IN_HASH256 = 0x0d</tt>
227284
| <tt><32-byte hash></tt>
228285
| The resulting hash of the preimage
229286
| <tt><preimage></tt>
230287
| The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>SHA256</tt> algorithm twice
288+
|
289+
|
290+
| 0
231291
|-
232292
| Proprietary Use Type
233293
| <tt>PSBT_IN_PROPRIETARY = 0xFC</tt>
234294
| <tt><identifierlen> <identifier> <subtype> <subkeydata></tt>
235295
| 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>.
236296
| <tt><data></tt>
237297
| Any value data as defined by the proprietary type user.
298+
|
299+
|
300+
| 0
238301
|}
239302

240303
The currently defined per-output <ref>'''Why do we need per-output data?''' Per-output data allows signers
@@ -248,34 +311,49 @@ determine which outputs are change outputs and verify that the change is returni
248311
! <tt><keydata></tt> Description
249312
! <tt><valuedata></tt>
250313
! <tt><valuedata></tt> Description
314+
! Versions Requiring Inclusion
315+
! Versions Requiring Exclusion
316+
! Versions Allowing Inclusion
251317
|-
252318
| Redeem Script
253319
| <tt>PSBT_OUT_REDEEM_SCRIPT = 0x00</tt>
254320
| None
255321
| No key data
256322
| <tt><redeemScript></tt>
257323
| The redeemScript for this output if it has one.
324+
|
325+
|
326+
| 0
258327
|-
259328
| Witness Script
260329
| <tt>PSBT_OUT_WITNESS_SCRIPT = 0x01</tt>
261330
| None
262331
| No key data
263332
| <tt><witnessScript></tt>
264333
| The witnessScript for this output if it has one.
334+
|
335+
|
336+
| 0
265337
|-
266338
| BIP 32 Derivation Path
267339
| <tt>PSBT_OUT_BIP32_DERIVATION = 0x02</tt>
268340
| <tt><public key></tt>
269341
| The public key
270342
| <tt><{32-bit uint> <32-bit uint>*</tt>
271343
| 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.
344+
|
345+
|
346+
| 0
272347
|-
273348
| Proprietary Use Type
274349
| <tt>PSBT_OUT_PROPRIETARY = 0xFC</tt>
275350
| <tt><identifierlen> <identifier> <subtype> <subkeydata></tt>
276351
| 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>.
277352
| <tt><data></tt>
278353
| Any value data as defined by the proprietary type user.
354+
|
355+
|
356+
| 0
279357
|}
280358

281359
Types can be skipped when they are unnecessary. For example, if an input is a witness

0 commit comments

Comments
 (0)