External signer setup #1060

Open
epicleafies wants to merge 26 commits from external-signer-setup into qt6 AGit
epicleafies commented 2026-11-02 19:00:36 +00:00 (Migrated from github.com)

External signer wallets can be set up from Add wallet before HWI is configured, and the signer status says whether the problem is HWI or the device. Fixes #671. Fixes #672. Fixes #1018.

  • Add wallet: External signer is always offered when the build supports it. Without a working HWI it opens a "Set up HWI" step to install, choose and check it. A working HWI skips the step; the wallet name step can go back to it.

  • External signer settings: the signer command and the device are shown separately, so device problems no longer read as a broken HWI path. Paths with spaces are rejected, since Bitcoin Core can't run them. A signer given with -signer is used and can be checked, but not edited.

  • Checking: HWI runs only when you ask, off the main thread, and the path is locked while it runs. Settings and Add wallet share one path and result. Loading wallets no longer runs HWI.

  • Builds without external signer support: the option and its settings are hidden.

  • Shared: LinkText for a link inside a sentence; status icons no longer keep an old color; the alert icon shows "!" instead of "i"; banners shown when their page opens now appear; wizard pages that fit no longer scroll into empty space.

  • Tests: setup and settings states, checking, the shared path, the build gate, LinkText and the status icons.

