BIP 0174
How can separate devices help sign one transaction?
Your laptop can prepare a payment while the keys stay on separate devices. A PSBT is the document they pass around to get it signed.
Suppose the keys needed to spend some bitcoin live on different devices. Your laptop can prepare the payment, but it cannot finish the job alone. The other devices need to inspect the transaction, find the keys they control and return their signatures. They may even be offline.123
That leaves a practical problem: what do you send them? A bare unsigned transaction leaves out information a signer needs. A Partially Signed Bitcoin Transaction, or PSBT, packages the transaction with that information and gives each participant somewhere to put its contribution. BIP 174 defines the common format.145
Source details
This chapter is an independent explanation, not the proposal itself. Preamble fields are shown as the pinned files record them, without author e-mail addresses. Status is the proposal’s own field. It is not an endorsement or a sign of consensus.
BIP 174: Partially Signed Bitcoin Transaction Format
- BIP
- 174
- Layer
- Applications
- Title
- Partially Signed Bitcoin Transaction Format
- Authors
- Ava Chow
- Comments-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
- Version
- 1.4.4
Follow the document
Start with the Creator. It chooses the inputs and outputs and writes the unsigned transaction into a new PSBT. At this point the document says which coins to spend and where they should go, but the extra information about those coins has yet to be filled in.9
An Updater supplies what it knows: the outputs being spent, any scripts needed to spend them, and derivation paths that help a signing device find the right keys. In this example an additional update supplies the signature hash type, which tells the signer what its signature should commit to.57
Now the document can branch. Both signers receive the same updated copy. Each adds its own signatures and returns a PSBT. A Combiner brings the additions together. Nobody needs to wait for the other signer to finish before starting, and neither signer needs the other’s private keys.26710
Step through the document’s handoffs. Watch the signers add their contributions, then see the Combiner bring them together. The unsigned transaction stays the same while the document gains what it needs.2678
Fig. A05.2 Follow a PSBT through the handoffs
Static view: the Combiner’s PSBT, which holds every update and both signers’ signatures. With JavaScript you can pass the envelope from role to role.
Creator: the envelope holds the unsigned transaction and one empty map per input and output, 167 bytes.
Exact fields of this PSBT (1)
- global · 0x00 Unsigned Transaction (BIP 174): 2 inputs, 2 outputs, 154 bytes, scriptSigs empty
- key data
none
value020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd750000000000ffffffff838d0427d0ec650a68aa46bb0b098aea4422c071b2ca78352a077959d07cea1d0100000000ffffffff0270aaf00800000000160014d85c2b71d0060b09c9886aeb815e50991dda124d00e1f5050000000016001400aea9a2e5f0f876a588df5546e8742d1d87008f00000000
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Creator: the envelope holds the unsigned transaction and one empty map per input and output, 167 bytes.
Exact fields of this PSBT (1)
- global · 0x00 Unsigned Transaction (BIP 174): 2 inputs, 2 outputs, 154 bytes, scriptSigs empty
- key data
none
value020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd750000000000ffffffff838d0427d0ec650a68aa46bb0b098aea4422c071b2ca78352a077959d07cea1d0100000000ffffffff0270aaf00800000000160014d85c2b71d0060b09c9886aeb815e50991dda124d00e1f5050000000016001400aea9a2e5f0f876a588df5546e8742d1d87008f00000000
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Updater: 11 fields new; 889 bytes.
Exact fields marked new (11)
- input 0 · 0x00 Non-Witness UTXO (BIP 174): whole previous transaction, 187 bytes; its hash matches the input’s prevout
- key data
none
value0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000 - input 0 · 0x04 Redeem Script (BIP 174): 71-byte script
- key data
none
value5221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/0'
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
valued90c6a4f000000800000008000000080 - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/1'
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
valued90c6a4f000000800000008001000080 - input 1 · 0x01 Witness UTXO (BIP 174): spent output: 2.00000000 BTC and its 23-byte script
- key data
none
value00c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e887 - input 1 · 0x04 Redeem Script (BIP 174): 34-byte script
- key data
none
value00208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x05 Witness Script (BIP 174): 71-byte script
- key data
none
value522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/3'
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
valued90c6a4f000000800000008003000080 - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/2'
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
valued90c6a4f000000800000008002000080 - output 0 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/4'
- key data
03a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca58771
valued90c6a4f000000800000008004000080 - output 1 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/5'
- key data
027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b50051096
valued90c6a4f000000800000008005000080
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Updater: 11 fields new since the Creator; 889 bytes.
Exact fields marked new (11)
- input 0 · 0x00 Non-Witness UTXO (BIP 174): whole previous transaction, 187 bytes; its hash matches the input’s prevout
- key data
none
value0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000 - input 0 · 0x04 Redeem Script (BIP 174): 71-byte script
- key data
none
value5221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/0'
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
valued90c6a4f000000800000008000000080 - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/1'
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
valued90c6a4f000000800000008001000080 - input 1 · 0x01 Witness UTXO (BIP 174): spent output: 2.00000000 BTC and its 23-byte script
- key data
none
value00c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e887 - input 1 · 0x04 Redeem Script (BIP 174): 34-byte script
- key data
none
value00208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x05 Witness Script (BIP 174): 71-byte script
- key data
none
value522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/3'
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
valued90c6a4f000000800000008003000080 - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/2'
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
valued90c6a4f000000800000008002000080 - output 0 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/4'
- key data
03a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca58771
valued90c6a4f000000800000008004000080 - output 1 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/5'
- key data
027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b50051096
valued90c6a4f000000800000008005000080
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Updater adds sighash type: 2 fields new; 903 bytes.
Exact fields marked new (2)
- input 0 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 1 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Updater adds sighash type: 13 fields new since the Creator; 903 bytes.
Exact fields marked new (13)
- input 0 · 0x00 Non-Witness UTXO (BIP 174): whole previous transaction, 187 bytes; its hash matches the input’s prevout
- key data
none
value0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000 - input 0 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 0 · 0x04 Redeem Script (BIP 174): 71-byte script
- key data
none
value5221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/0'
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
valued90c6a4f000000800000008000000080 - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/1'
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
valued90c6a4f000000800000008001000080 - input 1 · 0x01 Witness UTXO (BIP 174): spent output: 2.00000000 BTC and its 23-byte script
- key data
none
value00c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e887 - input 1 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 1 · 0x04 Redeem Script (BIP 174): 34-byte script
- key data
none
value00208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x05 Witness Script (BIP 174): 71-byte script
- key data
none
value522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/3'
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
valued90c6a4f000000800000008003000080 - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/2'
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
valued90c6a4f000000800000008002000080 - output 0 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/4'
- key data
03a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca58771
valued90c6a4f000000800000008004000080 - output 1 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/5'
- key data
027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b50051096
valued90c6a4f000000800000008005000080
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Signer A: 2 fields new; 1117 bytes.
Exact fields marked new (2)
- input 0 · 0x02 Partial Signature (BIP 174): signature for public key 029583bf39…, sighash byte 01
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
value3044022074018ad4180097b873323c0015720b3684cc8123891048e7dbcd9b55ad679c99022073d369b740e3eb53dcefa33823c8070514ca55a7dd9544f157c167913261118c01 - input 1 · 0x02 Partial Signature (BIP 174): signature for public key 03089dc10c…, sighash byte 01
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
value3044022062eb7a556107a7c73f45ac4ab5a1dddf6f7075fb1275969a7f383efff784bcb202200c05dbb7470dbf2f08557dd356c7325c1ed30913e996cd3840945db12228da5f01
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Signer A: 15 fields new since the Creator; 1117 bytes.
Exact fields marked new (15)
- input 0 · 0x00 Non-Witness UTXO (BIP 174): whole previous transaction, 187 bytes; its hash matches the input’s prevout
- key data
none
value0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000 - input 0 · 0x02 Partial Signature (BIP 174): signature for public key 029583bf39…, sighash byte 01
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
value3044022074018ad4180097b873323c0015720b3684cc8123891048e7dbcd9b55ad679c99022073d369b740e3eb53dcefa33823c8070514ca55a7dd9544f157c167913261118c01 - input 0 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 0 · 0x04 Redeem Script (BIP 174): 71-byte script
- key data
none
value5221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/0'
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
valued90c6a4f000000800000008000000080 - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/1'
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
valued90c6a4f000000800000008001000080 - input 1 · 0x01 Witness UTXO (BIP 174): spent output: 2.00000000 BTC and its 23-byte script
- key data
none
value00c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e887 - input 1 · 0x02 Partial Signature (BIP 174): signature for public key 03089dc10c…, sighash byte 01
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
value3044022062eb7a556107a7c73f45ac4ab5a1dddf6f7075fb1275969a7f383efff784bcb202200c05dbb7470dbf2f08557dd356c7325c1ed30913e996cd3840945db12228da5f01 - input 1 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 1 · 0x04 Redeem Script (BIP 174): 34-byte script
- key data
none
value00208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x05 Witness Script (BIP 174): 71-byte script
- key data
none
value522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/3'
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
valued90c6a4f000000800000008003000080 - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/2'
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
valued90c6a4f000000800000008002000080 - output 0 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/4'
- key data
03a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca58771
valued90c6a4f000000800000008004000080 - output 1 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/5'
- key data
027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b50051096
valued90c6a4f000000800000008005000080
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Signer B: 2 fields new; 1118 bytes. It starts from the PSBT of updater 2, not of signer A.
Exact fields marked new (2)
- input 0 · 0x02 Partial Signature (BIP 174): signature for public key 02dab61ff4…, sighash byte 01
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
value3045022100f61038b308dc1da865a34852746f015772934208c6d24454393cd99bdf2217770220056e675a675a6d0a02b85b14e5e29074d8a25a9b5760bea2816f661910a006ea01 - input 1 · 0x02 Partial Signature (BIP 174): signature for public key 023add904f…, sighash byte 01
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
value3044022065f45ba5998b59a27ffe1a7bed016af1f1f90d54b3aa8f7450aa5f56a25103bd02207f724703ad1edb96680b284b56d4ffcb88f7fb759eabbe08aa30f29b851383d201
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Signer B: 15 fields new since the Creator; 1118 bytes. It starts from the PSBT of updater 2, not of signer A.
Exact fields marked new (15)
- input 0 · 0x00 Non-Witness UTXO (BIP 174): whole previous transaction, 187 bytes; its hash matches the input’s prevout
- key data
none
value0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000 - input 0 · 0x02 Partial Signature (BIP 174): signature for public key 02dab61ff4…, sighash byte 01
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
value3045022100f61038b308dc1da865a34852746f015772934208c6d24454393cd99bdf2217770220056e675a675a6d0a02b85b14e5e29074d8a25a9b5760bea2816f661910a006ea01 - input 0 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 0 · 0x04 Redeem Script (BIP 174): 71-byte script
- key data
none
value5221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/0'
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
valued90c6a4f000000800000008000000080 - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/1'
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
valued90c6a4f000000800000008001000080 - input 1 · 0x01 Witness UTXO (BIP 174): spent output: 2.00000000 BTC and its 23-byte script
- key data
none
value00c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e887 - input 1 · 0x02 Partial Signature (BIP 174): signature for public key 023add904f…, sighash byte 01
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
value3044022065f45ba5998b59a27ffe1a7bed016af1f1f90d54b3aa8f7450aa5f56a25103bd02207f724703ad1edb96680b284b56d4ffcb88f7fb759eabbe08aa30f29b851383d201 - input 1 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 1 · 0x04 Redeem Script (BIP 174): 34-byte script
- key data
none
value00208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x05 Witness Script (BIP 174): 71-byte script
- key data
none
value522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/3'
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
valued90c6a4f000000800000008003000080 - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/2'
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
valued90c6a4f000000800000008002000080 - output 0 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/4'
- key data
03a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca58771
valued90c6a4f000000800000008004000080 - output 1 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/5'
- key data
027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b50051096
valued90c6a4f000000800000008005000080
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Combiner: adds nothing of its own. It merges 2 fields only Signer A had and 2 fields only Signer B had; 1332 bytes.
Exact fields of this PSBT (18)
- global · 0x00 Unsigned Transaction (BIP 174): 2 inputs, 2 outputs, 154 bytes, scriptSigs empty
- key data
none
value020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd750000000000ffffffff838d0427d0ec650a68aa46bb0b098aea4422c071b2ca78352a077959d07cea1d0100000000ffffffff0270aaf00800000000160014d85c2b71d0060b09c9886aeb815e50991dda124d00e1f5050000000016001400aea9a2e5f0f876a588df5546e8742d1d87008f00000000 - input 0 · 0x00 Non-Witness UTXO (BIP 174): whole previous transaction, 187 bytes; its hash matches the input’s prevout
- key data
none
value0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000 - input 0 · 0x02 Partial Signature (BIP 174): signature for public key 029583bf39…, sighash byte 01
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
value3044022074018ad4180097b873323c0015720b3684cc8123891048e7dbcd9b55ad679c99022073d369b740e3eb53dcefa33823c8070514ca55a7dd9544f157c167913261118c01 - input 0 · 0x02 Partial Signature (BIP 174): signature for public key 02dab61ff4…, sighash byte 01
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
value3045022100f61038b308dc1da865a34852746f015772934208c6d24454393cd99bdf2217770220056e675a675a6d0a02b85b14e5e29074d8a25a9b5760bea2816f661910a006ea01 - input 0 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 0 · 0x04 Redeem Script (BIP 174): 71-byte script
- key data
none
value5221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/0'
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
valued90c6a4f000000800000008000000080 - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/1'
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
valued90c6a4f000000800000008001000080 - input 1 · 0x01 Witness UTXO (BIP 174): spent output: 2.00000000 BTC and its 23-byte script
- key data
none
value00c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e887 - input 1 · 0x02 Partial Signature (BIP 174): signature for public key 03089dc10c…, sighash byte 01
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
value3044022062eb7a556107a7c73f45ac4ab5a1dddf6f7075fb1275969a7f383efff784bcb202200c05dbb7470dbf2f08557dd356c7325c1ed30913e996cd3840945db12228da5f01 - input 1 · 0x02 Partial Signature (BIP 174): signature for public key 023add904f…, sighash byte 01
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
value3044022065f45ba5998b59a27ffe1a7bed016af1f1f90d54b3aa8f7450aa5f56a25103bd02207f724703ad1edb96680b284b56d4ffcb88f7fb759eabbe08aa30f29b851383d201 - input 1 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 1 · 0x04 Redeem Script (BIP 174): 34-byte script
- key data
none
value00208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x05 Witness Script (BIP 174): 71-byte script
- key data
none
value522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/3'
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
valued90c6a4f000000800000008003000080 - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/2'
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
valued90c6a4f000000800000008002000080 - output 0 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/4'
- key data
03a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca58771
valued90c6a4f000000800000008004000080 - output 1 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/5'
- key data
027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b50051096
valued90c6a4f000000800000008005000080
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Combiner: 17 fields new since the Creator; 1332 bytes.
Exact fields marked new (17)
- input 0 · 0x00 Non-Witness UTXO (BIP 174): whole previous transaction, 187 bytes; its hash matches the input’s prevout
- key data
none
value0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000 - input 0 · 0x02 Partial Signature (BIP 174): signature for public key 029583bf39…, sighash byte 01
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
value3044022074018ad4180097b873323c0015720b3684cc8123891048e7dbcd9b55ad679c99022073d369b740e3eb53dcefa33823c8070514ca55a7dd9544f157c167913261118c01 - input 0 · 0x02 Partial Signature (BIP 174): signature for public key 02dab61ff4…, sighash byte 01
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
value3045022100f61038b308dc1da865a34852746f015772934208c6d24454393cd99bdf2217770220056e675a675a6d0a02b85b14e5e29074d8a25a9b5760bea2816f661910a006ea01 - input 0 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 0 · 0x04 Redeem Script (BIP 174): 71-byte script
- key data
none
value5221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/0'
- key data
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f
valued90c6a4f000000800000008000000080 - input 0 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/1'
- key data
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7
valued90c6a4f000000800000008001000080 - input 1 · 0x01 Witness UTXO (BIP 174): spent output: 2.00000000 BTC and its 23-byte script
- key data
none
value00c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e887 - input 1 · 0x02 Partial Signature (BIP 174): signature for public key 03089dc10c…, sighash byte 01
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
value3044022062eb7a556107a7c73f45ac4ab5a1dddf6f7075fb1275969a7f383efff784bcb202200c05dbb7470dbf2f08557dd356c7325c1ed30913e996cd3840945db12228da5f01 - input 1 · 0x02 Partial Signature (BIP 174): signature for public key 023add904f…, sighash byte 01
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
value3044022065f45ba5998b59a27ffe1a7bed016af1f1f90d54b3aa8f7450aa5f56a25103bd02207f724703ad1edb96680b284b56d4ffcb88f7fb759eabbe08aa30f29b851383d201 - input 1 · 0x03 Sighash Type (BIP 174): SIGHASH_ALL
- key data
none
value01000000 - input 1 · 0x04 Redeem Script (BIP 174): 34-byte script
- key data
none
value00208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x05 Witness Script (BIP 174): 71-byte script
- key data
none
value522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/3'
- key data
023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73
valued90c6a4f000000800000008003000080 - input 1 · 0x06 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/2'
- key data
03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc
valued90c6a4f000000800000008002000080 - output 0 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/4'
- key data
03a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca58771
valued90c6a4f000000800000008004000080 - output 1 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/5'
- key data
027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b50051096
valued90c6a4f000000800000008005000080
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Input Finalizer: 3 fields new, 13 cleared; 976 bytes.
Exact fields marked new (3)
- input 0 · 0x07 Finalized scriptSig (BIP 174): final scriptSig, 218 bytes
- key data
none
value00473044022074018ad4180097b873323c0015720b3684cc8123891048e7dbcd9b55ad679c99022073d369b740e3eb53dcefa33823c8070514ca55a7dd9544f157c167913261118c01483045022100f61038b308dc1da865a34852746f015772934208c6d24454393cd99bdf2217770220056e675a675a6d0a02b85b14e5e29074d8a25a9b5760bea2816f661910a006ea01475221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 1 · 0x07 Finalized scriptSig (BIP 174): final scriptSig, 35 bytes
- key data
none
value2200208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x08 Finalized scriptWitness (BIP 174): final witness, 4 items
- key data
none
value0400473044022062eb7a556107a7c73f45ac4ab5a1dddf6f7075fb1275969a7f383efff784bcb202200c05dbb7470dbf2f08557dd356c7325c1ed30913e996cd3840945db12228da5f01473044022065f45ba5998b59a27ffe1a7bed016af1f1f90d54b3aa8f7450aa5f56a25103bd02207f724703ad1edb96680b284b56d4ffcb88f7fb759eabbe08aa30f29b851383d20147522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Input Finalizer: 7 fields new since the Creator; 976 bytes.
Exact fields marked new (7)
- input 0 · 0x00 Non-Witness UTXO (BIP 174): whole previous transaction, 187 bytes; its hash matches the input’s prevout
- key data
none
value0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000 - input 0 · 0x07 Finalized scriptSig (BIP 174): final scriptSig, 218 bytes
- key data
none
value00473044022074018ad4180097b873323c0015720b3684cc8123891048e7dbcd9b55ad679c99022073d369b740e3eb53dcefa33823c8070514ca55a7dd9544f157c167913261118c01483045022100f61038b308dc1da865a34852746f015772934208c6d24454393cd99bdf2217770220056e675a675a6d0a02b85b14e5e29074d8a25a9b5760bea2816f661910a006ea01475221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae - input 1 · 0x01 Witness UTXO (BIP 174): spent output: 2.00000000 BTC and its 23-byte script
- key data
none
value00c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e887 - input 1 · 0x07 Finalized scriptSig (BIP 174): final scriptSig, 35 bytes
- key data
none
value2200208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903 - input 1 · 0x08 Finalized scriptWitness (BIP 174): final witness, 4 items
- key data
none
value0400473044022062eb7a556107a7c73f45ac4ab5a1dddf6f7075fb1275969a7f383efff784bcb202200c05dbb7470dbf2f08557dd356c7325c1ed30913e996cd3840945db12228da5f01473044022065f45ba5998b59a27ffe1a7bed016af1f1f90d54b3aa8f7450aa5f56a25103bd02207f724703ad1edb96680b284b56d4ffcb88f7fb759eabbe08aa30f29b851383d20147522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae - output 0 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/4'
- key data
03a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca58771
valued90c6a4f000000800000008004000080 - output 1 · 0x02 BIP 32 Derivation Path (BIP 174): master fingerprint d90c6a4f, path m/0'/0'/5'
- key data
027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b50051096
valued90c6a4f000000800000008005000080
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Transaction Extractor: every input has final scripts, so it builds the 628-byte network transaction. That is no longer a PSBT.
Exact identifiers
- txid (display order, as BIP 174 and explorers print it)
c001dff12b319c432360072394690d2e9ef1a28a5d77e3f5346ecc46dff966cd- txid (byte order as computed)
cd66f9df46cc6e34f5e3775d8aa2f19e2e0d699423076023439c312bf1df01c0- wtxid (byte order as computed)
9cb369c45cf33aa8fc5081cdd0a2a3c9fb785b1ffbd9e30c89cc73f036687391
BIP 174 test vectors, lines 774–833: published test material on testnet keys. Parsed, combined and extracted by the tested model.
Creator, Updater, Signer and Combiner are jobs, rather than separate boxes you must buy. A wallet may perform several jobs. A signing device can also add information it knows. The format lets those jobs be divided between programs without requiring every program to know how the others work.251213
The example follows one route through those jobs. BIP 174 also describes arrangements such as manual CoinJoin and multisignature wallets. A PSBT can travel as a binary file or as Base64 text. The participants need to agree on the transaction and the format, rather than on a particular way of sending it.61415
Before the device signs
A signing device can show its owner the destinations, amounts and fee before signing. The PSBT describes the unspent transaction outputs (UTXOs) that the transaction will spend. These records supply the amounts needed to calculate the fee. Derivation paths can also help the device identify change returning to its own wallet.3516
Fig. A05.3 What the signer can show
Receiving information is not the same as establishing that it is true. For an input spending a pre-SegWit output, the Signer must hash the supplied previous transaction and check that its ID matches the one being spent. Otherwise a convincing-looking record could describe the wrong coins.19
Fig. A05.4 Does this previous transaction match?
Exact txids (byte order as computed)
- Double SHA-256 of the non-witness UTXO
58e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd75- Previous txid named by input 0 (as serialized in the prevout)
58e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd75- The same txid in display order, as BIP 174 prints it
75ddabb27b8845f5247975c8a5ba7c6f336c4570708ebe230caf6db5217ae858
SegWit has a less obvious trap. BIP 174 describes an attack in which a user is persuaded to sign repeatedly while the claimed amounts of other inputs change. A signature covering only its own input’s amount cannot settle the fee for the whole transaction. The BIP notes that many wallets require full previous transactions for SegWit inputs too.17
A Signer must use only the UTXOs supplied in the PSBT and only add data. It does not have to support every kind of input. Its contribution is a partial signature attached to an input, identified by the public key that made it. Other signatures can sit beside it without overwriting it.22021
Ready to send?
Collecting signatures does not immediately produce the transaction that the network expects. First the Input Finalizer arranges the collected pieces into each input’s final scriptSig, witness, or both. Think of the PSBT as the work in progress and these final fields as the assembled result.1122
Fig. A05.5 After assembly
That cleanup is deliberate. Once an input has its final scripts, the separate ingredients are no longer needed there. The Finalizer should clear everything except the UTXO records and fields it does not understand. If a sighash type was specified, it must refuse to finalize signatures that use a different one.112324
The Transaction Extractor then copies the final scripts into a network transaction. If an input is still incomplete, it must leave the PSBT untouched. This is the last handoff: the result can now leave the signing workflow as a transaction, rather than as a document asking for more work.22
There is another useful check at the merge. The Combiner must reject PSBTs for different transactions. Combining information is only meaningful when everybody has been working on the same payment. For compatible contributions, the order of combination does not matter; conflicting records need separate treatment.610
A place for every contribution
The format gives each piece of information a home. A global map holds transaction-wide information. Each input and each output gets its own map as well. Inside a map, records have keys and values: a key says what the information means, and its value holds the information itself.2125
Fig. A05.6 The document before anyone adds to it
A record’s key can include extra identifying data. For a partial signature, that extra data is the signer’s public key. This is how an input can hold several signatures of the same record type: each has a different full key. Repeating an identical key in one map would make the document invalid.22126
Fig. A05.7 Two signatures can share a record type
Exact keys and values
- From Signer A: key data (public key)
029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f- From Signer A: value (signature)
3044022074018ad4180097b873323c0015720b3684cc8123891048e7dbcd9b55ad679c99022073d369b740e3eb53dcefa33823c8070514ca55a7dd9544f157c167913261118c01- From Signer B: key data (public key)
02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7- From Signer B: value (signature)
3045022100f61038b308dc1da865a34852746f015772934208c6d24454393cd99bdf2217770220056e675a675a6d0a02b85b14e5e29074d8a25a9b5760bea2816f661910a006ea01
The byte format and validation rules
A PSBT begins with five bytes: the letters psbt followed by 0xff. Then come key-value maps, one global map followed by one map per input and one per output of the transaction. Each map is a list of records, each with a key and a value, and ends with a single zero byte.25
Each key is a type number, sometimes followed by key data. A map can hold several records of the same type as long as their full keys differ. That is how one input can carry several signatures at once: each partial signature’s key includes the public key that made it.221
The global map holds the transaction being built, in its old serialization and with every scriptSig and witness empty. A version 0 PSBT without it is invalid. Within a map every key must be unique, and a PSBT with a duplicated key is invalid too. More generally, if any key or value does not match the format its type specifies, the whole PSBT must be considered invalid.262728
The decoder behind this page rejects all twenty invalid PSBTs that BIP 174 lists, from a missing output map to a duplicated key. It accepts the ten valid ones and keeps every record when it writes them back out. Each invalid case is a rule made concrete. Examples are a duplicated key, a filled scriptSig in the unsigned transaction, and an unsigned transaction written with witness serialization. In twelve of the twenty, a key or value does not match its type’s format.26272829
Carry unfamiliar information forward
A device will eventually encounter a field that was added after its software was written. BIP 174 requires signers to ignore unfamiliar types and pass them through. The device can do its own job without erasing information another participant needs. Finalization preserves those unknown fields too.1124
Fig. A05.8 Keep what you do not understand
Exact unknown records
- G · type 0xf0
- key data
010203040506070809
value0102030405060708090a0b0c0d0e0f - G · type 0xf0
- key data
010203040506070810
value0102030405060708090a0b0c0d0e0f - IN0 · type 0xf0
- key data
010203040506070809
value0102030405060708090a0b0c0d0e0f - IN0 · type 0xf0
- key data
010203040506070810
value0102030405060708090a0b0c0d0e0f - OUT0 · type 0xf0
- key data
010203040506070809
value0102030405060708090a0b0c0d0e0f - OUT0 · type 0xf0
- key data
010203040506070810
value0102030405060708090a0b0c0d0e0f
Source and example notes
BIP 174 was assigned in 2017 and is recorded as deployed in the pinned source. The example replays published PSBTs; it does not create signatures, hold keys or broadcast a transaction.7831
An unknown PSBT version is a different situation. The parser should stop immediately: it cannot assume that it understands the document’s rules. Version 2 PSBTs and Taproot fields are defined in other proposals. This chapter follows BIP 174’s version 0, with field names taken from the shared type registry.323334
The PSBT is the shared work in progress. Each participant can add its part while keeping its private keys separate. Finalization and extraction turn those contributions into the transaction the network expects.261122
Evidence
Each numbered marker in the text points here, and the ↩ links lead back to the text. Quotes are verbatim
from the BIP files at commit 3a10b5b, wiki markup
included. Links open the exact lines. Labels say what kind of statement each entry is: a rule, the
author’s rationale, history, a test vector, or our own inference.
-
↩ a b Author’s rationale Passing partially signed transactions between signers was implementation dependent; BIP174 aims for a standard, extensible format, and lets offline signers such as hardware wallets sign without direct UTXO access.
Quoted source text (2)
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.
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.
-
↩ a b c d e f g h i j k Rule The Signer uses only the UTXOs in the PSBT, only adds data, and records each signature as a Partial Signature on its input.
Quoted source text (2)
The Signer must only use the UTXOs provided in the PSBT to produce signatures for inputs.
The Signer must only add data to a PSBT. Any signatures created by the Signer must be added as a "Partial Signature" key-value pair for the respective input it relates to.
-
↩ a b c Rule A Signer can compute the addresses, values and fee being sent and show them to the user as confirmation of intent.
Quoted source text (1)
The Signer can additionally compute the addresses and values being sent, and the transaction fee, optionally showing this data to the user as a confirmation of intent and the consequences of signing the PSBT.
-
↩ Rule A PSBT carries the information a signer needs, holds signatures for an input until it has a complete set, and lets the signer be offline.
Quoted source text (1)
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.
-
↩ a b c d e f Rule The Updater adds information it has: UTXOs, redeem and witness scripts, and BIP32 derivation paths.
Quoted source text (1)
If it has the UTXO for an input, it should add it to the PSBT. The Updater should also add redeemScripts, witnessScripts, and BIP 32 derivation paths to the input and output data if it knows them.
-
↩ a b c d e f g h Rule The Combiner merges PSBTs for the same transaction into one containing all their key-value pairs, and must not combine different PSBTs.
Quoted source text (2)
The Combiner must merge them into one PSBT (if possible), or fail. The resulting PSBT must contain all of the key-value pairs from each of the PSBTs.
A Combiner must not combine two different PSBTs.
-
↩ a b c d e f Test vector BIP174's test vectors publish one PSBT per role in a full trace, from creation to the extracted network transaction.
BIP 174 L763 BIP 174 L821 BIP 174 L831
Quoted source text (3)
A creator creating a PSBT for a transaction which creates the following outputs:
Given both of the above PSBTs, a combiner must create this PSBT.
Given the above PSBT, a transaction extractor must create this Bitcoin transaction:
-
↩ a b c d e Test vector The tested model parses every state of the published trace, reproduces the combiner output byte for byte from the two signers' PSBTs in either order, and reproduces the extracted transaction.
Quoted source text (2)
A combiner must produce the given result for any order of its inputs
* Bytes in Hex: <pre>0200000000010258e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd7500000000da00473044022074018ad4180097b873323c0015720b3684cc8123891048e7dbcd9b55ad679c99022073d369b740e3eb53dcefa33823c8070514ca55a7dd9544f157c167913261118c01483045022100f61038b308dc1da865a34852746f015772934208c6d24454393cd99bdf2217770220056e675a675a6d0a02b85b14e5e29074d8a25a9b5760bea2816f661910a006ea01475221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752aeffffffff838d0427d0ec650a68aa46bb0b098aea4422c071b2ca78352a077959d07cea1d01000000232200208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903ffffffff0270aaf00800000000160014d85c2b71d0060b09c9886aeb815e50991dda124d00e1f5050000000016001400aea9a2e5f0f876a588df5546e8742d1d87008f000400473044022062eb7a556107a7c73f45ac4ab5a1dddf6f7075fb1275969a7f383efff784bcb202200c05dbb7470dbf2f08557dd356c7325c1ed30913e996cd3840945db12228da5f01473044022065f45ba5998b59a27ffe1a7bed016af1f1f90d54b3aa8f7450aa5f56a25103bd02207f724703ad1edb96680b284b56d4ffcb88f7fb759eabbe08aa30f29b851383d20147522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae00000000</pre>
-
↩ a b Rule The Creator puts the unsigned transaction into a new PSBT with empty input and output fields.
Quoted source text (1)
The Creator creates a new PSBT. It must create an unsigned transaction and place it in the PSBT. The Creator must create empty input and output fields.
-
↩ a b Rule Combining independent additions is equivalent to applying them in sequence, in either order, unless fields conflict.
Quoted source text (2)
Combine(fA(psbt), fB(psbt)) == fA(fB(psbt)) == fB(fA(psbt))
Combining two PSBTs is commutative unless the PSBTs have conflicting fields
-
↩ a b c d e f Rule The Input Finalizer builds the final scriptSig and/or scriptWitness for inputs that have enough data (leaving an empty one unset); in that input's map, everything except the UTXO and unknown fields should then be cleared.
BIP 174 L520 BIP 174 L523 BIP 174 L521–522
Quoted source text (3)
If it does, it must construct the <tt>0x07</tt> Finalized scriptSig and <tt>0x08</tt> Finalized scriptWitness and place them into the input key-value map.
All other data except the UTXO and unknown fields (including <tt>PSBT_IN_PROPRIETARY</tt> fields the Input Finalizer does not understand) in the input key-value map should be cleared from the PSBT.
If scriptSig is empty for an input, <tt>0x07</tt> should remain unset rather than assigned an empty array. Likewise, if no scriptWitness exists for an input, <tt>0x08</tt> should remain unset rather than assigned an empty array.
-
↩ Rule PSBT defines specialized roles; one entity can handle several of them.
Quoted source text (1)
Multiple roles can be handled by a single entity, but each role is specialized in what it should be capable of doing.
-
↩ Author’s rationale One entity is likely to be both Creator and Updater, and likewise both Signer and Updater.
Quoted source text (2)
A single entity is likely to be both a Creator and Updater.
A single entity is likely to be both a Signer and an Updater as it can update a PSBT with necessary information prior to signing it.
-
↩ Author’s rationale BIP174 illustrates example workflows, such as a manual CoinJoin and a 2-of-3 multisig; these are examples, not a mandated sequence.
Quoted source text (2)
===Manual CoinJoin Workflow===
===2-of-3 Multisig Workflow===
-
↩ Rule A PSBT can be a binary file or a Base64 string.
Quoted source text (1)
A PSBT can be represented in two ways: in binary (as a file) or as a Base64 string
-
↩ Rule Signers may hide change outputs from users; they can detect change using the BIP32 derivation paths in inputs and outputs and the global extended public keys.
Quoted source text (1)
In such displays, signers may wish to identify which outputs are change outputs in order to omit them to avoid additional user confusion. In order to detect change, a signer can use the BIP 32 derivation paths provided in inputs and outputs as well as the extended public keys provided globally.
-
↩ a b Author’s rationale Because BIP143 signatures commit only to their own input's amount, an attacker who gets a user to sign repeatedly can redirect funds to fees by altering other inputs' witness UTXO amounts; many wallets therefore require the full previous transaction.
Quoted source text (2)
The sighash algorithm for Segwit specified in BIP 143 is known to have an issue where an attacker could trick a user to sending Bitcoin to fees if they are able to convince the user to sign a malicious transaction multiple times. This is possible because the amounts in <tt>PSBT_IN_WITNESS_UTXO</tt> of other segwit inputs can be modified without effecting the signature for a particular input.
many wallets are requiring that the full previous transaction (i.e. <tt>PSBT_IN_NON_WITNESS_UTXO</tt>) be provided to ensure that the amounts of other inputs are not being tampered with.
-
↩ a b Test vector Read by the tested model from the Updater's published PSBT: input 0's non-witness UTXO hashes to the txid its prevout names (printed reversed in BIP 174's trace), and the UTXO records give the amounts each input spends; with the published outputs that fixes the fee, though input 1's amount is only stated by a witness UTXO record.
Quoted source text (2)
TXID: <tt>75ddabb27b8845f5247975c8a5ba7c6f336c4570708ebe230caf6db5217ae858</tt>, Index: <tt>0</tt>
Amount: <tt>1.49990000</tt>
-
↩ a b Rule Before signing a non-witness input, the Signer must verify that the non-witness UTXO's TXID matches the one in the unsigned transaction.
Quoted source text (1)
Before signing a non-witness input, the Signer must verify that the TXID of the non-witness UTXO matches the TXID specified in the unsigned transaction.
-
↩ Rule Signers do not need to sign for every input type.
Quoted source text (1)
Signers do not need to sign for all possible input types. For example, a signer may choose to only sign Segwit inputs.
-
↩ a b c d e Rule A record's key is its type plus optional key data; several records can share a type in one map, but each full key must be unique.
Quoted source text (2)
<key> := <keylen> <keytype> <keydata>
There can be multiple entries with the same <tt><keytype></tt> within a specific <tt><map></tt>, but the <tt><key></tt> must be unique.
-
↩ a b c Rule The Transaction Extractor turns a fully finalized PSBT into a network-serialized transaction; otherwise it must not modify the PSBT.
Quoted source text (1)
If they do, the Transaction Extractor should construct complete scriptSigs and scriptWitnesses and encode them into network serialized transactions. Otherwise the Extractor must not modify the PSBT. The Extractor should produce a fully valid, network serialized transaction if all inputs are complete.
-
↩ Rule If an input specifies a sighash type, the Input Finalizer must not finalize it when any signature uses a different type.
Quoted source text (1)
If the input has a <tt>PSBT_IN_SIGHASH_TYPE</tt> field, the Input Finalizer must fail to finalize that input if any signature does not match the specified sighash type.
-
↩ a b c Rule Signers must pass through key-value pairs they do not understand when re-serializing; this keeps the format extensible.
BIP 174 L351–352 BIP 174 L544–546
Quoted source text (2)
If the signer encounters key-value pairs that it does not understand, it must pass those key-value pairs through when re-serializing the transaction.
Backwards compatibility will still be maintained as those new types will be ignored and passed-through by signers which do not know about them.
-
↩ a b c Rule A PSBT is magic bytes, a global map, then one map per input and per output; each map is a sequence of key-value records ended by 0x00.
BIP 174 L49–50 BIP 174 L57 BIP 174 L58
Quoted source text (3)
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 <tt>0x00</tt> byte
<psbt> := <magic> <global-map> <input-map>* <output-map>*
<magic> := 0x70 0x73 0x62 0x74 0xFF
-
↩ a b c d Rule Keys within a map must be unique; PSBTs with duplicate keys are invalid.
Quoted source text (1)
Keys within each scope should never be duplicated; all keys in the format are unique. PSBTs containing duplicate keys are invalid.
-
↩ a b Rule The global unsigned transaction must have empty scriptSigs and witnesses and use the old serialization without witnesses; version 0 PSBTs must include it.
Quoted source text (2)
The scriptSigs and witnesses for each input must be empty. The transaction must be in the old serialization format (without witnesses).
Version 0 PSBTs must include PSBT_GLOBAL_UNSIGNED_TX, if omitted, the PSBT is invalid.
-
↩ a b Rule Every key must carry the data its type specifies; if any key or value does not match its type's format, the PSBT must be considered invalid.
Quoted source text (1)
All keys must have the data that they specify. If any key or value does not match the specified format for that type, the PSBT must be considered invalid.
-
↩ Test vector BIP174 lists invalid PSBTs (duplicate keys, a filled scriptSig, a witness-serialized unsigned transaction, and twelve keys or values that do not match their type's format); the tested parser rejects all twenty and accepts all ten listed valid ones.
BIP 174 L616 BIP 174 L634 BIP 174 L698
Quoted source text (3)
The following are invalid PSBTs:
* Case: PSBT with duplicate keys in an input
The following are valid PSBTs:
-
↩ Test vector BIP174's vectors include two PSBTs with unknown key-value pairs and the combined PSBT, which keeps all of them; the tested combiner reproduces it.
Quoted source text (2)
Given these two PSBTs with unknown key-value pairs:
A combiner which orders keys lexicographically must produce the following PSBT:
-
↩ History BIP174 was assigned in 2017; its preamble records the status Deployed and document version 1.4.4.
BIP 174 L10 BIP 174 L8 BIP 174 L12
Quoted source text (3)
Assigned: 2017-07-12
Status: Deployed
Version: 1.4.4
-
↩ Rule A parser that meets a PSBT version number it does not recognize should stop, because the PSBT contains types it cannot safely ignore.
Quoted source text (1)
If a parser encounters a version number it does not recognize, it should exit immediately as this indicates that the PSBT will contain types that it does not know about and cannot be ignored.
-
↩ Rule BIP174 describes the generic format and the specification for version 0.
Quoted source text (1)
The generic format is described here in addition to the specification for version 0 of this format.
-
↩ Rule A type registry collects PSBT fields from every BIP that defines them, naming each field's parent BIP; version 2 and Taproot fields come from other BIPs, not BIP174.
BIP 174 (type-registry.mediawiki) L1 BIP 174 (type-registry.mediawiki) L19–20 BIP 174 (type-registry.mediawiki) L143–144
Quoted source text (3)
This document collects the fields and types used in PSBTs of any version from all BIPs that define PSBT fields to help coordinate and prevent key collisions.
<tt>PSBT_GLOBAL_TX_VERSION = 0x02</tt> | [[../bip-0370.mediawiki|370]]
<tt>PSBT_IN_TAP_KEY_SIG = 0x13</tt> | [[../bip-0371.mediawiki|371]]