Watch-only Wallet Support #560

Closed
opened 2026-04-29 12:14:52 +00:00 by johnny9 · 2 comments
johnny9 commented 2026-04-29 12:14:52 +00:00 (Migrated from github.com)

Summary

Add watch-only wallet parity so QML can create/import wallets with private keys disabled, surface them clearly as watch-only, and gate receive/send/signing actions according to wallet capabilities.

Complexity

  • L

Dependencies

  • 10
  • 14
  • 18
  • 02

Global Constraints

  • All implementation lives under gui-qml/.
  • No GUI runtime dependency on bitcoin/src/qt components. Reused logic must be moved/ported into gui-qml/.
  • Do not change interfaces::Wallet or interfaces::Node in this version.
  • Issue completion must satisfy DefinitionOfDone.md.

Scope

  • Add a watch-only wallet option to the add/create wallet flow.
  • Create descriptor watch-only wallets with private keys disabled and no passphrase-only steps that do not apply.
  • Expose wallet capability metadata from the backend/model layer, including private-key-disabled state and address-generation availability.
  • Import/load existing watch-only wallets and show a consistent wallet type in the selector, wallet badge, and wallet settings.
  • Add or route descriptor/address import UX for watch-only material; if the current interfaces are insufficient, record the exact gap in the interface proposals log.
  • Gate receive, send, sign-message, backup, and passphrase actions based on watch-only capabilities.
  • Route transaction creation toward PSBT/export flow when direct signing or broadcast is not available.
  • Keep balances, activity, and coin selection correct for watch-only and solvable-only outputs.

Acceptance Criteria (DoD-Aligned)

  1. User can create a watch-only wallet from the add wallet flow, restart the app, and see it reload as watch-only.
  2. User can import/load an existing watch-only wallet and the wallet selector/settings clearly identify it as watch-only.
  3. Actions requiring private keys are disabled or rerouted with explicit explanations; no signing/broadcast path silently fails.
  4. Receive behavior is correct for watch-only wallets: unavailable when no receive descriptors exist, available when imported descriptors support address generation.
  5. Balances, activity rows, and coin selection distinguish watch-only funds from directly spendable funds.
  6. Missing descriptor import support or other interface gaps are captured as concrete follow-up entries instead of being hidden in UI code.

Required Tests

  • C++ unit tests: Unit tests for wallet creation flags, wallet capability metadata, and watch-only balance/action classification.
  • QML QTest: QTests for watch-only create/import flows, wallet type display, and gated receive/send/signing states.
  • Python E2E (qml/test/testbridge.h): E2E flow: create watch-only wallet -> import watch-only material or load prepared watch-only wallet -> fund watched address -> verify balance/activity -> attempt send and verify PSBT/unavailable path -> restart and verify persisted state.

Implementation Notes

  • Likely touches qml/walletqmlcontroller.*, qml/models/walletqmlmodel.*, qml/pages/wallet/CreateWalletWizard.qml, wallet import success/settings surfaces, WalletBadge.qml, and send/receive pages.
  • WalletQmlController::createSingleSigWallet currently creates descriptor wallets without disabled-private-key flags; add a dedicated watch-only creation method or wallet-type parameter using WALLET_FLAG_DISABLE_PRIVATE_KEYS | WALLET_FLAG_BLANK_WALLET | WALLET_FLAG_DESCRIPTORS.
  • Imported wallet key-scheme detection already identifies WALLET_FLAG_DISABLE_PRIVATE_KEYS as Watch-only; extend that metadata so all wallet surfaces can use it consistently.