Known limitations: signing on the device still runs on the main thread (#977).

Add wallet 1-add-wallet
Set up HWI 2-set-up-hwi 3-hwi-no-device 4-hwi-device-found
External signer settings 5-settings-not-responding 6-settings-device-locked
External signer wallets can be set up from Add wallet before HWI is configured, and the signer status says whether the problem is HWI or the device. Fixes #671. Fixes #672. Fixes #1018. * **Add wallet**: External signer is always offered when the build supports it. Without a working HWI it opens a "Set up HWI" step to install, choose and check it. A working HWI skips the step; the wallet name step can go back to it. * **External signer settings**: the signer command and the device are shown separately, so device problems no longer read as a broken HWI path. Paths with spaces are rejected, since Bitcoin Core can't run them. A signer given with `-signer` is used and can be checked, but not edited. * **Checking**: HWI runs only when you ask, off the main thread, and the path is locked while it runs. Settings and Add wallet share one path and result. Loading wallets no longer runs HWI. * **Builds without external signer support**: the option and its settings are hidden. * **Shared**: `LinkText` for a link inside a sentence; status icons no longer keep an old color; the alert icon shows "!" instead of "i"; banners shown when their page opens now appear; wizard pages that fit no longer scroll into empty space. * **Tests**: setup and settings states, checking, the shared path, the build gate, `LinkText` and the status icons. Known limitations: signing on the device still runs on the main thread (#977). <details> <summary>Add wallet</summary> <img width="1280" height="720" alt="1-add-wallet" src="https://git.fish.foo/attachments/dc90996e-2504-41a8-aaff-ab1324463e8f" /> </details> <details> <summary>Set up HWI</summary> <img width="1280" height="720" alt="2-set-up-hwi" src="https://git.fish.foo/attachments/18425d80-ccd5-4622-8590-d17037ff15f5" /> <img width="1280" height="720" alt="3-hwi-no-device" src="https://git.fish.foo/attachments/f07481cb-35c8-4ed9-a6a0-11b99bf9de8d" /> <img width="1280" height="720" alt="4-hwi-device-found" src="https://git.fish.foo/attachments/0592cde0-55fb-46be-8b11-17e07f4ce791" /> </details> <details> <summary>External signer settings</summary> <img width="1280" height="720" alt="5-settings-not-responding" src="https://git.fish.foo/attachments/dd4a7040-3125-4ac3-92f8-ed823fca775e" /> <img width="1280" height="720" alt="6-settings-device-locked" src="https://git.fish.foo/attachments/24a77cd6-b15e-4d7a-a264-49cb2f7c0cf5" /> </details>
rreview commented 2026-11-02 23:12:25 +00:00 (Migrated from github.com)

Earlier concerns remain unresolved; see the Run archive linked from the Review report.

🟠 Minor · Late signer checks override a newer wallet-creation route

If the user changes wallet type or goes Back while signer discovery runs, its late completion still pushes a signer page over the new flow; real-device timing and occurrence were not measured.

Location: qml/pages/wallet/WalletCreationFlow.qml:139 (head).

🟠 Minor · Back from signer setup lets device retry save the retained edit

After editing the executable and returning with Back, the naming form describes an unchecked path as a device problem; its “Check again” action saves that retained edit if validation succeeds.

Location: qml/pages/wallet/WalletCreationFlow.qml:334 (head).

🟠 Minor · Failed signer-path saves have no error feedback in HWI setup

If a settings.json write fails during HWI setup, the check returns to “Not checked” without displaying the save error, leaving the user unable to tell why checking did not run.

Location: qml/models/externalsignermodel.cpp:62 (head).

🟠 Minor · ExternalSignerModel::tr() loses two existing Spanish translations

Moving the two discovery errors to ExternalSignerModel::tr() makes them fall back to English with Spanish selected, because bitcoin_qml_es.ts still stores their translations only under WalletQmlController.

Location: qml/models/externalsignermodel.cpp:316 (head).

🟠 Minor · Short link spans can lose LinkText hover and focus regions

LinkText can omit the hand cursor and focus outline for a sub-8-pixel link span between sampling points; no current caller producing such a fragment was found.

Location: qml/controls/LinkText.qml:65 (head).

🔵 Suggestion · The ToastBanner commit message claims an already-present fix

Commit 2dd2c97bec0bd5ca85406eb91fda139e38afc597 adds only regression coverage; its claimed initial-opacity and creation-time dismissal changes already exist at the comparison base.

Location: test/qml/tst_toastbanner.qml:61 at 2dd2c97bec0b (commit) (commit).

Review coverage was incomplete.


Reviewed: 73594a9e17ac · Review report

<!-- ralph-major:bitcoin-core/gui-qml --> Earlier concerns remain unresolved; see the Run archive linked from the Review report. **🟠 Minor · Late signer checks override a newer wallet-creation route** If the user changes wallet type or goes Back while signer discovery runs, its late completion still pushes a signer page over the new flow; real-device timing and occurrence were not measured. Location: [qml/pages/wallet/WalletCreationFlow.qml:139](<https://github.com/bitcoin-core/gui-qml/blob/73594a9e17ac42292d13e48388f6b84c2e78dd6a/qml/pages/wallet/WalletCreationFlow.qml#L139>) (head). **🟠 Minor · Back from signer setup lets device retry save the retained edit** After editing the executable and returning with Back, the naming form describes an unchecked path as a device problem; its “Check again” action saves that retained edit if validation succeeds. Location: [qml/pages/wallet/WalletCreationFlow.qml:334](<https://github.com/bitcoin-core/gui-qml/blob/73594a9e17ac42292d13e48388f6b84c2e78dd6a/qml/pages/wallet/WalletCreationFlow.qml#L334>) (head). **🟠 Minor · Failed signer-path saves have no error feedback in HWI setup** If a `settings.json` write fails during HWI setup, the check returns to “Not checked” without displaying the save error, leaving the user unable to tell why checking did not run. Location: [qml/models/externalsignermodel.cpp:62](<https://github.com/bitcoin-core/gui-qml/blob/73594a9e17ac42292d13e48388f6b84c2e78dd6a/qml/models/externalsignermodel.cpp#L62>) (head). **🟠 Minor · `ExternalSignerModel::tr()` loses two existing Spanish translations** Moving the two discovery errors to `ExternalSignerModel::tr()` makes them fall back to English with Spanish selected, because `bitcoin_qml_es.ts` still stores their translations only under `WalletQmlController`. Location: [qml/models/externalsignermodel.cpp:316](<https://github.com/bitcoin-core/gui-qml/blob/73594a9e17ac42292d13e48388f6b84c2e78dd6a/qml/models/externalsignermodel.cpp#L316>) (head). **🟠 Minor · Short link spans can lose `LinkText` hover and focus regions** `LinkText` can omit the hand cursor and focus outline for a sub-8-pixel link span between sampling points; no current caller producing such a fragment was found. Location: [qml/controls/LinkText.qml:65](<https://github.com/bitcoin-core/gui-qml/blob/73594a9e17ac42292d13e48388f6b84c2e78dd6a/qml/controls/LinkText.qml#L65>) (head). **🔵 Suggestion · The `ToastBanner` commit message claims an already-present fix** Commit `2dd2c97bec0bd5ca85406eb91fda139e38afc597` adds only regression coverage; its claimed initial-opacity and creation-time dismissal changes already exist at the comparison base. Location: [test/qml/tst_toastbanner.qml:61 at 2dd2c97bec0b (commit)](<https://github.com/bitcoin-core/gui-qml/blob/2dd2c97bec0bd5ca85406eb91fda139e38afc597/test/qml/tst_toastbanner.qml#L61>) (commit). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`73594a9e17ac`](<https://github.com/bitcoin-core/gui-qml/commit/73594a9e17ac42292d13e48388f6b84c2e78dd6a>) · [Review report](<https://review.fish.foo/report/gui/1060-73594a9e17ac42292d13e48388f6b84c2e78dd6a-2860-4.html>)
johnny9 (Migrated from github.com) reviewed 2026-11-03 14:19:37 +00:00
johnny9 (Migrated from github.com) left a comment

Follow-up review of the incomplete shared-dialog, signer, resource and runtime coverage found a minor Icon teardown error and an introduced clang-tidy diagnostic in the test-motion startup path. The exact-head Qt 6.10 suite passes all 790 checks on the configured minimal platform. Targeted dialog cancellation, disabled-link keyboard and startup-error loop probes also pass. This is a scoped review; real-device HWI, full application IPC lifecycle, sanitizers and native macOS/Windows remain untested.

Follow-up review of the incomplete shared-dialog, signer, resource and runtime coverage found a minor Icon teardown error and an introduced clang-tidy diagnostic in the test-motion startup path. The exact-head Qt 6.10 suite passes all 790 checks on the configured minimal platform. Targeted dialog cancellation, disabled-link keyboard and startup-error loop probes also pass. This is a scoped review; real-device HWI, full application IPC lifecycle, sanitizers and native macOS/Windows remain untested.
johnny9 (Migrated from github.com) commented 2026-11-03 14:19:37 +00:00

With ENABLE_TEST_AUTOMATION enabled, LLVM 22 clang-tidy rejects this new local with performance-no-automatic-move when it is returned below. Remove const from test_mode so the return can move the QString, then rerun the matching tidy check.

With ENABLE_TEST_AUTOMATION enabled, LLVM 22 clang-tidy rejects this new local with performance-no-automatic-move when it is returned below. Remove const from test_mode so the return can move the QString, then rerun the matching tidy check.
johnny9 (Migrated from github.com) commented 2026-11-03 14:19:37 +00:00

Destroying this icon before the deferred reset runs leaves root null, so this callback emits a QML TypeError. A teardown probe reproduces this on Qt 6.4.2 and 6.10.2, while the previous Icon implementation passes. Guard root before writing _sourceChanging and add a teardown test that fails on the warning.

Destroying this icon before the deferred reset runs leaves root null, so this callback emits a QML TypeError. A teardown probe reproduces this on Qt 6.4.2 and 6.10.2, while the previous Icon implementation passes. Guard root before writing _sourceChanging and add a teardown test that fails on the warning.
ValeraFinebits commented 2026-11-03 15:04:19 +00:00 (Migrated from github.com)

As shown in the three screenshots below, wallet selection and Settings use “External signer”, but the setup wizard uses “HWI executable” and “Check HWI”, while Settings uses “Signer executable” and “Check device”.
Could we align the labels for the shared executable setting and check action?

Screenshots 1 3 2
As shown in the three screenshots below, wallet selection and Settings use “External signer”, but the setup wizard uses “HWI executable” and “Check HWI”, while Settings uses “Signer executable” and “Check device”. Could we align the labels for the shared executable setting and check action? </details><details> <summary>Screenshots</summary> <img width="1582" height="1316" alt="1" src="https://git.fish.foo/attachments/74587fd6-3bc5-4d16-b4f9-b6eecd9b5e14" /> <img width="1584" height="1320" alt="3" src="https://git.fish.foo/attachments/4280c228-afb4-40f5-9cfb-6d16ba1f56dd" /> <img width="1590" height="1320" alt="2" src="https://git.fish.foo/attachments/a9fac2bd-3837-4779-b116-8335a180ffec" /> </details>
ValeraFinebits commented 2026-11-03 15:27:06 +00:00 (Migrated from github.com)

Starting with no signer configured, I select “External signer”, choose an executable and press “Check HWI”. Once “Use this device” appears, I press Back without clicking it.

Selecting “External signer” again now skips setup and opens the wallet-name form. Back from there only returns to wallet-type selection, so I cannot revisit or change the executable within the wizard.

Could we retain a way to return to setup and change the executable?

Starting with no signer configured, I select “External signer”, choose an executable and press “Check HWI”. Once “Use this device” appears, I press Back without clicking it. Selecting “External signer” again now skips setup and opens the wallet-name form. Back from there only returns to wallet-type selection, so I cannot revisit or change the executable within the wizard. Could we retain a way to return to setup and change the executable?
epicleafies commented 2026-11-03 22:05:20 +00:00 (Migrated from github.com)

I'll push fixes and rebase once 1052 merges.

I'll push fixes and rebase once 1052 merges.
epicleafies (Migrated from github.com) reviewed 2026-11-04 23:56:30 +00:00
epicleafies (Migrated from github.com) commented 2026-11-04 23:56:30 +00:00

This was introduced in 1052 so I included it in my most recent review.

This was introduced in 1052 so I included it in my most recent review.
johnny9 (Migrated from github.com) reviewed 2026-11-07 15:18:11 +00:00
johnny9 (Migrated from github.com) left a comment

Three issues remain:

  • After checking a nonworking executable in Settings and fixing it in Add wallet, Check device in retained Settings restores the old path.
  • With -signer, making the path read-only also disables retries in Settings and setup.
  • The new Icon Qt.callLater() callback can run after destruction and emit a TypeError.

Keep QML declarative by moving shared paths, validation, action availability and checking state into a C++ signer model. Both pages should bind to it and forward user actions.

Make these changes:

  • Handle path commits through the existing settings layer; remove imperative field-text resets.
  • Expose canCheck separately from canEdit.
  • Run HWI through the backend executor, with completion and stale-result handling owned by the model. Remove the two new check timers and destruction-time refresh.
  • Publish semantic status for declarative icon/color bindings. Make status changes immediate and remove the deferred Icon reset.
  • Add model tests for retries and lifecycle, plus QML regressions for path synchronization and icon teardown.
Three issues remain: - After checking a nonworking executable in Settings and fixing it in Add wallet, **Check device** in retained Settings restores the old path. - With `-signer`, making the path read-only also disables retries in Settings and setup. - The new Icon `Qt.callLater()` callback can run after destruction and emit a TypeError. Keep QML **declarative** by moving shared paths, validation, action availability and checking state into a C++ signer model. Both pages should bind to it and forward user actions. Make these changes: - Handle path commits through the existing settings layer; remove imperative field-text resets. - Expose `canCheck` separately from `canEdit`. - Run HWI through the backend executor, with completion and stale-result handling owned by the model. Remove the two new check timers and destruction-time refresh. - Publish semantic status for declarative icon/color bindings. Make status changes immediate and remove the deferred Icon reset. - Add model tests for retries and lifecycle, plus QML regressions for path synchronization and icon teardown.
ValeraFinebits (Migrated from github.com) reviewed 2026-11-22 09:40:39 +00:00
ValeraFinebits (Migrated from github.com) left a comment

Thanks for fixing the issues I raised earlier. I noticed one more thing while testing on Windows.

With a signer already configured, clicking "External signer" leaves me on "Choose a wallet type" with no indication that the app is checking the device. This is easiest to see with a device or emulator that takes a few seconds to respond. If I select "Regular" during that pause, the regular wallet form opens. When the device responds, the wizard switches to "External signer wallet" on its own.

Could the wizard open the external signer page right away and show that it's checking the device? If I go back from that page and choose "Regular", I'd expect the regular wallet form to stay open when the check finishes.

Thanks for fixing the issues I raised earlier. I noticed one more thing while testing on Windows. With a signer already configured, clicking "External signer" leaves me on "Choose a wallet type" with no indication that the app is checking the device. This is easiest to see with a device or emulator that takes a few seconds to respond. If I select "Regular" during that pause, the regular wallet form opens. When the device responds, the wizard switches to "External signer wallet" on its own. Could the wizard open the external signer page right away and show that it's checking the device? If I go back from that page and choose "Regular", I'd expect the regular wallet form to stay open when the check finishes.
Sign in to join this conversation.
No description provided.