rfc: store PSBTs in wallet #17619

issue Sjors opened this issue on November 27, 2019
  1. Sjors commented at 10:33 AM on November 27, 2019: member

    Now that #16944 has landed the GUI can create a PSBT and put it on the clipboard. The user can then use this with e.g. HWI:

    hwi --fingerprint=00000000 signtx 
    

    But if something goes wrong and clipboard loses the PSBT, they have to start over.

    #17509 adds support saving the PSBT to disk. Currently it only uses binary format, but it's easy to add base64 too, as @gwillen did in #16954. Problem then is: if the user chooses the wrong format, they have to create the transaction all over again.

    I propose that we store PSBTs in the wallet. They would show up in the transaction tab with some icon to indicate that they're incomplete. The user can copy them to clipboard or save to disk whenever they like. It should also be possible to delete them.

    When a user loads a PSBT (e.g. via #17509) we should match it against what's in the wallet, and automagically join it. When a PSBT is complete it can be broadcast, deleted from the wallet, replaced by the regular transaction. All these steps should probably prompt for permission.

    Slightly more advanced: PSBTs could keep coins locked by default (which incidentally creates a convenient way to persist locked coins, though there's other was to do that).

    This is probably most useful for the GUI, but we could also support this with a few new RPC methods like listwalletpsbts (bash autocompletion ftw #17289). This also saves applications like Specter (@stepansnigirev) and Junction (@justinmoon) from having to build their own pseudo-wallet, when dealing with air gapped wallets.

  2. Sjors added the label Feature on Nov 27, 2019
  3. fanquake added the label Brainstorming on Nov 27, 2019
  4. fanquake added the label Wallet on Nov 27, 2019
  5. instagibbs commented at 3:21 PM on November 27, 2019: member

    Saving non-"final" transactions is indeed something we may need to do eventually for a number of reasons, including smart contracty-ones. Might even be worthwhile to use in a non-backwards-conflicting way for things like multiple nlocktimed transactions that are stored for things like RBF bumping, so different logic can handle them instead of legacy. concept ACK

  6. BrandonOdiwuor commented at 9:32 AM on February 20, 2024: contributor

    What's the progress with this?

  7. Sjors commented at 1:25 PM on February 21, 2025: member

    @BrandonOdiwuor none. Reviewing pull requests like #27286, #27865 and #21283 may improve the wallet foundations and move this a few inches closer, but there's no open pull request that implements this feature.

    Two potential complications:

    • detecting that a PSBT is no longer usable because its inputs are spent (mark as abandoned?)
    • with MuSig2 #31247 some fields of the PSBT will be useless after a restart, so that needs to be handled in a sane way

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 09:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me