## Summary Add watch-only wallet parity so QML can create/import wallets with private keys disabled, surface them clearly as watch-only, and gate receive/send/signing actions according to wallet capabilities. ## Complexity - `L` ## Dependencies - `10` - `14` - `18` - `02` ## Global Constraints - All implementation lives under `gui-qml/`. - No GUI runtime dependency on `bitcoin/src/qt` components. Reused logic must be moved/ported into `gui-qml/`. - Do not change `interfaces::Wallet` or `interfaces::Node` in this version. - Issue completion must satisfy `DefinitionOfDone.md`. ## Scope - Add a watch-only wallet option to the add/create wallet flow. - Create descriptor watch-only wallets with private keys disabled and no passphrase-only steps that do not apply. - Expose wallet capability metadata from the backend/model layer, including private-key-disabled state and address-generation availability. - Import/load existing watch-only wallets and show a consistent wallet type in the selector, wallet badge, and wallet settings. - Add or route descriptor/address import UX for watch-only material; if the current interfaces are insufficient, record the exact gap in the interface proposals log. - Gate receive, send, sign-message, backup, and passphrase actions based on watch-only capabilities. - Route transaction creation toward PSBT/export flow when direct signing or broadcast is not available. - Keep balances, activity, and coin selection correct for watch-only and solvable-only outputs. ## Acceptance Criteria (DoD-Aligned) 1. User can create a watch-only wallet from the add wallet flow, restart the app, and see it reload as watch-only. 2. User can import/load an existing watch-only wallet and the wallet selector/settings clearly identify it as watch-only. 3. Actions requiring private keys are disabled or rerouted with explicit explanations; no signing/broadcast path silently fails. 4. Receive behavior is correct for watch-only wallets: unavailable when no receive descriptors exist, available when imported descriptors support address generation. 5. Balances, activity rows, and coin selection distinguish watch-only funds from directly spendable funds. 6. Missing descriptor import support or other interface gaps are captured as concrete follow-up entries instead of being hidden in UI code. ## Required Tests - C++ unit tests: Unit tests for wallet creation flags, wallet capability metadata, and watch-only balance/action classification. - QML QTest: QTests for watch-only create/import flows, wallet type display, and gated receive/send/signing states. - Python E2E (`qml/test/testbridge.h`): E2E flow: create watch-only wallet -> import watch-only material or load prepared watch-only wallet -> fund watched address -> verify balance/activity -> attempt send and verify PSBT/unavailable path -> restart and verify persisted state. ## Implementation Notes - Likely touches `qml/walletqmlcontroller.*`, `qml/models/walletqmlmodel.*`, `qml/pages/wallet/CreateWalletWizard.qml`, wallet import success/settings surfaces, `WalletBadge.qml`, and send/receive pages. - `WalletQmlController::createSingleSigWallet` currently creates descriptor wallets without disabled-private-key flags; add a dedicated watch-only creation method or wallet-type parameter using `WALLET_FLAG_DISABLE_PRIVATE_KEYS | WALLET_FLAG_BLANK_WALLET | WALLET_FLAG_DESCRIPTORS`. - Imported wallet key-scheme detection already identifies `WALLET_FLAG_DISABLE_PRIVATE_KEYS` as `Watch-only`; extend that metadata so all wallet surfaces can use it consistently.
johnny9 commented 2026-04-29 12:18:52 +00:00 (Migrated from github.com)

https://www.figma.com/design/fmpjcEftcnyXudd4cbce20/Bitcoin-Core-App-Design?node-id=7705-668680&t=mIAxBGD0rxcqIN8O-4

Image

I would start with these frames, our list should include single sig, watch-only, external signer (if configured), and import.

Then in the send flow, on the review page, the send button can just export to psbt and the label should reflect that

https://www.figma.com/design/fmpjcEftcnyXudd4cbce20/Bitcoin-Core-App-Design?node-id=7705-668680&t=mIAxBGD0rxcqIN8O-4 <img width="1600" height="1400" alt="Image" src="https://git.fish.foo/attachments/c6f52512-2877-4b67-8a48-17d65b02ffaf" /> I would start with these frames, our list should include single sig, watch-only, external signer (if configured), and import. Then in the send flow, on the review page, the send button can just export to psbt and the label should reflect that
johnny9 commented 2026-04-29 14:05:03 +00:00 (Migrated from github.com)

@epicleafies

@epicleafies
Sign in to join this conversation.
No description provided.