Skip to content

Commit 788ca89

Browse files
committed
feat(cookbook): PSBTs multiple input signing
1 parent 536871e commit 788ca89

File tree

5 files changed

+1176
-0
lines changed

5 files changed

+1176
-0
lines changed

cookbook/src/SUMMARY.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66
- [Constructing and Signing Transactions](tx.md)
77
- [SegWit V0](tx_segwit-v0.md)
88
- [Taproot](tx_taproot.md)
9+
- [Working with PSBTs](psbt.md)
10+
- [Constructing and Signing Multiple Inputs - SegWit V0](psbt/multiple_inputs_segwit-v0.md)
11+
- [Constructing and Signing Multiple Inputs - Taproot](psbt/multiple_inputs_taproot.md)

cookbook/src/intro.md

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ over the peer-to-peer network, plus fun stuff you can do with miniscript.
2323
1. [Constructing and Signing Transactions](tx.md)
2424
1. [SegWit V0](tx_segwit-v0.md)
2525
1. [Taproot](tx_taproot.md)
26+
1. [Working with PSBTs](psbt.md)
27+
1. Constructing and Signing Multiple Inputs:
28+
1. [SegWit V0](psbt/multiple_inputs_segwit-v0.md)
29+
1. [Taproot](psbt/multiple_inputs_taproot.md)
2630

2731
## License
2832

cookbook/src/psbt.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Working with PSBTs
2+
3+
PSBTs (Partially Signed Bitcoin Transactions) are a format for encoding partially signed transactions.
4+
They are used in the context of multisignature wallets, hardware wallets,
5+
and other use cases where multiple parties need to collaborate to sign a transaction.
6+
7+
PSBTs (version 0) are defined in [BIP 174](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki).
8+
It specifies 6 different roles that a party can play in the PSBT workflow:
9+
10+
- **Creator**: Creates the PSBT and adds inputs and outputs.
11+
- **Updater**: Adds additional information to the PSBT,
12+
such as `redeemScript`, `witnessScript`, and BIP32 derivation paths.
13+
- **Signer**: Signs the PSBT, either all inputs or a subset of them.
14+
- **Combiner**: Combines multiple PSBTs into a single PSBT.
15+
- **Finalizer**: Finalizes the PSBT,
16+
adding any information necessary to complete the transaction.
17+
- **Extractor**: Extracts the finalized transaction from the PSBT.
18+
19+
Note that multiple roles can be handled by a single entity
20+
but each role is specialized in what it should be capable of doing.
21+
22+
We provide the following examples:
23+
24+
- [Constructing and Signing Multiple Inputs - SegWit V0](psbt/multiple_inputs_segwit-v0.md)
25+
- [Constructing and Signing Multiple Inputs - Taproot](psbt/multiple_inputs_taproot.md)
26+
27+
For extra information, see the [Bitcoin Optech article on PSBTs](https://bitcoinops.org/en/topics/psbt/).

0 commit comments

Comments
 (0)