Skip to content

feat: add trezor receive - #693

Open
ben-kaufman wants to merge 2 commits into
feat/trezor-sendfrom
feat/trezor-receive
Open

feat: add trezor receive#693
ben-kaufman wants to merge 2 commits into
feat/trezor-sendfrom
feat/trezor-receive

Conversation

@ben-kaufman

@ben-kaufman ben-kaufman commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • open the existing Receive sheet on a Trezor tab from the paired hardware-wallet screen
  • render the watcher-provided next-unused address immediately, with an account-scan fallback
  • support safe amount/message editing on the hardware address and exact on-device verification
  • match the receive design with a white selected underline, blue hardware QR/action accents, and verification inside Show Details

Stack

Validation

  • iPhone 16 simulator build passes against Core 0.5.10
  • focused watcher receive-address test passes
  • SwiftFormat passes

@ben-kaufman
ben-kaufman requested a review from ovitrif August 27, 2026 15:27
@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

Adds Trezor receiving to the existing receive sheet, using watcher-provided addresses with an account-scan fallback and optional on-device verification.

  • Opens receive directly on the Trezor tab from a hardware-wallet screen.
  • Supports amount and message parameters for hardware-wallet BIP21 requests.
  • Adds reconnect, pairing-code, and passphrase handling for device verification.
  • Updates Bitkit Core to 0.5.10 and extends watcher-event handling for next-unused addresses.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defects identified.

The receive flow preserves explicit hardware-wallet identity from its primary entry point, obtains a next-unused address through watcher or account-scan state, and rejects device verification unless the returned address exactly matches the displayed destination.

Important Files Changed

Filename Overview
Bitkit/Managers/HwWalletManager.swift Stores watcher-provided next-unused addresses, adds account-scan fallback, and verifies the displayed derivation directly on the Trezor.
Bitkit/Views/Wallets/Receive/ReceiveQr.swift Adds the Trezor receive tab, hardware BIP21 rendering, address loading, and reconnect/passphrase-aware verification.
Bitkit/Views/Wallets/Receive/ReceiveEdit.swift Adds an on-chain-only editing mode that preserves amount and message state without invoking Lightning or Paykit flows.
Bitkit/Views/Wallets/Receive/ReceiveSheet.swift Carries hardware-wallet identity through receive navigation and presents pairing requests during reconnect.
Bitkit/Components/TabBar/TabBar.swift Opens the receive sheet on the Trezor tab when invoked from a hardware-wallet route.
Bitkit.xcodeproj/project.xcodeproj Updates Bitkit Core to the version providing the watcher receive-address payload.

Sequence Diagram

sequenceDiagram
    participant User
    participant Receive as Receive Sheet
    participant Manager as Hardware Wallet Manager
    participant Watcher as Watch-only Watcher
    participant Electrum
    participant Trezor
    User->>Receive: Open Trezor receive tab
    Receive->>Manager: Request receive address
    Manager->>Watcher: Read cached next-unused address
    alt Watcher address available
        Watcher-->>Manager: Address and derivation path
    else Watcher address unavailable
        Manager->>Electrum: Scan account addresses
        Electrum-->>Manager: First unused external address
    end
    Manager-->>Receive: Address and derivation path
    Receive-->>User: Display QR and details
    opt Verify on device
        User->>Receive: Verify address
        Receive->>Manager: Verify displayed address
        Manager->>Trezor: Derive and display exact path
        Trezor-->>Manager: Device-derived address
        Manager-->>Receive: Accept only exact match
    end
Loading

Reviews (1): Last reviewed commit: "feat: add trezor receive" | Re-trigger Greptile

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