mirror of
https://github.com/bitcoin/bips.git
synced 2026-04-20 16:28:39 +00:00
BIP174: Deduplicate per-output type definitions
This commit is contained in:
@@ -288,7 +288,7 @@ Per-input types are defined as follows:
|
||||
| 0, 2
|
||||
|}
|
||||
|
||||
The currently defined per-output <ref>'''Why do we need per-output data?''' Per-output data allows signers
|
||||
The per-output <ref>'''Why do we need per-output data?''' Per-output data allows signers
|
||||
to verify that the outputs are going to the intended recipient. The output data can also be use by signers to
|
||||
determine which outputs are change outputs and verify that the change is returning to the correct place.</ref> types are defined as follows:
|
||||
|
||||
@@ -302,7 +302,6 @@ determine which outputs are change outputs and verify that the change is returni
|
||||
! Versions Requiring Inclusion
|
||||
! Versions Requiring Exclusion
|
||||
! Versions Allowing Inclusion
|
||||
! Parent BIP
|
||||
|-
|
||||
| Redeem Script
|
||||
| <tt>PSBT_OUT_REDEEM_SCRIPT = 0x00</tt>
|
||||
@@ -313,7 +312,6 @@ determine which outputs are change outputs and verify that the change is returni
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| 174
|
||||
|-
|
||||
| Witness Script
|
||||
| <tt>PSBT_OUT_WITNESS_SCRIPT = 0x01</tt>
|
||||
@@ -324,7 +322,6 @@ determine which outputs are change outputs and verify that the change is returni
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| 174
|
||||
|-
|
||||
| BIP 32 Derivation Path
|
||||
| <tt>PSBT_OUT_BIP32_DERIVATION = 0x02</tt>
|
||||
@@ -335,110 +332,6 @@ determine which outputs are change outputs and verify that the change is returni
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| 174
|
||||
|-
|
||||
| Output Amount
|
||||
| <tt>PSBT_OUT_AMOUNT = 0x03</tt>
|
||||
| None
|
||||
| No key data
|
||||
| <tt><64-bit int amount></tt>
|
||||
| 64 bit signed little endian integer representing the output's amount in satoshis.
|
||||
| 2
|
||||
| 0
|
||||
| 2
|
||||
| [[bip-0370.mediawiki|370]]
|
||||
|-
|
||||
| Output Script
|
||||
| <tt>PSBT_OUT_SCRIPT = 0x04</tt>
|
||||
| None
|
||||
| No key data
|
||||
| <tt><bytes script></tt>
|
||||
| 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.
|
||||
|
|
||||
| 0
|
||||
| 2
|
||||
| [[bip-0370.mediawiki|370]], [[bip-0375.mediawiki|375]]
|
||||
|-
|
||||
| Taproot Internal Key
|
||||
| <tt>PSBT_OUT_TAP_INTERNAL_KEY = 0x05</tt>
|
||||
| None
|
||||
| No key data
|
||||
| <tt><32 byte xonlypubkey></tt>
|
||||
| The X-only pubkey used as the internal key in this output.
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| [[bip-0371.mediawiki|371]]
|
||||
|-
|
||||
| Taproot Tree
|
||||
| <tt>PSBT_OUT_TAP_TREE = 0x06</tt>
|
||||
| None
|
||||
| No key data
|
||||
| <tt>{<8-bit uint depth> <8-bit uint leaf version> <compact size uint scriptlen> <bytes script>}*</tt>
|
||||
| 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.
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| [[bip-0371.mediawiki|371]]
|
||||
|-
|
||||
| Taproot Key BIP 32 Derivation Path
|
||||
| <tt>PSBT_OUT_TAP_BIP32_DERIVATION = 0x07</tt>
|
||||
| <tt><32 byte xonlypubkey></tt>
|
||||
| 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.
|
||||
| <tt><compact size uint number of hashes> <32 byte leaf hash>* <4 byte fingerprint> <32-bit little endian uint path element>*</tt>
|
||||
| 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.
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| [[bip-0371.mediawiki|371]]
|
||||
|-
|
||||
| MuSig2 Participant Public Keys
|
||||
| <tt>PSBT_OUT_MUSIG2_PARTICIPANT_PUBKEYS = 0x08</tt>
|
||||
| <tt><33 byte aggregate pubkey (compressed)></tt>
|
||||
| The MuSig2 compressed aggregate public key from the <tt>KeyAgg</tt> algorithm. This key may or may not
|
||||
be in the script directly. It may instead be a parent public key from which the public keys in the
|
||||
script were derived.
|
||||
| <tt><33 byte participant pubkey (compressed)>*</tt>
|
||||
| A list of the compressed public keys of the participants in the MuSig2 aggregate key in the order
|
||||
required for aggregation. If sorting was done, then the keys must be in the sorted order.
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| [[bip-0373.mediawiki|373]]
|
||||
|-
|
||||
| Silent Payment Data
|
||||
| <tt>PSBT_OUT_SP_V0_INFO = 0x09</tt>
|
||||
| None
|
||||
| No key data
|
||||
| <tt><33 byte scan key> <33 byte spend key></tt>
|
||||
| The scan and spend public keys from the silent payments address.
|
||||
|
|
||||
| 0
|
||||
| 2
|
||||
| [[bip-0375.mediawiki|375]]
|
||||
|-
|
||||
| Silent Payment Label
|
||||
| <tt>PSBT_OUT_SP_V0_LABEL = 0x0a</tt>
|
||||
| None
|
||||
| No key data
|
||||
| <tt><32-bit little endian uint label></tt>
|
||||
| The label to use to compute the spend key of the silent payments address to verify change.
|
||||
|
|
||||
| 0
|
||||
| 2
|
||||
| [[bip-0375.mediawiki|375]]
|
||||
|-
|
||||
| BIP 353 DNSSEC proof
|
||||
| <tt>PSBT_OUT_DNSSEC_PROOF = 0x35</tt>
|
||||
| None
|
||||
| No key data
|
||||
| <tt><1-byte-length-prefixed BIP 353 human-readable name><RFC 9102-formatted AuthenticationChain DNSSEC Proof></tt>
|
||||
| A BIP 353 human-readable name (without the ₿ prefix), prefixed by a 1-byte length.
|
||||
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.
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| [[bip-0353.mediawiki|353]]
|
||||
|-
|
||||
| Proprietary Use Type
|
||||
| <tt>PSBT_OUT_PROPRIETARY = 0xFC</tt>
|
||||
@@ -449,7 +342,6 @@ Followed by an [[https://www.rfc-editor.org/rfc/rfc9102.html#name-dnssec-authent
|
||||
|
|
||||
|
|
||||
| 0, 2
|
||||
| 174
|
||||
|}
|
||||
|
||||
Types can be skipped when they are unnecessary. For example, if an input is a witness
|
||||
|
||||
@@ -191,3 +191,64 @@ This document collects the fields and types used in PSBTs of any version from al
|
||||
| <tt>PSBT_IN_PROPRIETARY = 0xFC</tt>
|
||||
| [[bip-0174.mediawiki|174]]
|
||||
|}
|
||||
|
||||
|
||||
==Per-output types==
|
||||
|
||||
{|
|
||||
! Name
|
||||
! <tt><keytype></tt>
|
||||
! Parent BIP
|
||||
|-
|
||||
| Redeem Script
|
||||
| <tt>PSBT_OUT_REDEEM_SCRIPT = 0x00</tt>
|
||||
| [[bip-0174.mediawiki|174]]
|
||||
|-
|
||||
| Witness Script
|
||||
| <tt>PSBT_OUT_WITNESS_SCRIPT = 0x01</tt>
|
||||
| [[bip-0174.mediawiki|174]]
|
||||
|-
|
||||
| BIP 32 Derivation Path
|
||||
| <tt>PSBT_OUT_BIP32_DERIVATION = 0x02</tt>
|
||||
| [[bip-0174.mediawiki|174]]
|
||||
|-
|
||||
| Output Amount
|
||||
| <tt>PSBT_OUT_AMOUNT = 0x03</tt>
|
||||
| [[bip-0370.mediawiki|370]]
|
||||
|-
|
||||
| Output Script
|
||||
| <tt>PSBT_OUT_SCRIPT = 0x04</tt>
|
||||
| [[bip-0370.mediawiki|370]], [[bip-0375.mediawiki|375]]
|
||||
|-
|
||||
| Taproot Internal Key
|
||||
| <tt>PSBT_OUT_TAP_INTERNAL_KEY = 0x05</tt>
|
||||
| [[bip-0371.mediawiki|371]]
|
||||
|-
|
||||
| Taproot Tree
|
||||
| <tt>PSBT_OUT_TAP_TREE = 0x06</tt>
|
||||
| [[bip-0371.mediawiki|371]]
|
||||
|-
|
||||
| Taproot Key BIP 32 Derivation Path
|
||||
| <tt>PSBT_OUT_TAP_BIP32_DERIVATION = 0x07</tt>
|
||||
| [[bip-0371.mediawiki|371]]
|
||||
|-
|
||||
| MuSig2 Participant Public Keys
|
||||
| <tt>PSBT_OUT_MUSIG2_PARTICIPANT_PUBKEYS = 0x08</tt>
|
||||
| [[bip-0373.mediawiki|373]]
|
||||
|-
|
||||
| Silent Payment Data
|
||||
| <tt>PSBT_OUT_SP_V0_INFO = 0x09</tt>
|
||||
| [[bip-0375.mediawiki|375]]
|
||||
|-
|
||||
| Silent Payment Label
|
||||
| <tt>PSBT_OUT_SP_V0_LABEL = 0x0a</tt>
|
||||
| [[bip-0375.mediawiki|375]]
|
||||
|-
|
||||
| BIP 353 DNSSEC proof
|
||||
| <tt>PSBT_OUT_DNSSEC_PROOF = 0x35</tt>
|
||||
| [[bip-0353.mediawiki|353]]
|
||||
|-
|
||||
| Proprietary Use Type
|
||||
| <tt>PSBT_OUT_PROPRIETARY = 0xFC</tt>
|
||||
| [[bip-0174.mediawiki|174]]
|
||||
|}
|
||||
|
||||
Reference in New Issue
Block a user