You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bip-0174.mediawiki
+78Lines changed: 78 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,34 +91,49 @@ The currently defined global types are as follows:
91
91
! <tt><keydata></tt> Description
92
92
! <tt><valuedata></tt>
93
93
! <tt><valuedata></tt> Description
94
+
! Versions Requiring Inclusion
95
+
! Versions Requiring Exclusion
96
+
! Versions Allowing Inclusion
94
97
|-
95
98
| Unsigned Transaction
96
99
| <tt>PSBT_GLOBAL_UNSIGNED_TX = 0x00</tt>
97
100
| None
98
101
| No key data
99
102
| <tt><transaction></tt>
100
103
| 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
101
107
|-
102
108
| Extended Public Key
103
109
| <tt>PSBT_GLOBAL_XPUB = 0x01</tt>
104
110
| <tt><xpub></tt>
105
111
| 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.
106
112
| <tt><32-bit uint> <32-bit uint>*</tt>
107
113
| 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
108
117
|-
109
118
| PSBT Version Number
110
119
| <tt>PSBT_GLOBAL_VERSION = 0xFB</tt>
111
120
| None
112
121
| No key data
113
122
| <tt><32-bit uint></tt>
114
123
| The 32-bit little endian unsigned integer representing the version number of this PSBT. If ommitted, the version number is 0.
| 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>.
120
132
| <tt><data></tt>
121
133
| Any value data as defined by the proprietary type user.
134
+
|
135
+
|
136
+
| 0
122
137
|}
123
138
124
139
The currently defined per-input types are defined as follows:
@@ -130,111 +145,159 @@ The currently defined per-input types are defined as follows:
130
145
! <tt><keydata></tt> Description
131
146
! <tt><valuedata></tt>
132
147
! <tt><valuedata></tt> Description
148
+
! Versions Requiring Inclusion
149
+
! Versions Requiring Exclusion
150
+
! Versions Allowing Inclusion
133
151
|-
134
152
| Non-Witness UTXO
135
153
| <tt>PSBT_IN_NON_WITNESS_UTXO = 0x00</tt>
136
154
| None
137
155
| No key data
138
156
| <tt><transaction></tt>
139
157
| 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>
| 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
147
171
|-
148
172
| Partial Signature
149
173
| <tt>PSBT_IN_PARTIAL_SIG = 0x02</tt>
150
174
| <tt><pubkey></tt>
151
175
| The public key which corresponds to this signature.
152
176
| <tt><signature></tt>
153
177
| The signature as would be pushed to the stack from a scriptSig or witness.
178
+
|
179
+
|
180
+
| 0
154
181
|-
155
182
| Sighash Type
156
183
| <tt>PSBT_IN_SIGHASH_TYPE = 0x03</tt>
157
184
| None
158
185
| No key data
159
186
| <tt><32-bit uint></tt>
160
187
| 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
161
191
|-
162
192
| Redeem Script
163
193
| <tt>PSBT_IN_REDEEM_SCRIPT = 0x04</tt>
164
194
| None
165
195
| No key data
166
196
| <tt><redeemScript></tt>
167
197
| The redeemScript for this input if it has one.
198
+
|
199
+
|
200
+
| 0
168
201
|-
169
202
| Witness Script
170
203
| <tt>PSBT_IN_WITNESS_SCRIPT = 0x05</tt>
171
204
| None
172
205
| No key data
173
206
| <tt><witnessScript></tt>
174
207
| The witnessScript for this input if it has one.
208
+
|
209
+
|
210
+
| 0
175
211
|-
176
212
| BIP 32 Derivation Path
177
213
| <tt>PSBT_IN_BIP32_DERIVATION = 0x06</tt>
178
214
| <tt><pubkey></tt>
179
215
| The public key
180
216
| <tt><32-bit uint> <32-bit uint>*</tt>
181
217
| 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
182
221
|-
183
222
| Finalized scriptSig
184
223
| <tt>PSBT_IN_FINAL_SCRIPTSIG = 0x07</tt>
185
224
| None
186
225
| No key data
187
226
| <tt><scriptSig></tt>
188
227
| 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
189
231
|-
190
232
| Finalized scriptWitness
191
233
| <tt>PSBT_IN_FINAL_SCRIPTWITNESS = 0x08</tt>
192
234
| None
193
235
| No key data
194
236
| <tt><scriptWitness></tt>
195
237
| 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
196
241
|-
197
242
| Proof-of-reserves commitment
198
243
| <tt>PSBT_IN_POR_COMMITMENT = 0x09</tt>
199
244
| None
200
245
| No key data
201
246
| <tt><porCommitment></tt>
202
247
| 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
203
251
|-
204
252
| RIPEMD160 preimage
205
253
| <tt>PSBT_IN_RIPEMD160 = 0x0a</tt>
206
254
| <tt><20-byte hash></tt>
207
255
| The resulting hash of the preimage
208
256
| <tt><preimage></tt>
209
257
| 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
210
261
|-
211
262
| SHA256 preimage
212
263
| <tt>PSBT_IN_SHA256 = 0x0b</tt>
213
264
| <tt><32-byte hash></tt>
214
265
| The resulting hash of the preimage
215
266
| <tt><preimage></tt>
216
267
| 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
217
271
|-
218
272
| HASH160 preimage
219
273
| <tt>PSBT_IN_HASH160 = 0x0c</tt>
220
274
| <tt><20-byte hash></tt>
221
275
| The resulting hash of the preimage
222
276
| <tt><preimage></tt>
223
277
| 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
224
281
|-
225
282
| HASH256 preimage
226
283
| <tt>PSBT_IN_HASH256 = 0x0d</tt>
227
284
| <tt><32-byte hash></tt>
228
285
| The resulting hash of the preimage
229
286
| <tt><preimage></tt>
230
287
| The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>SHA256</tt> algorithm twice
| 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>.
236
296
| <tt><data></tt>
237
297
| Any value data as defined by the proprietary type user.
298
+
|
299
+
|
300
+
| 0
238
301
|}
239
302
240
303
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
248
311
! <tt><keydata></tt> Description
249
312
! <tt><valuedata></tt>
250
313
! <tt><valuedata></tt> Description
314
+
! Versions Requiring Inclusion
315
+
! Versions Requiring Exclusion
316
+
! Versions Allowing Inclusion
251
317
|-
252
318
| Redeem Script
253
319
| <tt>PSBT_OUT_REDEEM_SCRIPT = 0x00</tt>
254
320
| None
255
321
| No key data
256
322
| <tt><redeemScript></tt>
257
323
| The redeemScript for this output if it has one.
324
+
|
325
+
|
326
+
| 0
258
327
|-
259
328
| Witness Script
260
329
| <tt>PSBT_OUT_WITNESS_SCRIPT = 0x01</tt>
261
330
| None
262
331
| No key data
263
332
| <tt><witnessScript></tt>
264
333
| The witnessScript for this output if it has one.
334
+
|
335
+
|
336
+
| 0
265
337
|-
266
338
| BIP 32 Derivation Path
267
339
| <tt>PSBT_OUT_BIP32_DERIVATION = 0x02</tt>
268
340
| <tt><public key></tt>
269
341
| The public key
270
342
| <tt><{32-bit uint> <32-bit uint>*</tt>
271
343
| 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.
| 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>.
277
352
| <tt><data></tt>
278
353
| Any value data as defined by the proprietary type user.
354
+
|
355
+
|
356
+
| 0
279
357
|}
280
358
281
359
Types can be skipped when they are unnecessary. For example, if an input is a witness
0 commit comments