Skip to content

Commit 3070d4b

Browse files
committed
BIP174: Deduplicate per-output type definitions
1 parent a328687 commit 3070d4b

2 files changed

Lines changed: 62 additions & 109 deletions

File tree

bip-0174.mediawiki

Lines changed: 1 addition & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ Per-input types are defined as follows:
288288
| 0, 2
289289
|}
290290

291-
The currently defined per-output <ref>'''Why do we need per-output data?''' Per-output data allows signers
291+
The per-output <ref>'''Why do we need per-output data?''' Per-output data allows signers
292292
to verify that the outputs are going to the intended recipient. The output data can also be use by signers to
293293
determine which outputs are change outputs and verify that the change is returning to the correct place.</ref> types are defined as follows:
294294

@@ -302,7 +302,6 @@ determine which outputs are change outputs and verify that the change is returni
302302
! Versions Requiring Inclusion
303303
! Versions Requiring Exclusion
304304
! Versions Allowing Inclusion
305-
! Parent BIP
306305
|-
307306
| Redeem Script
308307
| <tt>PSBT_OUT_REDEEM_SCRIPT = 0x00</tt>
@@ -313,7 +312,6 @@ determine which outputs are change outputs and verify that the change is returni
313312
|
314313
|
315314
| 0, 2
316-
| 174
317315
|-
318316
| Witness Script
319317
| <tt>PSBT_OUT_WITNESS_SCRIPT = 0x01</tt>
@@ -324,7 +322,6 @@ determine which outputs are change outputs and verify that the change is returni
324322
|
325323
|
326324
| 0, 2
327-
| 174
328325
|-
329326
| BIP 32 Derivation Path
330327
| <tt>PSBT_OUT_BIP32_DERIVATION = 0x02</tt>
@@ -335,110 +332,6 @@ determine which outputs are change outputs and verify that the change is returni
335332
|
336333
|
337334
| 0, 2
338-
| 174
339-
|-
340-
| Output Amount
341-
| <tt>PSBT_OUT_AMOUNT = 0x03</tt>
342-
| None
343-
| No key data
344-
| <tt><64-bit int amount></tt>
345-
| 64 bit signed little endian integer representing the output's amount in satoshis.
346-
| 2
347-
| 0
348-
| 2
349-
| [[bip-0370.mediawiki|370]]
350-
|-
351-
| Output Script
352-
| <tt>PSBT_OUT_SCRIPT = 0x04</tt>
353-
| None
354-
| No key data
355-
| <tt><bytes script></tt>
356-
| The script for this output, also known as the scriptPubKey. Must be omitted in PSBTv0. Must be provided in PSBTv2 if not sending to a BIP352 silent payment address, otherwise may be omitted.
357-
|
358-
| 0
359-
| 2
360-
| [[bip-0370.mediawiki|370]], [[bip-0375.mediawiki|375]]
361-
|-
362-
| Taproot Internal Key
363-
| <tt>PSBT_OUT_TAP_INTERNAL_KEY = 0x05</tt>
364-
| None
365-
| No key data
366-
| <tt><32 byte xonlypubkey></tt>
367-
| The X-only pubkey used as the internal key in this output.
368-
|
369-
|
370-
| 0, 2
371-
| [[bip-0371.mediawiki|371]]
372-
|-
373-
| Taproot Tree
374-
| <tt>PSBT_OUT_TAP_TREE = 0x06</tt>
375-
| None
376-
| No key data
377-
| <tt>{<8-bit uint depth> <8-bit uint leaf version> <compact size uint scriptlen> <bytes script>}*</tt>
378-
| One or more tuples representing the depth, leaf version, and script for a leaf in the Taproot tree, allowing the entire tree to be reconstructed. The tuples must be in depth first search order so that the tree is correctly reconstructed. Each tuple is an 8-bit unsigned integer representing the depth in the Taproot tree for this script, an 8-bit unsigned integer representing the leaf version, the length of the script as a compact size unsigned integer, and the script itself.
379-
|
380-
|
381-
| 0, 2
382-
| [[bip-0371.mediawiki|371]]
383-
|-
384-
| Taproot Key BIP 32 Derivation Path
385-
| <tt>PSBT_OUT_TAP_BIP32_DERIVATION = 0x07</tt>
386-
| <tt><32 byte xonlypubkey></tt>
387-
| A 32 byte X-only public key involved in this output. It may be the output key, the internal key, or a key present in a leaf script.
388-
| <tt><compact size uint number of hashes> <32 byte leaf hash>* <4 byte fingerprint> <32-bit little endian uint path element>*</tt>
389-
| A compact size unsigned integer representing the number of leaf hashes, followed by a list of leaf hashes, followed by the 4 byte 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. The leaf hashes are of the leaves which involve this public key. The internal key does not have leaf hashes, so can be indicated with a <tt>hashes len</tt> of 0. Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
390-
|
391-
|
392-
| 0, 2
393-
| [[bip-0371.mediawiki|371]]
394-
|-
395-
| MuSig2 Participant Public Keys
396-
| <tt>PSBT_OUT_MUSIG2_PARTICIPANT_PUBKEYS = 0x08</tt>
397-
| <tt><33 byte aggregate pubkey (compressed)></tt>
398-
| The MuSig2 compressed aggregate public key from the <tt>KeyAgg</tt> algorithm. This key may or may not
399-
be in the script directly. It may instead be a parent public key from which the public keys in the
400-
script were derived.
401-
| <tt><33 byte participant pubkey (compressed)>*</tt>
402-
| A list of the compressed public keys of the participants in the MuSig2 aggregate key in the order
403-
required for aggregation. If sorting was done, then the keys must be in the sorted order.
404-
|
405-
|
406-
| 0, 2
407-
| [[bip-0373.mediawiki|373]]
408-
|-
409-
| Silent Payment Data
410-
| <tt>PSBT_OUT_SP_V0_INFO = 0x09</tt>
411-
| None
412-
| No key data
413-
| <tt><33 byte scan key> <33 byte spend key></tt>
414-
| The scan and spend public keys from the silent payments address.
415-
|
416-
| 0
417-
| 2
418-
| [[bip-0375.mediawiki|375]]
419-
|-
420-
| Silent Payment Label
421-
| <tt>PSBT_OUT_SP_V0_LABEL = 0x0a</tt>
422-
| None
423-
| No key data
424-
| <tt><32-bit little endian uint label></tt>
425-
| The label to use to compute the spend key of the silent payments address to verify change.
426-
|
427-
| 0
428-
| 2
429-
| [[bip-0375.mediawiki|375]]
430-
|-
431-
| BIP 353 DNSSEC proof
432-
| <tt>PSBT_OUT_DNSSEC_PROOF = 0x35</tt>
433-
| None
434-
| No key data
435-
| <tt><1-byte-length-prefixed BIP 353 human-readable name><RFC 9102-formatted AuthenticationChain DNSSEC Proof></tt>
436-
| A BIP 353 human-readable name (without the ₿ prefix), prefixed by a 1-byte length.
437-
Followed by an [[https://www.rfc-editor.org/rfc/rfc9102.html#name-dnssec-authentication-chain|RFC 9102 DNSSEC <tt>AuthenticationChain</tt>]] (i.e. a series of DNS Resource Records in no particular order) providing a DNSSEC proof to a BIP 353 DNS TXT record.
438-
|
439-
|
440-
| 0, 2
441-
| [[bip-0353.mediawiki|353]]
442335
|-
443336
| Proprietary Use Type
444337
| <tt>PSBT_OUT_PROPRIETARY = 0xFC</tt>
@@ -449,7 +342,6 @@ Followed by an [[https://www.rfc-editor.org/rfc/rfc9102.html#name-dnssec-authent
449342
|
450343
|
451344
| 0, 2
452-
| 174
453345
|}
454346

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

bip-0174/type-registry.mediawiki

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,64 @@ The currently defined per-input types are as follows:
189189
| <tt>PSBT_IN_PROPRIETARY = 0xFC</tt>
190190
| [[bip-0174.mediawiki|174]]
191191
|}
192+
193+
194+
The currently defined per-output types are as follows:
195+
196+
{|
197+
! Name
198+
! <tt><keytype></tt>
199+
! Parent BIP
200+
|-
201+
| Redeem Script
202+
| <tt>PSBT_OUT_REDEEM_SCRIPT = 0x00</tt>
203+
| [[bip-0174.mediawiki|174]]
204+
|-
205+
| Witness Script
206+
| <tt>PSBT_OUT_WITNESS_SCRIPT = 0x01</tt>
207+
| [[bip-0174.mediawiki|174]]
208+
|-
209+
| BIP 32 Derivation Path
210+
| <tt>PSBT_OUT_BIP32_DERIVATION = 0x02</tt>
211+
| [[bip-0174.mediawiki|174]]
212+
|-
213+
| Output Amount
214+
| <tt>PSBT_OUT_AMOUNT = 0x03</tt>
215+
| [[bip-0370.mediawiki|370]]
216+
|-
217+
| Output Script
218+
| <tt>PSBT_OUT_SCRIPT = 0x04</tt>
219+
| [[bip-0370.mediawiki|370]], [[bip-0375.mediawiki|375]]
220+
|-
221+
| Taproot Internal Key
222+
| <tt>PSBT_OUT_TAP_INTERNAL_KEY = 0x05</tt>
223+
| [[bip-0371.mediawiki|371]]
224+
|-
225+
| Taproot Tree
226+
| <tt>PSBT_OUT_TAP_TREE = 0x06</tt>
227+
| [[bip-0371.mediawiki|371]]
228+
|-
229+
| Taproot Key BIP 32 Derivation Path
230+
| <tt>PSBT_OUT_TAP_BIP32_DERIVATION = 0x07</tt>
231+
| [[bip-0371.mediawiki|371]]
232+
|-
233+
| MuSig2 Participant Public Keys
234+
| <tt>PSBT_OUT_MUSIG2_PARTICIPANT_PUBKEYS = 0x08</tt>
235+
| [[bip-0373.mediawiki|373]]
236+
|-
237+
| Silent Payment Data
238+
| <tt>PSBT_OUT_SP_V0_INFO = 0x09</tt>
239+
| [[bip-0375.mediawiki|375]]
240+
|-
241+
| Silent Payment Label
242+
| <tt>PSBT_OUT_SP_V0_LABEL = 0x0a</tt>
243+
| [[bip-0375.mediawiki|375]]
244+
|-
245+
| BIP 353 DNSSEC proof
246+
| <tt>PSBT_OUT_DNSSEC_PROOF = 0x35</tt>
247+
| [[bip-0353.mediawiki|353]]
248+
|-
249+
| Proprietary Use Type
250+
| <tt>PSBT_OUT_PROPRIETARY = 0xFC</tt>
251+
| [[bip-0174.mediawiki|174]]
252+
|}

0 commit comments

Comments
 (0)