External signer: pick up bitcoin/bitcoin#36114 and update the signer test #1122

Open
opened 2026-11-11 15:30:17 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-11 15:30:17 +00:00 (Migrated from github.com)

With an external-signer wallet, Send and Speed up broadcast whatever transaction the signer returns, even when it is not the one on the review screen. The fix is open upstream as bitcoin/bitcoin#36114 and is not in the vendored Core. This issue tracks picking it up, and the one change it needs here.

This needs a faulty or compromised signer, or signer bridge. It is not a claim about any real device. I used a mock signer on regtest that returns a prepared, validly signed transaction.

What happens now, at eed1f426fcb6 with Core 44901d8f64cb:

  • Send: Review shows 0.5 BTC to address A with a 131-sat fee. After Approve on external signer, it still shows that, with Signed on external signer. Ready to send. Clicking Send reports Transaction sent, and the mempool holds the signer's transaction: 1 BTC to address B, a 143-sat fee, and no output to A.
  • Speed up: on an unconfirmed 0.5 BTC payment, the signer returns an unrelated transaction that spends a different coin and pays 0.75 BTC elsewhere. The app reports Transaction updated, the wallet marks the original as replaced by it, and both confirm in the next block.
  • Control: with a signer that returns the reviewed transaction, the broadcast txid equals the reviewed one.

Core replaces the request with the signer's response without comparing them (external_signer.cpp#L124), and the app installs the result and enables Send (walletqmlmodel.cpp#L2498-L2500). Bitcoin-Qt uses the same Core call, so by source this is not specific to this GUI.

What the upstream fix changes

bitcoin/bitcoin#36114 merges the signer's response into the request instead of replacing it, and fails with Signer returned a PSBT for a different transaction when they differ. Send and Speed up both sign through that call, and the app already handles its failure, so by source no app change is needed for the fix to take effect.

What is needed here

  1. Update the vendored Core once bitcoin/bitcoin#36114 merges.
  2. Rewrite the signer step of qml_test_external_signer.py. It prepares a separate, finalized transaction, has Core's mock signer return it whatever the app asked for, and expects that txid in the mempool. The upstream change removes that mock's prepared-PSBT file and rejects finalized responses, so the test will fail on the update.

Optional: on a rejected response Send shows External signer failed to sign. Try again. and Speed up shows Failed to sign transaction. The reason goes only to debug.log, because Core passes no reason back to the app.

I have not built this app with bitcoin/bitcoin#36114, so the "no app change needed" reading is unconfirmed. Tested on macOS / Qt 6.9, isolated regtest, offscreen only; Send was run twice and Speed up once. Addresses, amounts, file paths and the Activity search text were set into their fields directly, and every other step was a click through the test bridge.

With an external-signer wallet, Send and Speed up broadcast whatever transaction the signer returns, even when it is not the one on the review screen. The fix is open upstream as bitcoin/bitcoin#36114 and is not in the vendored Core. This issue tracks picking it up, and the one change it needs here. This needs a faulty or compromised signer, or signer bridge. It is not a claim about any real device. I used a mock signer on regtest that returns a prepared, validly signed transaction. **What happens now**, at `eed1f426fcb6` with Core `44901d8f64cb`: - **Send:** Review shows 0.5 BTC to address A with a 131-sat fee. After **Approve on external signer**, it still shows that, with **Signed on external signer. Ready to send.** Clicking **Send** reports **Transaction sent**, and the mempool holds the signer's transaction: 1 BTC to address B, a 143-sat fee, and no output to A. - **Speed up:** on an unconfirmed 0.5 BTC payment, the signer returns an unrelated transaction that spends a different coin and pays 0.75 BTC elsewhere. The app reports **Transaction updated**, the wallet marks the original as replaced by it, and both confirm in the next block. - **Control:** with a signer that returns the reviewed transaction, the broadcast txid equals the reviewed one. Core replaces the request with the signer's response without comparing them ([external_signer.cpp#L124](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/src/external_signer.cpp#L124)), and the app installs the result and enables Send ([walletqmlmodel.cpp#L2498-L2500](https://github.com/bitcoin-core/gui-qml/blob/eed1f426fcb64daa61b004590335a03afe376274/qml/models/walletqmlmodel.cpp#L2498-L2500)). Bitcoin-Qt uses the same Core call, so by source this is not specific to this GUI. **What the upstream fix changes** bitcoin/bitcoin#36114 merges the signer's response into the request instead of replacing it, and fails with `Signer returned a PSBT for a different transaction` when they differ. Send and Speed up both sign through that call, and the app already handles its failure, so by source no app change is needed for the fix to take effect. **What is needed here** 1. Update the vendored Core once bitcoin/bitcoin#36114 merges. 2. Rewrite the signer step of [`qml_test_external_signer.py`](https://github.com/bitcoin-core/gui-qml/blob/eed1f426fcb64daa61b004590335a03afe376274/test/functional/qml_test_external_signer.py#L386-L425). It prepares a separate, finalized transaction, has Core's mock signer return it whatever the app asked for, and expects that txid in the mempool. The upstream change removes that mock's prepared-PSBT file and rejects finalized responses, so the test will fail on the update. Optional: on a rejected response Send shows `External signer failed to sign. Try again.` and Speed up shows `Failed to sign transaction.` The reason goes only to `debug.log`, because Core passes no reason back to the app. I have not built this app with bitcoin/bitcoin#36114, so the "no app change needed" reading is unconfirmed. Tested on macOS / Qt 6.9, isolated regtest, offscreen only; Send was run twice and Speed up once. Addresses, amounts, file paths and the Activity search text were set into their fields directly, and every other step was a click through the test bridge.
Sign in to join this conversation.
No description provided.