From 7cd8ecd111ff89d03729011feb8265a6ff25c59d Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Wed, 13 Jul 2022 15:02:21 -0400 Subject: psbt: Unify formatting of key-value data to specify data type and name --- bip-0174.mediawiki | 114 ++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) (limited to 'bip-0174.mediawiki') diff --git a/bip-0174.mediawiki b/bip-0174.mediawiki index f1decfd..67f1c69 100644 --- a/bip-0174.mediawiki +++ b/bip-0174.mediawiki @@ -98,7 +98,7 @@ The currently defined global types are as follows: | PSBT_GLOBAL_UNSIGNED_TX = 0x00 | None | No key data -| +| | 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 | PSBT_GLOBAL_XPUB = 0x01 -| +| | 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. -| <32-bit uint> <32-bit uint>* +| <4 byte fingerprint> <32-bit little endian uint path element>* | 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: | PSBT_GLOBAL_TX_VERSION = 0x02 | None | No key data -| <32-bit uint> +| <32-bit little endian uint version> | 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: | PSBT_GLOBAL_FALLBACK_LOCKTIME = 0x03 | None | No key data -| <32-bit uint> +| <32-bit little endian uint locktime> | 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: | PSBT_GLOBAL_INPUT_COUNT = 0x04 | None | No key data -| +| | 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: | PSBT_GLOBAL_OUTPUT_COUNT = 0x05 | None | No key data -| +| | 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: | PSBT_GLOBAL_TX_MODIFIABLE = 0x06 | None | No key data -| <8-bit uint> +| <8-bit uint flags> | 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: | PSBT_GLOBAL_VERSION = 0xFB | None | No key data -| <32-bit uint> +| <32-bit little endian uint version> | 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 | PSBT_GLOBAL_PROPRIETARY = 0xFC -| -| Compact size unsigned integer , followed by identifier prefix of that length , followed by a subtype , followed by the key data itself . -| +| +| 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. +| | Any value data as defined by the proprietary type user. | | @@ -212,7 +212,7 @@ The currently defined per-input types are defined as follows: | PSBT_IN_NON_WITNESS_UTXO = 0x00 | None | No key data -| +| | 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 PSBT_IN_NON_WITNESS_UTXO and PSBT_IN_WITNESS_UTXO. '''Why can both UTXO types be provided?''' Many wallets began requiring the full previous transaction (i.e. PSBT_IN_NON_WITNESS_UTXO) for segwit inputs when PSBT was already in use. In order to be compatible with software which were expecting PSBT_IN_WITNESS_UTXO, both UTXO types must be allowed. | | @@ -223,7 +223,7 @@ The currently defined per-input types are defined as follows: | PSBT_IN_WITNESS_UTXO = 0x01 | None | No key data -| <64-bit int> +| <64-bit little endian int amount> | 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 PSBT_IN_NON_WITNESS_UTXO and PSBT_IN_WITNESS_UTXO | | @@ -232,9 +232,9 @@ The currently defined per-input types are defined as follows: |- | Partial Signature | PSBT_IN_PARTIAL_SIG = 0x02 -| +| | The public key which corresponds to this signature. -| +| | 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: | PSBT_IN_SIGHASH_TYPE = 0x03 | None | No key data -| <32-bit uint> +| <32-bit little endian uint sighash type> | 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: | PSBT_IN_REDEEM_SCRIPT = 0x04 | None | No key data -| +| | The redeemScript for this input if it has one. | | @@ -267,7 +267,7 @@ The currently defined per-input types are defined as follows: | PSBT_IN_WITNESS_SCRIPT = 0x05 | None | No key data -| +| | 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 | PSBT_IN_BIP32_DERIVATION = 0x06 -| +| | The public key -| <32-bit uint> <32-bit uint>* +| <4 byte fingerprint> <32-bit little endian uint path element>* | 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: | PSBT_IN_FINAL_SCRIPTSIG = 0x07 | None | No key data -| +| | 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: | PSBT_IN_FINAL_SCRIPTWITNESS = 0x08 | None | No key data -| +| | 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: | PSBT_IN_POR_COMMITMENT = 0x09 | None | No key data -| +| | 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: | PSBT_IN_RIPEMD160 = 0x0a | <20-byte hash> | The resulting hash of the preimage -| +| | The hash preimage, encoded as a byte vector, which must equal the key when run through the RIPEMD160 algorithm | | @@ -333,7 +333,7 @@ The currently defined per-input types are defined as follows: | PSBT_IN_SHA256 = 0x0b | <32-byte hash> | The resulting hash of the preimage -| +| | The hash preimage, encoded as a byte vector, which must equal the key when run through the SHA256 algorithm | | @@ -344,7 +344,7 @@ The currently defined per-input types are defined as follows: | PSBT_IN_HASH160 = 0x0c | <20-byte hash> | The resulting hash of the preimage -| +| | The hash preimage, encoded as a byte vector, which must equal the key when run through the SHA256 algorithm followed by the RIPEMD160 algorithm | | @@ -355,7 +355,7 @@ The currently defined per-input types are defined as follows: | PSBT_IN_HASH256 = 0x0d | <32-byte hash> | The resulting hash of the preimage -| +| | The hash preimage, encoded as a byte vector, which must equal the key when run through the SHA256 algorithm twice | | @@ -366,7 +366,7 @@ The currently defined per-input types are defined as follows: | PSBT_IN_PREVIOUS_TXID = 0x0e | None | No key data -| +| <32 byte txid> | 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: | PSBT_IN_OUTPUT_INDEX = 0x0f | None | No key data -| <32-bit uint> +| <32-bit little endian uint index> | 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: | PSBT_IN_SEQUENCE = 0x10 | None | No key data -| <32-bit uint> +| <32-bit little endian uint sequence> | 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: | PSBT_IN_REQUIRED_TIME_LOCKTIME = 0x11 | None | No key data -| <32-bit uint> +| <32-bit little endian uint locktime> | 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: | PSBT_IN_REQUIRED_HEIGHT_LOCKTIME = 0x12 | None | No key data -| <32-bit uiht> +| <32-bit uiht locktime> | 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: | PSBT_IN_TAP_KEY_SIG = 0x13 | None | No key data -| +| <64 or 65 byte signature> | The 64 or 65 byte Schnorr signature for key path spending a Taproot output. Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS is constructed. | | @@ -430,9 +430,9 @@ The currently defined per-input types are defined as follows: |- | Taproot Script Spend Signature | PSBT_IN_TAP_SCRIPT_SIG = 0x14 -| +| <32 byte xonlypubkey> | 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. -| +| <64 or 65 byte signature> | The 64 or 65 byte Schnorr signature for this pubkey and leaf combination. Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS is constructed. | | @@ -441,9 +441,9 @@ The currently defined per-input types are defined as follows: |- | Taproot Leaf Script | PSBT_IN_TAP_LEAF_SCRIPT = 0x15 -| +| | The control block for this leaf as specified in BIP 341. The control block contains the merkle tree path to this leaf. -|