Skip to content

Watch only wallet#565

Open
epicleafies wants to merge 8 commits into
bitcoin-core:qt6from
epicleafies:watch-only-wallet
Open

Watch only wallet#565
epicleafies wants to merge 8 commits into
bitcoin-core:qt6from
epicleafies:watch-only-wallet

Conversation

@epicleafies
Copy link
Copy Markdown
Contributor

Added the menu for all wallet options when adding a wallet.
Added the watch only wallet creation flow. Currently password protection isn't supported, may want to consider for the future.
Added unit, qml and functional tests for new features.
Fixed bug where the gui would crash when leaving the on-boarding sequence.
Fixed bug where long wallet names would break the wallet name text boxes.
One TODO added. The wallet creation process should be moved to its own worker thread to avoid UI freezes. Out of scope for this PR.
#560

image image image image

Prevent startNodeInitializionThread() from emitting
requestedInitialize() more than once. Without this guard, re-entering
the wallet creation wizard (which eagerly starts the node in
Component.onCompleted) would trigger a second initialization attempt.
Replace anchors.centerIn with explicit left/right/verticalCenter
anchoring on the badge's RowLayouts, removing the implicit width
constraint from contentItem. Add text elision so long wallet names
are truncated rather than overflowing.
Replace the direct "Create wallet" → CreateIntro routing with a new
wallet type selector page that offers Regular, Watch-only, Import,
Multi-key (disabled), and Custom (disabled) options.

Add the full watch-only wallet creation flow: an intro page explaining
watch-only capabilities, an xpub entry page with real-time validation,
then the existing name page (which skips the password step for
watch-only wallets and creates the wallet directly).

The backend creates a blank descriptor wallet with private keys
disabled, then imports wpkh receive and change descriptors derived
from the user-provided xpub.

Also fix createSingleSigWallet to use setWalletLoaded/setWalletLoadError
for consistent state management across both creation paths, and remove
the unused m_error_message member.
Add end-to-end GUI tests covering:
- Full watch-only wallet creation flow (type selector → intro → xpub
  entry → name → wallet created with private_keys_enabled=false)
- Type selector routing to regular wallet flow (CreateIntro)
- Type selector routing to import wallet flow
- Disabled state of Multi-key and Custom options

Uses a source bitcoind node to generate a real xpub for the test,
then drives the QML GUI through the creation wizard and verifies
the result via RPC.
Cover the node initialization guard (startNodeInitializionThread emits
requestedInitialize exactly once) and xpub validation logic (valid key,
garbage, empty, whitespace trimming, invalid-xpub error path).
Add a MockWalletController context property and Clipboard singleton
stub so QML tests can instantiate wallet wizard pages without the
real C++ backend.
Add test cases for WalletTypeListItem, CreateTypeSelector,
WatchOnlyXpub, CreateName, and CreatePassword covering signal
routing, disabled states, input validation, and loading behavior.
Parameterize CreateConfirm with headerText and descriptionText
properties so both single-sig and watch-only flows can reuse
the same component with different messaging. Route the watch-only
flow through a new watchOnlyConfirm page instead of finishing
immediately after wallet creation.
@epicleafies epicleafies force-pushed the watch-only-wallet branch from 8c01c0a to cf438f3 Compare May 4, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant