Partially Signed Bitcoin Transaction Format
This document proposes a binary transaction format which contains the information necessary for a signer to produce signatures for the transaction and holds the signatures for an input while the input does not have a complete set of signatures. The signer can be offline as all necessary information will be provided in the transaction. The generic format is described here in addition to the specification for version 0 of this format.
No reviewsSpecification
BIP: 174 Layer: Applications Title: Partially Signed Bitcoin Transaction Format Authors: Ava ChowComments-Summary: No comments yet. Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0174 Status: Deployed Type: Specification Assigned: 2017-07-12 License: BSD-2-Clause
Introduction
Abstract
This document proposes a binary transaction format which contains the information necessary for a signer to produce signatures for the transaction and holds the signatures for an input while the input does not have a complete set of signatures. The signer can be offline as all necessary information will be provided in the transaction.
The generic format is described here in addition to the specification for version 0 of this format.
Copyright
This BIP is licensed under the 2-clause BSD license.
Motivation
Creating unsigned or partially signed transactions to be passed around to multiple signers is currently implementation dependent, making it hard for people who use different wallet software from being able to easily do so. One of the goals of this document is to create a standard and extensible format that can be used between clients to allow people to pass around the same transaction to sign and combine their signatures. The format is also designed to be easily extended for future use which is harder to do with existing transaction formats.
Signing transactions also requires users to have access to the UTXOs being spent. This transaction format will allow offline signers such as air-gapped wallets and hardware wallets to be able to sign transactions without needing direct access to the UTXO set and without risk of being defrauded.
Specification
The Partially Signed Bitcoin Transaction (PSBT) format consists of key-value maps. Each map consists of a sequence of key-value records, terminated by a 0x00 byte .
Where:
;
The currently defined global types are as follows:
| Name | Versions Requiring Inclusion | Versions Requiring Exclusion | Versions Allowing Inclusion | Parent BIP | |||||
|---|---|---|---|---|---|---|---|---|---|
| Unsigned Transaction | 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 | 0 | 174 | |
| 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. | <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. | 0, 2 | 174 | |||
| Transaction Version | PSBT_GLOBAL_TX_VERSION = 0x02 | None | No key data | <32-bit little endian int 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 | 2 | 370 |
| Fallback Locktime | PSBT_GLOBAL_FALLBACK_LOCKTIME = 0x03 | None | No key data | <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 | 2 | 370 | |
| Input Count | PSBT_GLOBAL_INPUT_COUNT = 0x04 | None | No key data | Compact size unsigned integer representing the number of inputs in this PSBT. | 2 | 0 | 2 | 370 | |
| Output Count | PSBT_GLOBAL_OUTPUT_COUNT = 0x05 | None | No key data | Compact size unsigned integer representing the number of outputs in this PSBT. | 2 | 0 | 2 | 370 | |
| Transaction Modifiable Flags | PSBT_GLOBAL_TX_MODIFIABLE = 0x06 | None | No key data | <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 | 2 | 370 | |
| Silent Payment Global ECDH Share | PSBT_GLOBAL_SP_ECDH_SHARE = 0x07 | <33 byte scan key> | The scan key that this ECDH share is for. | <33 byte share> | An ECDH share for a scan key. The ECDH shared is computed with a * B_scan, where a is the sum of all private keys of all eligible inputs, and B_scan is the scan key of a recipient. | 0 | 2 | 375 | |
| Silent Payment Global DLEQ Proof | PSBT_GLOBAL_SP_DLEQ = 0x08 | <33 byte scan key> | The scan key that this proof covers. | <64-byte proof> | A BIP374 DLEQ proof computed for the matching ECDH share. | 0 | 2 | 375 | |
| PSBT Version Number | PSBT_GLOBAL_VERSION = 0xFB | None | No key data | <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. | 2 | 0, 2 | 174 | |
| Proprietary Use Type | PSBT_GLOBAL_PROPRIETARY = 0xFC | 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. | 0, 2 | 174 |
The currently defined per-input types are defined as follows:
{|
! Name
!
[Content truncated — view full spec at source]
Related Specs
Discussion (0 threads)
Loading discussions...