1
0
mirror of https://github.com/bitcoin/bips.git synced 2024-11-19 01:40:05 +01:00

psbt: Unify formatting of key-value data to specify data type and name

This commit is contained in:
Andrew Chow 2022-07-13 15:02:21 -04:00
parent b505101a2d
commit 7cd8ecd111
3 changed files with 80 additions and 80 deletions

View File

@ -98,7 +98,7 @@ The currently defined global types are as follows:
| <tt>PSBT_GLOBAL_UNSIGNED_TX = 0x00</tt>
| None
| No key data
| <tt><transaction></tt>
| <tt><bytes 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
| 2
@ -107,9 +107,9 @@ The currently defined global types are as follows:
|-
| Extended Public Key
| <tt>PSBT_GLOBAL_XPUB = 0x01</tt>
| <tt><xpub></tt>
| <tt><bytes xpub></tt>
| 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>
| <tt><4 byte fingerprint> <32-bit little endian uint path element>*</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.
|
|
@ -120,7 +120,7 @@ The currently defined global types are as follows:
| <tt>PSBT_GLOBAL_TX_VERSION = 0x02</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint version></tt>
| The 32-bit little endian signed integer representing the version number of the transaction being created. Note that this is not the same as the PSBT version number specified by the PSBT_GLOBAL_VERSION field.
| 2
| 0
@ -131,7 +131,7 @@ The currently defined global types are as follows:
| <tt>PSBT_GLOBAL_FALLBACK_LOCKTIME = 0x03</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint locktime></tt>
| The 32-bit little endian unsigned integer representing the transaction locktime to use if no inputs specify a required locktime.
|
| 0
@ -142,7 +142,7 @@ The currently defined global types are as follows:
| <tt>PSBT_GLOBAL_INPUT_COUNT = 0x04</tt>
| None
| No key data
| <tt><compact size uint></tt>
| <tt><compact size uint input count></tt>
| Compact size unsigned integer representing the number of inputs in this PSBT.
| 2
| 0
@ -153,7 +153,7 @@ The currently defined global types are as follows:
| <tt>PSBT_GLOBAL_OUTPUT_COUNT = 0x05</tt>
| None
| No key data
| <tt><compact size uint></tt>
| <tt><compact size uint input count></tt>
| Compact size unsigned integer representing the number of outputs in this PSBT.
| 2
| 0
@ -164,7 +164,7 @@ The currently defined global types are as follows:
| <tt>PSBT_GLOBAL_TX_MODIFIABLE = 0x06</tt>
| None
| No key data
| <tt><8-bit uint></tt>
| <tt><8-bit uint flags></tt>
| An 8 bit little endian unsigned integer as a bitfield for various transaction modification flags. Bit 0 is the Inputs Modifiable Flag and indicates whether inputs can be modified. Bit 1 is the Outputs Modifiable Flag and indicates whether outputs can be modified. Bit 2 is the Has SIGHASH_SINGLE flag and indicates whether the transaction has a SIGHASH_SINGLE signature who's input and output pairing must be preserved. Bit 2 essentially indicates that the Constructor must iterate the inputs to determine whether and how to add an input.
|
| 0
@ -175,7 +175,7 @@ The currently defined global types are as follows:
| <tt>PSBT_GLOBAL_VERSION = 0xFB</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint version></tt>
| The 32-bit little endian unsigned integer representing the version number of this PSBT. If omitted, the version number is 0.
|
|
@ -184,9 +184,9 @@ The currently defined global types are as follows:
|-
| Proprietary Use Type
| <tt>PSBT_GLOBAL_PROPRIETARY = 0xFC</tt>
| <tt><identifierlen> <identifier> <subtype> <subkeydata></tt>
| 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>
| <tt><compact size uint identifier length> <bytes identifier> <compact size uint subtype> <bytes subkeydata></tt>
| Compact size unsigned integer of the length of the identifier, followed by identifier prefix, followed by a compact size unsigned integer subtype, followed by the key data itself.
| <tt><bytes data></tt>
| Any value data as defined by the proprietary type user.
|
|
@ -212,7 +212,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_NON_WITNESS_UTXO = 0x00</tt>
| None
| No key data
| <tt><transaction></tt>
| <tt><bytes 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>
|
|
@ -223,7 +223,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_WITNESS_UTXO = 0x01</tt>
| None
| No key data
| <tt><64-bit int> <scriptPubKeylen> <scriptPubKey></tt>
| <tt><64-bit little endian int amount> <compact size uint scriptPubKeylen> <bytes 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>
|
|
@ -232,9 +232,9 @@ The currently defined per-input types are defined as follows:
|-
| Partial Signature
| <tt>PSBT_IN_PARTIAL_SIG = 0x02</tt>
| <tt><pubkey></tt>
| <tt><bytes pubkey></tt>
| The public key which corresponds to this signature.
| <tt><signature></tt>
| <tt><bytes signature></tt>
| The signature as would be pushed to the stack from a scriptSig or witness. The signature should be a valid ECDSA signature corresponding to the pubkey that would return true when verified and not a value that would return false or be invalid otherwise (such as a NULLDUMMY).
|
|
@ -245,7 +245,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_SIGHASH_TYPE = 0x03</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint sighash type></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.
|
|
@ -256,7 +256,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_REDEEM_SCRIPT = 0x04</tt>
| None
| No key data
| <tt><redeemScript></tt>
| <tt><bytes redeemScript></tt>
| The redeemScript for this input if it has one.
|
|
@ -267,7 +267,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_WITNESS_SCRIPT = 0x05</tt>
| None
| No key data
| <tt><witnessScript></tt>
| <tt><bytes witnessScript></tt>
| The witnessScript for this input if it has one.
|
|
@ -276,9 +276,9 @@ The currently defined per-input types are defined as follows:
|-
| BIP 32 Derivation Path
| <tt>PSBT_IN_BIP32_DERIVATION = 0x06</tt>
| <tt><pubkey></tt>
| <tt><bytes pubkey></tt>
| The public key
| <tt><32-bit uint> <32-bit uint>*</tt>
| <tt><4 byte fingerprint> <32-bit little endian uint path element>*</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.
|
|
@ -289,7 +289,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_FINAL_SCRIPTSIG = 0x07</tt>
| None
| No key data
| <tt><scriptSig></tt>
| <tt><bytes scriptSig></tt>
| The Finalized scriptSig contains a fully constructed scriptSig with signatures and any other scripts necessary for the input to pass validation.
|
|
@ -300,7 +300,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_FINAL_SCRIPTWITNESS = 0x08</tt>
| None
| No key data
| <tt><scriptWitness></tt>
| <tt><bytes scriptWitness></tt>
| The Finalized scriptWitness contains a fully constructed scriptWitness with signatures and any other scripts necessary for the input to pass validation.
|
|
@ -311,7 +311,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_POR_COMMITMENT = 0x09</tt>
| None
| No key data
| <tt><porCommitment></tt>
| <tt><bytes porCommitment></tt>
| The UTF-8 encoded commitment message string for the proof-of-reserves. See [[bip-0127.mediawiki|BIP 127]] for more information.
|
|
@ -322,7 +322,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_RIPEMD160 = 0x0a</tt>
| <tt><20-byte hash></tt>
| The resulting hash of the preimage
| <tt><preimage></tt>
| <tt><bytes preimage></tt>
| The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>RIPEMD160</tt> algorithm
|
|
@ -333,7 +333,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_SHA256 = 0x0b</tt>
| <tt><32-byte hash></tt>
| The resulting hash of the preimage
| <tt><preimage></tt>
| <tt><bytes preimage></tt>
| The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>SHA256</tt> algorithm
|
|
@ -344,7 +344,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_HASH160 = 0x0c</tt>
| <tt><20-byte hash></tt>
| The resulting hash of the preimage
| <tt><preimage></tt>
| <tt><bytes 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
|
|
@ -355,7 +355,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_HASH256 = 0x0d</tt>
| <tt><32-byte hash></tt>
| The resulting hash of the preimage
| <tt><preimage></tt>
| <tt><bytes preimage></tt>
| The hash preimage, encoded as a byte vector, which must equal the key when run through the <tt>SHA256</tt> algorithm twice
|
|
@ -366,7 +366,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_PREVIOUS_TXID = 0x0e</tt>
| None
| No key data
| <tt><txid></tt>
| <tt><32 byte txid></tt>
| 32 byte txid of the previous transaction whose output at PSBT_IN_OUTPUT_INDEX is being spent.
| 2
| 0
@ -377,7 +377,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_OUTPUT_INDEX = 0x0f</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint index></tt>
| 32 bit little endian integer representing the index of the output being spent in the transaction with the txid of PSBT_IN_PREVIOUS_TXID.
| 2
| 0
@ -388,7 +388,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_SEQUENCE = 0x10</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint sequence></tt>
| The 32 bit unsigned little endian integer for the sequence number of this input. If omitted, the sequence number is assumed to be the final sequence number (0xffffffff).
|
| 0
@ -399,7 +399,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_REQUIRED_TIME_LOCKTIME = 0x11</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint locktime></tt>
| 32 bit unsigned little endian integer greater than or equal to 500000000 representing the minimum Unix timestamp that this input requires to be set as the transaction's lock time.
|
| 0
@ -410,7 +410,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_REQUIRED_HEIGHT_LOCKTIME = 0x12</tt>
| None
| No key data
| <tt><32-bit uiht></tt>
| <tt><32-bit uiht locktime></tt>
| 32 bit unsigned little endian integer less than 500000000 representing the minimum block height that this input requires to be set as the transaction's lock time.
|
| 0
@ -421,7 +421,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_TAP_KEY_SIG = 0x13</tt>
| None
| No key data
| <tt><signature></tt>
| <tt><64 or 65 byte signature></tt>
| The 64 or 65 byte Schnorr signature for key path spending a Taproot output. Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
|
|
@ -430,9 +430,9 @@ The currently defined per-input types are defined as follows:
|-
| Taproot Script Spend Signature
| <tt>PSBT_IN_TAP_SCRIPT_SIG = 0x14</tt>
| <tt><xonlypubkey> <leafhash></tt>
| <tt><32 byte xonlypubkey> <leafhash></tt>
| A 32 byte X-only public key involved in a leaf script concatenated with the 32 byte hash of the leaf it is part of.
| <tt><signature></tt>
| <tt><64 or 65 byte signature></tt>
| The 64 or 65 byte Schnorr signature for this pubkey and leaf combination. Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
|
|
@ -441,9 +441,9 @@ The currently defined per-input types are defined as follows:
|-
| Taproot Leaf Script
| <tt>PSBT_IN_TAP_LEAF_SCRIPT = 0x15</tt>
| <tt><control block></tt>
| <tt><bytes control block></tt>
| The control block for this leaf as specified in BIP 341. The control block contains the merkle tree path to this leaf.
| <tt><script> <8-bit uint></tt>
| <tt><bytes script> <8-bit uint leaf version></tt>
| The script for this leaf as would be provided in the witness stack followed by the single byte leaf version. Note that the leaves included in this field should be those that the signers of this input are expected to be able to sign for. Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
|
|
@ -452,9 +452,9 @@ The currently defined per-input types are defined as follows:
|-
| Taproot Key BIP 32 Derivation Path
| <tt>PSBT_IN_TAP_BIP32_DERIVATION = 0x16</tt>
| <tt><xonlypubkey></tt>
| <tt><32 byte xonlypubkey></tt>
| A 32 byte X-only public key involved in this input. It may be the internal key, or a key present in a leaf script.
| <tt><hashes len> <leaf hash>* <4 byte fingerprint> <32-bit uint>*</tt>
| <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.
|
|
@ -465,7 +465,7 @@ The currently defined per-input types are defined as follows:
| <tt>PSBT_IN_TAP_INTERNAL_KEY = 0x17</tt>
| None
| No key data
| <tt><xonlypubkey></tt>
| <tt><32 byte xonlypubkey></tt>
| The X-only pubkey used as the internal key in this output. Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
|
|
@ -485,9 +485,9 @@ The currently defined per-input types are defined as follows:
|-
| Proprietary Use Type
| <tt>PSBT_IN_PROPRIETARY = 0xFC</tt>
| <tt><identifierlen> <identifier> <subtype> <subkeydata></tt>
| 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>
| <tt><compact size uint identifier length> <bytes identifier> <compact size uint subtype> <bytes subkeydata></tt>
| Compact size unsigned integer of the length of the identifier, followed by identifier prefix, followed by a compact size unsigned integer subtype, followed by the key data itself.
| <tt><bytes data></tt>
| Any value data as defined by the proprietary type user.
|
|
@ -515,7 +515,7 @@ determine which outputs are change outputs and verify that the change is returni
| <tt>PSBT_OUT_REDEEM_SCRIPT = 0x00</tt>
| None
| No key data
| <tt><redeemScript></tt>
| <tt><bytes redeemScript></tt>
| The redeemScript for this output if it has one.
|
|
@ -526,7 +526,7 @@ determine which outputs are change outputs and verify that the change is returni
| <tt>PSBT_OUT_WITNESS_SCRIPT = 0x01</tt>
| None
| No key data
| <tt><witnessScript></tt>
| <tt><bytes witnessScript></tt>
| The witnessScript for this output if it has one.
|
|
@ -535,9 +535,9 @@ determine which outputs are change outputs and verify that the change is returni
|-
| BIP 32 Derivation Path
| <tt>PSBT_OUT_BIP32_DERIVATION = 0x02</tt>
| <tt><public key></tt>
| <tt><bytes public key></tt>
| The public key
| <tt><32-bit uint> <32-bit uint>*</tt>
| <tt><4 byte fingerprint> <32-bit little endian uint path element>*</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.
|
|
@ -548,7 +548,7 @@ determine which outputs are change outputs and verify that the change is returni
| <tt>PSBT_OUT_AMOUNT = 0x03</tt>
| None
| No key data
| <tt><64-bit int></tt>
| <tt><64-bit int amount></tt>
| 64 bit signed little endian integer representing the output's amount in satoshis.
| 2
| 0
@ -559,7 +559,7 @@ determine which outputs are change outputs and verify that the change is returni
| <tt>PSBT_OUT_SCRIPT = 0x04</tt>
| None
| No key data
| <tt><script></tt>
| <tt><bytes script></tt>
| The script for this output, also known as the scriptPubKey. Must be omitted in PSBTv0. Must be provided in PSBTv2.
| 2
| 0
@ -570,7 +570,7 @@ determine which outputs are change outputs and verify that the change is returni
| <tt>PSBT_OUT_TAP_INTERNAL_KEY = 0x05</tt>
| None
| No key data
| <tt><xonlypubkey></tt>
| <tt><32 byte xonlypubkey></tt>
| The X-only pubkey used as the internal key in this output.
|
|
@ -581,7 +581,7 @@ determine which outputs are change outputs and verify that the change is returni
| <tt>PSBT_OUT_TAP_TREE = 0x06</tt>
| None
| No key data
| <tt>{<8-bit uint depth> <8-bit uint leaf version> <scriptlen> <script>}*</tt>
| <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.
|
|
@ -590,9 +590,9 @@ determine which outputs are change outputs and verify that the change is returni
|-
| Taproot Key BIP 32 Derivation Path
| <tt>PSBT_OUT_TAP_BIP32_DERIVATION = 0x07</tt>
| <tt><xonlypubkey></tt>
| <tt><32 byte xonlypubkey></tt>
| A 32 byte X-only public key involved in this output. It may be the internal key, or a key present in a leaf script.
| <tt><hashes len> <leaf hash>* <4 byte fingerprint> <32-bit uint>*</tt>
| <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.
|
|
@ -601,9 +601,9 @@ determine which outputs are change outputs and verify that the change is returni
|-
| Proprietary Use Type
| <tt>PSBT_OUT_PROPRIETARY = 0xFC</tt>
| <tt><identifierlen> <identifier> <subtype> <subkeydata></tt>
| 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>
| <tt><compact size uint identifier length> <bytes identifier> <compact size uint subtype> <bytes subkeydata></tt>
| Compact size unsigned integer of the length of the identifier, followed by identifier prefix, followed by a compact size unsigned integer subtype, followed by the key data itself.
| <tt><bytes data></tt>
| Any value data as defined by the proprietary type user.
|
|

