Support Imported PSBTs Whose Displayable Outputs Are All Wallet-Owned #759

Open
opened 2026-06-19 22:47:59 +00:00 by jarolrod · 1 comment
jarolrod commented 2026-06-19 22:47:59 +00:00 (Migrated from github.com)

The current send-recipient projection can reject imported PSBTs when all outputs are skipped as wallet-owned/change-like outputs. That is a send-draft assumption leaking into imported PSBT review.

Acceptance criteria:

  • Imported PSBTs remain reviewable/saveable even if all outputs are wallet-owned.
  • Broadcast eligibility remains based on Core PSBT analysis/finalization and fee checks.
  • The review UI clearly shows wallet-owned outputs instead of hiding them all.
  • Add a regression test for an imported PSBT whose outputs are all wallet-owned.

Follow-up to https://github.com/bitcoin-core/gui-qml/pull/750

The current send-recipient projection can reject imported PSBTs when all outputs are skipped as wallet-owned/change-like outputs. That is a send-draft assumption leaking into imported PSBT review. Acceptance criteria: - Imported PSBTs remain reviewable/saveable even if all outputs are wallet-owned. - Broadcast eligibility remains based on Core PSBT analysis/finalization and fee checks. - The review UI clearly shows wallet-owned outputs instead of hiding them all. - Add a regression test for an imported PSBT whose outputs are all wallet-owned. Follow-up to https://github.com/bitcoin-core/gui-qml/pull/750
jarolrod commented 2026-11-13 18:40:25 +00:00 (Migrated from github.com)

Concrete cases for this, from a wallet that holds the keys. The shortest needs no outside tool: the app refuses the file its own Save transaction wrote.

To reproduce:

  1. In Send, enter one of the wallet's own receiving addresses and 0.4 BTC, and click Review Transaction. The review opens normally.
  2. Click Save transaction and close the review.
  3. Options → Import PSBT from file, and choose the saved file.

A popup says "Not supported / The PSBT does not have any recipient outputs to review." and no review opens.

File Result
Saved by the app from the typed payment above refused, 3 of 3
Unsigned: 0.5 BTC to an own address plus change / a whole coin to an own address / two coins into one own address refused, 3 of 3 each
The first of those, signed and finalized by this wallet refused, 3 of 3
0.2 BTC to an outside address, 0.3 BTC to an own address labelled savings, plus change reviewed, 3 of 3
0.2 BTC to an outside address plus change reviewed, one recipient, 3 of 3

walletprocesspsbt in the same wallet completes each of these files, and testmempoolaccept allows the result.

In the mixed file, Recipients lists only the outside address, Total amount is 0.20000860 BTC, and Transaction flow draws the 0.3 BTC output as "Change · ". Core has that address as ischange: false with the label savings. Send transaction broadcast it.

The import skips every wallet-owned output when the wallet can send, and the flow calls an owned output that is not a listed recipient change:

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/models/walletqmlmodel.cpp (L2869-L2880)

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/models/walletqmlmodel.cpp (L2957-L2965)

Bitcoin-Qt's PSBT dialog, by its source, lists every output and marks the wallet's with "(own address)" (psbtoperationsdialog.cpp#L194). The same listing would cover #1117, the other branch of this condition.

Reproduced on qt6 at 2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen only, and once at eed1f426fcb6. File paths went through the test path fields, not the dialogs, and clicks through the test bridge. The outside files were built over RPC. Bitcoin-Qt was read, not run.

Concrete cases for this, from a wallet that holds the keys. The shortest needs no outside tool: the app refuses the file its own **Save transaction** wrote. To reproduce: 1. In **Send**, enter one of the wallet's own receiving addresses and 0.4 BTC, and click **Review Transaction**. The review opens normally. 2. Click **Save transaction** and close the review. 3. **Options → Import PSBT from file**, and choose the saved file. A popup says "Not supported / The PSBT does not have any recipient outputs to review." and no review opens. | File | Result | |---|---| | Saved by the app from the typed payment above | refused, 3 of 3 | | Unsigned: 0.5 BTC to an own address plus change / a whole coin to an own address / two coins into one own address | refused, 3 of 3 each | | The first of those, signed and finalized by this wallet | refused, 3 of 3 | | 0.2 BTC to an outside address, 0.3 BTC to an own address labelled `savings`, plus change | reviewed, 3 of 3 | | 0.2 BTC to an outside address plus change | reviewed, one recipient, 3 of 3 | `walletprocesspsbt` in the same wallet completes each of these files, and `testmempoolaccept` allows the result. In the mixed file, Recipients lists only the outside address, **Total amount** is 0.20000860 BTC, and Transaction flow draws the 0.3 BTC output as "Change · <wallet>". Core has that address as `ischange: false` with the label `savings`. **Send transaction** broadcast it. The import skips every wallet-owned output when the wallet can send, and the flow calls an owned output that is not a listed recipient change: https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/models/walletqmlmodel.cpp#L2869-L2880 https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/models/walletqmlmodel.cpp#L2957-L2965 Bitcoin-Qt's PSBT dialog, by its source, lists every output and marks the wallet's with "(own address)" ([psbtoperationsdialog.cpp#L194](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/src/qt/psbtoperationsdialog.cpp#L194)). The same listing would cover #1117, the other branch of this condition. Reproduced on `qt6` at `2bd5a61e8304`, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen only, and once at `eed1f426fcb6`. File paths went through the test path fields, not the dialogs, and clicks through the test bridge. The outside files were built over RPC. Bitcoin-Qt was read, not run.
Sign in to join this conversation.
No description provided.