Skip to content

feat(trezor): add hidden-wallet passphrase selection and on-chain watcher#574

Open
coreyphillips wants to merge 10 commits into
masterfrom
feat/trezor-hidden-wallet-and-watcher
Open

feat(trezor): add hidden-wallet passphrase selection and on-chain watcher#574
coreyphillips wants to merge 10 commits into
masterfrom
feat/trezor-hidden-wallet-and-watcher

Conversation

@coreyphillips

@coreyphillips coreyphillips commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Adds Trezor hidden-wallet passphrase selection and an on-chain event watcher, built on bitkit-core 0.1.66 (bumped from 0.1.64), which provides the WalletSelection / PassphraseResponse types and the on-chain watcher FFI.

Hidden-wallet / passphrase rework

  • Replaces the old blocking passphrase prompt with a proactive wallet-mode model that mirrors bitkit-android.
  • The user picks Standard, passphrase on phone, or passphrase on device up front via a selector + confirmation dialog.
  • The selection is bound to the THP session at connect time (currentSelection()); legacy (non-THP) devices that re-request the passphrase mid-operation are answered from the same stored value, keeping both paths in lockstep.
  • Switching modes resets the device session (disconnect → reconnect), since the Trezor caches the passphrase for the lifetime of a session.
  • Removes the now-dead needsPassphrasePublisher / submitPassphrase / acknowledgeOnDevicePassphrase plumbing.

On-chain event watcher

  • New "Event Watcher" section subscribes an xpub to live Electrum updates with no device connected. Shows balance, block height, account type, transaction count, recent transactions, and a rolling event log.
  • TrezorEventListener bridges the Rust background callback onto @MainActor.
  • The watcher remains available across Trezor connects/disconnects, is stopped explicitly via Stop Watching, and is torn down on network switch.
  • The account-type selector can override ambiguous xpub/tpub lookups for balance, history, transaction detail, and watcher startup.

Fixes

  • PIN pad now supports up to 50 digits (the real Trezor limit), with dots that wrap across rows instead of overflowing a single line.

Changelog

  • Added changelog.d/next/574.added.md.

Dependencies

  • bitkit-core 0.1.66 (Package.resolved + project.pbxproj updated).

@coreyphillips coreyphillips requested a review from ovitrif June 1, 2026 16:43
@coreyphillips coreyphillips self-assigned this Jun 1, 2026
@coreyphillips coreyphillips changed the title feat(trezor): add hidden-wallet passphrase selection and on-chain wat… feat(trezor): add hidden-wallet passphrase selection and on-chain watcher Jun 1, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@ovitrif ovitrif requested a review from jvsena42 June 8, 2026 20:17
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@jvsena42

Copy link
Copy Markdown
Member

Starting review

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could've reused existing UI components like CaptionMText / CaptionText / BodySText / FootnoteText / PrimaryButtonView / SecondaryButtonView / RectangleButton
Not blocking for this PR because the previous Trezor dev screens were also implemented like this, but could be a follow up PR

Comment thread Bitkit/Components/Trezor/TrezorAccountTypeSelector.swift
Comment thread Bitkit/Services/Trezor/TrezorService.swift
Comment thread Bitkit/Views/Trezor/TrezorWatcherView.swift Outdated
jvsena42

This comment was marked as resolved.

@coreyphillips coreyphillips requested a review from jvsena42 June 10, 2026 16:42
@jvsena42 jvsena42 modified the milestone: 2.4.0 Jun 10, 2026
Comment thread Bitkit/Views/Trezor/TrezorRootView.swift
Comment thread Bitkit/Components/Trezor/TrezorAccountTypeSelector.swift
jvsena42

This comment was marked as resolved.

@ovitrif ovitrif added this to the 2.4.0 milestone Jun 10, 2026
@coreyphillips coreyphillips requested a review from jvsena42 June 11, 2026 01:13
@jvsena42

This comment was marked as resolved.

jvsena42

This comment was marked as resolved.

@coreyphillips

Copy link
Copy Markdown
Contributor Author

see #574 (comment)

Addressed in this commit.

@coreyphillips coreyphillips requested a review from jvsena42 June 11, 2026 12:46

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested

  • Test vectors
  • Taproot
    • Set tpub
    • Don't recognized in auto mode (expected)
    • switch to Taproot type
    • Transactions and balance tracked
    • Received taproot transaction
    • Event recognized
    • Mined 1 block
    • Confirmed and unconfirmed balances updated
  • Native Segwit
    • Set pub
    • Auto mode worked
    • switch to Segwit type
    • Transactions and balance tracked
    • Received segwit transaction
    • Event recognized
    • Mined 1 block
    • Confirmed and unconfirmed balances updated

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.

3 participants