View File

@ -62,7 +62,7 @@ The new global types for PSBT Version 2 are as follows:
| <tt>PSBT_GLOBAL_TX_VERSION = 0x02</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint version></tt>
| The 32-bit little endian signed integer representing the version number of the transaction being created. Note that this is not the same as the PSBT version number specified by the PSBT_GLOBAL_VERSION field.
| 2
| 0
@ -72,7 +72,7 @@ The new global types for PSBT Version 2 are as follows:
| <tt>PSBT_GLOBAL_FALLBACK_LOCKTIME = 0x03</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint locktime></tt>
| The 32-bit little endian unsigned integer representing the transaction locktime to use if no inputs specify a required locktime.
|
| 0
@ -82,7 +82,7 @@ The new global types for PSBT Version 2 are as follows:
| <tt>PSBT_GLOBAL_INPUT_COUNT = 0x04</tt>
| None
| No key data
| <tt><compact size uint></tt>
| <tt><compact size uint input count></tt>
| Compact size unsigned integer representing the number of inputs in this PSBT.
| 2
| 0
@ -92,7 +92,7 @@ The new global types for PSBT Version 2 are as follows:
| <tt>PSBT_GLOBAL_OUTPUT_COUNT = 0x05</tt>
| None
| No key data
| <tt><compact size uint></tt>
| <tt><compact size uint output count></tt>
| Compact size unsigned integer representing the number of outputs in this PSBT.
| 2
| 0
@ -102,7 +102,7 @@ The new global types for PSBT Version 2 are as follows:
| <tt>PSBT_GLOBAL_TX_MODIFIABLE = 0x06</tt>
| None
| No key data
| <tt><8-bit uint></tt>
| <tt><8-bit uint flags></tt>
| An 8 bit little endian unsigned integer as a bitfield for various transaction modification flags. Bit 0 is the Inputs Modifiable Flag and indicates whether inputs can be modified. Bit 1 is the Outputs Modifiable Flag and indicates whether outputs can be modified. Bit 2 is the Has SIGHASH_SINGLE flag and indicates whether the transaction has a SIGHASH_SINGLE signature who's input and output pairing must be preserved. Bit 2 essentially indicates that the Constructor must iterate the inputs to determine whether and how to add an input.
|
| 0
@ -126,7 +126,7 @@ The new per-input types for PSBT Version 2 are defined as follows:
| <tt>PSBT_IN_PREVIOUS_TXID = 0x0e</tt>
| None
| No key data
| <tt><txid></tt>
| <tt><32 byte txid></tt>
| 32 byte txid of the previous transaction whose output at PSBT_IN_OUTPUT_INDEX is being spent.
| 2
| 0
@ -136,7 +136,7 @@ The new per-input types for PSBT Version 2 are defined as follows:
| <tt>PSBT_IN_OUTPUT_INDEX = 0x0f</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint index></tt>
| 32 bit little endian integer representing the index of the output being spent in the transaction with the txid of PSBT_IN_PREVIOUS_TXID.
| 2
| 0
@ -146,7 +146,7 @@ The new per-input types for PSBT Version 2 are defined as follows:
| <tt>PSBT_IN_SEQUENCE = 0x10</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint sequence></tt>
| The 32 bit unsigned little endian integer for the sequence number of this input. If omitted, the sequence number is assumed to be the final sequence number (0xffffffff).
|
| 0
@ -156,7 +156,7 @@ The new per-input types for PSBT Version 2 are defined as follows:
| <tt>PSBT_IN_REQUIRED_TIME_LOCKTIME = 0x11</tt>
| None
| No key data
| <tt><32-bit uint></tt>
| <tt><32-bit little endian uint locktime></tt>
| 32 bit unsigned little endian integer greater than or equal to 500000000 representing the minimum Unix timestamp that this input requires to be set as the transaction's lock time.
|
| 0
@ -166,7 +166,7 @@ The new per-input types for PSBT Version 2 are defined as follows:
| <tt>PSBT_IN_REQUIRED_HEIGHT_LOCKTIME = 0x12</tt>
| None
| No key data
| <tt><32-bit uiht></tt>
| <tt><32-bit uiht locktime></tt>
| 32 bit unsigned little endian integer less than 500000000 representing the minimum block height that this input requires to be set as the transaction's lock time.
|
| 0
@ -190,7 +190,7 @@ The new per-output types for PSBT Version 2 are defined as follows:
| <tt>PSBT_OUT_AMOUNT = 0x03</tt>
| None
| No key data
| <tt><64-bit int></tt>
| <tt><64-bit little endian int amount></tt>
| 64 bit signed little endian integer representing the output's amount in satoshis.
| 2
| 0
@ -200,7 +200,7 @@ The new per-output types for PSBT Version 2 are defined as follows:
| <tt>PSBT_OUT_SCRIPT = 0x04</tt>
| None
| No key data
| <tt><script></tt>
| <tt><bytes script></tt>
| The script for this output, also known as the scriptPubKey. Must be omitted in PSBTv0. Must be provided in PSBTv2.
| 2
| 0

View File

@ -49,7 +49,7 @@ The new per-input types are defined as follows:
| <tt>PSBT_IN_TAP_KEY_SIG = 0x13</tt>
| None
| No key data <ref>'''Why is there no key data for <tt>PSBT_IN_TAP_KEY_SIG</tt>'''The signature in a key path spend corresponds directly with the pubkey provided in the output script. Thus it is not necessary to provide any metadata that attaches the key path spend signature to a particular pubkey.</ref>
| <tt><signature></tt>
| <tt><64 or 65 byte signature></tt>
| The 64 or 65 byte Schnorr signature for key path spending a Taproot output. Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
|
|
@ -59,7 +59,7 @@ The new per-input types are defined as follows:
| <tt>PSBT_IN_TAP_SCRIPT_SIG = 0x14</tt>
| <tt><xonlypubkey> <leafhash></tt>
| A 32 byte X-only public key involved in a leaf script concatenated with the 32 byte hash of the leaf it is part of.
| <tt><signature></tt>
| <tt><64 or 65 byte signature></tt>
| The 64 or 65 byte Schnorr signature for this pubkey and leaf combination. Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
|
|
@ -67,9 +67,9 @@ The new per-input types are defined as follows:
|-
| Taproot Leaf Script
| <tt>PSBT_IN_TAP_LEAF_SCRIPT = 0x15</tt>
| <tt><control block></tt>
| <tt><bytes control block></tt>
| The control block for this leaf as specified in BIP 341. The control block contains the merkle tree path to this leaf.
| <tt><script> <8-bit uint></tt>
| <tt><bytes script> <8-bit uint leaf version></tt>
| The script for this leaf as would be provided in the witness stack followed by the single byte leaf version. Note that the leaves included in this field should be those that the signers of this input are expected to be able to sign for. Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
|
|
@ -77,9 +77,9 @@ The new per-input types are defined as follows:
|-
| Taproot Key BIP 32 Derivation Path
| <tt>PSBT_IN_TAP_BIP32_DERIVATION = 0x16</tt>
| <tt><xonlypubkey></tt>
| <tt><32 byte xonlypubkey></tt>
| A 32 byte X-only public key involved in this input. It may be the internal key, or a key present in a leaf script.
| <tt><hashes len> <leaf hash>* <4 byte fingerprint> <32-bit uint>*</tt>
| <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.
|
|
@ -89,7 +89,7 @@ The new per-input types are defined as follows:
| <tt>PSBT_IN_TAP_INTERNAL_KEY = 0x17</tt>
| None
| No key data
| <tt><xonlypubkey></tt>
| <tt><32 byte xonlypubkey></tt>
| The X-only pubkey used as the internal key in this output.<ref>'''Why is the internal key provided?'''The internal key is not necessarily the same key as in the Taproot output script. BIP 341 recommends tweaking the key with the hash of itself. It may be necessary for signers to know what the internal key actually is so that they are able to determine whether an input can be signed by it.</ref> Finalizers should remove this field after <tt>PSBT_IN_FINAL_SCRIPTWITNESS</tt> is constructed.
|
|
@ -123,7 +123,7 @@ The new per-output types are defined as follows:
| <tt>PSBT_OUT_TAP_INTERNAL_KEY = 0x05</tt>
| None
| No key data
| <tt><xonlypubkey></tt>
| <tt><32 byte xonlypubkey></tt>
| The X-only pubkey used as the internal key in this output.
|
|
@ -133,7 +133,7 @@ The new per-output types are defined as follows:
| <tt>PSBT_OUT_TAP_TREE = 0x06</tt>
| None
| No key data
| <tt>{<8-bit uint depth> <8-bit uint leaf version> <scriptlen> <script>}*</tt>
| <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.
|
|
@ -141,9 +141,9 @@ The new per-output types are defined as follows:
|-
| Taproot Key BIP 32 Derivation Path
| <tt>PSBT_OUT_TAP_BIP32_DERIVATION = 0x07</tt>
| <tt><xonlypubkey></tt>
| <tt><32 byte xonlypubkey></tt>
| A 32 byte X-only public key involved in this output. It may be the internal key, or a key present in a leaf script.
| <tt><hashes len> <leaf hash>* <4 byte fingerprint> <32-bit uint>*</tt>
| <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.
|
|