Skip to content

fix: keep signed hardware sends on retry - #1770

Open
Jasonvdb wants to merge 33 commits into
masterfrom
fix/hw-send-keep-signed-tx
Open

Jasonvdb wants to merge 33 commits into
masterfrom
fix/hw-send-keep-signed-tx

Conversation

@Jasonvdb

@Jasonvdb Jasonvdb commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1783

Important

I don't have a hardware wallet, so this has not been tested on a physical Trezor or Jade. It was tested end to end with the Trezor Bridge emulator on local regtest, on an API 36 Android emulator. USB, BLE, THP pairing and Jade have no live coverage.

Twin: synonymdev/bitkit-ios#1208

This PR stops an ordinary hardware wallet send from asking for a second signature after a broadcast whose outcome is unknown. Today the signed transaction can be discarded in that case, so if the first broadcast was actually accepted, sending again pays the recipient twice.

Description

  • Rebroadcasting the same signed transaction is safe because it has the same txid. A new signature can create a second, separate payment. So ordinary sends now keep the signed transaction, written to the Keychain before the broadcast, so it survives leaving the sheet and restarting the app. HwRetainedSendRepo holds one Keychain entry per hardware wallet, cleared by the wallet wipe and excluded from backups.

  • After a broadcast attempt the outcome decides what happens:

    Outcome First attempt Retry
    Success, including already known Release Release
    Wallet watcher has already seen the transaction, any failure Success, release Success, release
    Recognised refusal, not yet seen Release, next attempt signs anew Keep and mark refused
    Failed to connect to Electrum:, raised before anything is sent Release, Retry still available on the sign screen Keep
    Timeout, unrecognised Broadcast failed: ..., anything else Keep Keep

    A refusal on a retry is kept because bad-txns-inputs-missingorspent may describe our own earlier accepted transaction.

  • When the wallet watcher sees the transaction, the record is marked as observed and kept. An earlier version of this branch deleted it at that point, and live testing showed a real double payment: the button still read Retry, and tapping it signed a second transaction. Observation is now handled like this:

    • Retry in the open sheet rebroadcasts the same bytes and ends in success.
    • Reopening the same payment shows the warning first.
    • A different address or amount proceeds normally with no warning.
  • Retrying an unobserved send with the same wallet, address and amount rebroadcasts the original bytes with no device prompt. Fee and tags are not part of the match, and the review screen shows the original fee and locks it. Amount checks accept the kept amount, so a near-max payment can still reach Retry after fees rise.

  • A different address or amount over an unobserved record, a refused retry, or an unreadable record shows a warning before any device contact, with Cancel and Yes, Send. Yes, Send gives consent for that one payment and continues to normal signing, so a wallet can never be stuck and a genuine repeat payment still works. Consent lasts until the new payment is signed and saved, so a device rejection or timeout keeps it and the next tap asks the device again. It's also given back if the new payment is refused on its first attempt. Leaving the sign flow ends it, and the warning comes back. This is the only new UI behaviour.

  • The old record is never dropped before its replacement is signed. A consented or different payment replaces it in one write once signed, so backing out, a device rejection or a signing failure leaves the original protected. If the new payment is refused or can't connect on its first attempt, the original is put back. A signature identical to an attempted record counts as a retry.

  • Records are released on success and on wallet removal, which also clears a corrupt entry.

  • Leaving is not locked after a failed ordinary send, so nobody gets trapped on the sign screen while offline.

  • Adds hardware__send_broadcast_uncertain_title and hardware__send_broadcast_uncertain_text in every locale, because "Check your connection and try again." is misleading before a possible second payment. The translations have not been reviewed by a native speaker.

Out of Scope

  • Connect-failure check: it matches core's error text. A typed core error would be sturdier and needs a bitkit-core change.
  • Shop payments: unchanged, they keep their existing durable path.
  • HwSendViewModel.kt: the 120 s broadcast timeout does not fire against a silent open socket. The native call cannot be cancelled, so the sheet stayed blocked for over 8 minutes in testing, and only force stop got out. This is on master too and needs a socket timeout in bitkit-core. The transaction is still kept once the app restarts.
  • Locked fee row: the pencil icon still shows, as it does for retained Shop payments.
  • First-attempt refusal toast: shows the raw errorDetails=... text, as it does today.

Known limits of this change:

  • Electrum error text is unauthenticated. A faulty or hostile server can accept the transaction and return a recognised refusal on the first attempt, before the watcher sees it, which releases the record. Signing again still needs approval on the device.
  • Yes, Send allows a second signature after an explicit warning. Once the replacement is signed and sent, the original payment's record is gone.
  • Removing a wallet deletes its record.
  • A restore on a new device has no record, because records are excluded from backups.
  • Android's Keychain cannot distinguish a read failure from a permanently undecryptable entry, so a consented send overwrites that wallet's entry once signed in both cases. On iOS a plain read failure stays blocked. This differs on purpose, so that an undecryptable entry cannot block a wallet forever.

Design

N/A — no design available. Existing alert and toast components are reused.

Preview

N/A — the visible changes are the reused warning, the Retry label in a reopened sheet and the locked fee.

QA Notes

Setup

Regtest only: the synonymdev/bitkit-docker stack with the Trezor emulator on a test seed holding several UTXOs, per journeys/hardware-wallet/README.md, plus a local Electrum JSON-RPC proxy set as the custom Electrum server that injects faults on blockchain.transaction.broadcast. No proxy exists in this repo. The full recipe is broadcast-unknown-retry.md.

Journeys

N/A — not drivable; see Manual Tests. Broadcast faults are not in the journeys Capabilities table.

Manual Tests

  • 1. Follow broadcast-unknown-retry.md on the Bridge emulator — Electrum fault injection not in Capabilities
  • 2. On a physical Trezor and Jade, an ordinary send still succeeds end to end — physical hardware wallet not available to the author

Automated Checks

  • added HwRetainedSendRepoTest.kt — record round trip, per-wallet isolation, no overwrite with different bytes, observed marking, corrupt entry behaviour
  • updated HwSendViewModelTest.kt — one signature with identical bytes across unknown errors, timeout then leave, a recreated view model and a changed fee; the outcome table; observed outcomes; warning with zero device contact; Shop unchanged
  • updated HwWalletRepoTest.kt — watcher marks and does not delete, retry after a failed mark, removal releases
  • updated AppViewModelSendFlowTest.kt — warning first, consent used once and tied to one payment, fee lock and release, near-max gate, record-not-read gate
  • updated BroadcastExceptionExtTest.kt — connect-failure classification
  • updated PaykitPaymentProofRepoTest.kt — constructor argument only

Evidence

At 9082894: full unit suite 5000 passed, 0 failed, 0 skipped; compileDevDebugKotlin and detekt passed. At 0b5e550: just lint and ./gradlew assembleDevDebug passed.

Live on local regtest at 0b5e550 on an API 36 emulator with the Trezor Bridge emulator and a fault proxy, run by a verifier who did not write the fix. A normal signing shows 4 device prompts:

  • Broadcast reaches the network then errors, record confirmed still present after the watcher saw it, Retry 29 to 43 s later: 0 prompts, identical bytes, one transaction, recipient paid once. Three runs, one with the error still injected on the Retry.
  • Reopen the same payment after that: warning before any prompt, Cancel stays. Yes, Send signs anew as the consented repeat.
  • Different amount or address after that: no warning, 4 prompts, new transaction.
  • Force stop with a delivered transaction, unmined and mined: warning before any prompt on relaunch.
  • Swallowed broadcast, leave, reopen: Retry with the fee locked, identical bytes, 0 prompts.
  • Different amount over an unobserved record: warning; Cancel stays; Yes, Send signs anew.
  • First-attempt min relay fee not met: released, next attempt signs anew with no warning. Retry bad-txns-inputs-missingorspent: 0 prompts, kept, reopen warns.
  • Connection refused: real string Failed to connect to Electrum: Connection refused (os error 111), connectivity toast, no record, Retry on the sign screen with 0 prompts.
  • Every recipient checked with getreceivedbyaddress: none was paid more than once without an explicit Yes, Send.

The first live run, before the observed fix, did produce a real double payment; that is what led to it.

Gaps

  • The author's live regtest run above predates the review fixes on this PR. jvsena42 re-ran the recipe with the Trezor emulator and a fault proxy on staging: checks 1 to 8 passed at a459606, and the hidden wallet cases plus checks 1, 3 and 4 passed at 36f7145. See their review on this PR for the details and one check 5 anomaly that didn't repeat.
  • 9082894 fixes a failed Keychain read that lost consent after a restore. jvsena42 re-ran checks C3, P1 and P4 at that commit and they passed. The read failure itself can't be driven on a device, so only unit tests cover it.
  • After a master merge, ovi-reviewer found two gaps where new master code skipped this fix. 663bb55 adds the same warning, Cancel and Yes, Send to the hardware transfer to Spending screen. 3f7f211 lets automatic funding from Home reach Retry at the original fee for a near-max kept send. jvsena42 ran both on the emulator at app code 037d639 and both passed, including new manual check 9. d58aa37 ports a fix from the iOS twin's review: after a restart and a fee rise, the transfer amount screen accepts a kept near-max transfer above today's maximum, quotes it at its original fee, skips today's claim-fee check for that Retry only, and the sign button reads Retry. Unit tests only, with no emulator run yet.
  • No physical hardware wallet. USB, BLE, THP pairing and Jade have no live coverage; Jade is unit tests with mocks only.
  • The near-max retry was not run live on Android. It was run live on the iOS twin, and has unit tests here.
  • The silent-socket hang was only measured before the observed fix, and leaves the sheet blocked; see Out of Scope.
  • The live run used a proxy that injects faults, so real-world error strings can differ.
  • The record's observed flag is encrypted, so it was inferred from Keychain log timing and behaviour.
  • The real Android Keystore cannot run in JVM tests, so the wipe is confirmed by reading the source and a mocked Keychain.
  • The new strings have not been reviewed by a native speaker.

@Jasonvdb

Jasonvdb commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T16:49:55.028429Z 8a915ab Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d60b85f86e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from e069934 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@Jasonvdb

Jasonvdb commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 8a915abda8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Jasonvdb
Jasonvdb marked this pull request as ready for review November 5, 2026 07:34
@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Critical impact] The changes reach ordinary hardware-wallet payments, where a retry can send money.

The PR appears safe to merge, with a non-blocking fee-lock issue when editing a retained payment.

Findings

  1. P2 Edited payment keeps old fee ▶

Summary

Keeps signed ordinary hardware-wallet sends in encrypted storage before broadcast, so uncertain retries reuse the same transaction.

  • Hardware-wallet retries reuse the signed transaction when a send result is unclear.
  • The send review warns before a different payment replaces an unresolved hardware send.

Acknowledged limits from Jasonvdb:

  • First-attempt recognized refusals release the record, including the stated hostile-server case.
  • The pre-existing silent-socket hang needs a bitkit-core fix.
  • The locked fee pencil, raw first-refusal text, physical-hardware coverage, and unreviewed translations are explicitly out of scope or disclosed gaps.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Ordinary hardware send] --> B{Matching saved send?}
    B -->|Yes| C[Reuse signed bytes]
    B -->|No record| D[Sign on device]
    D --> E[Save signed bytes]
    E --> F[Broadcast]
    C --> F
    F -->|Success or observed failure| G[Release record and complete]
    F -->|Unknown outcome| H[Keep record for retry]
    F -->|First recognized refusal| I[Release record]
    F -->|Retry refusal| J[Keep record and mark refused]
    H --> C
Loading

Reviews (1) · Last reviewed commit: "fix: complete hardware send when its rec..." · Reviewed by Greptile

@ovitrif

ovitrif commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Placed in 3.2.0: a non-blocking fix found after the 3.1 cut. I filed #1783 to track it under the milestone and added Closes #1783 to this PR. The twin synonymdev/bitkit-ios#1208 closes synonymdev/bitkit-ios#1218.

Note: #1772 (draft, @ben-kaufman) also keeps a signed hardware send whose broadcast may have gone out, so the two overlap and should be reconciled before both merge.

@Jasonvdb

Jasonvdb commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. I'm talking to Ben about the overlap, and I'll keep this one moving in the meantime.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No findings. Keeps the signed bytes of an ordinary hardware send in a per-wallet Keychain record, written before the broadcast. A send whose outcome is unknown is then rebroadcast with the same txid instead of being signed again, and a different payment over an unresolved record needs explicit consent. Reviewed 69dea196, oversized tier (2,675 added lines, about 1,960 of them tests): all production hunks read with their surrounding code, the test files not read. Not built here (an auto review does not run a Bitkit Android branch's Gradle build on this box), so CI is the gate.

What I checked, and 6 candidates I ruled out

Read: the diffs of HwRetainedSendRepo.kt, HwSendViewModel.kt (restoreRetainedSend, broadcast, settleFailure, settleRetryRefusal, completeSend, handleFailure, retainedSendStatus, offersRetry, abandonRetainedPayment), HwWalletRepo.kt (watcher marking, removal), Keychain.kt, BroadcastExceptionExt.kt, AppViewModel.kt, SendSheet.kt, SendConfirmScreen.kt, SendAmountScreen.kt, HwSendSignScreen.kt.
Traced: HwWalletRepo.broadcastFunding through TrezorService.broadcastRawTx to bitkit-core broadcast_raw_tx on master. Also Keychain.wipe, the backup rules, and every NavigateToHardwareSign emitter.
CI: build-and-test, lint, detekt and build-local pass. compose-ui and most e2e-tests-local shards were still pending when I read them.

Ruled out

  • Releasing the record on a first-attempt connect failure: bitkit-core raises Failed to connect to Electrum: only from Client::new, before transaction_broadcast_raw runs. Every error from the broadcast call itself comes back as Broadcast failed:, and onchainBroadcastRawTx is the only call under broadcastFunding.
  • Record surviving a wipe or leaving the device: Keychain.wipe clears the whole store and resets the key. The manifest sets allowBackup="false", and both backup rule files exclude everything.
  • Watcher mark racing a release on success: both run under the repo's Mutex. markObserved on a released record loads null and returns.
  • Consent while an operation is in flight: abandonRetainedPayment returns success without deleting, and restoreRetainedSend then takes the unobserved, different-payment branch and stops with the in-progress toast before any device contact.
  • Swiping before the record is read: isHardwareReviewReady needs a retainedSendCheck for the current wallet, address and amount, and it gates the swipe button, onSwipeToPay and onConfirmPay. The only emitter of NavigateToHardwareSign is onConfirmPay.
  • Near-max amount above today's maximum: validation accepts it only when it equals the retained amount of an unrefused, unobserved record for the same address, and prepareHardwareSendFee then locks the record's fee instead of composing at today's rate.

Merge confidence: 3/5, the oversized-tier ceiling: about 1,960 lines of tests were not read, and the Compose and e2e lanes had not finished on this head.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the runtime does not report a reasoning setting for this session)

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two independent reviews.

worth doing, does not block

  • Ordinary fee lock stays on after backing out to Amount, disabling Pay from (app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt:8116-8137)
  • Editing a retained retry leaves its source and fee locked (app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt:4608-4613)

nits

  • Keychain load diagnostics check the wrong key for scoped entries (app/src/main/java/to/bitkit/data/keychain/Keychain.kt:222-223). When a scoped entry fails to load, the diagnostic log always reports that the entry is missing. loadScopedString reuses loadIndexed. On failure that calls emitLoadDiagnosticsOnce(key, t), which checks snapshot.contains(key.indexed), that is HW_RETAINED_SEND_<walletIndex>. The record is stored at HW_RETAINED_SEND_<walletId>, so the log says entryPresent='false' in exactly the case it is meant to explain. Passing the actual preference key into the diagnostics would fix it.
  • Warning copy says "may have been broadcast" when the app has seen the transaction (app/src/main/java/to/bitkit/ui/screens/wallets/send/HwSendViewModel.kt:462)

the reviewers disagree, your call

  • Yes, Send for another payment drops the original guard before anything is signed (app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt:301-317)

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⛔️ Request changes — confirmed duplicate payment after canceling an unsigned replacement.

Findings:

  • HIGH — Keep the original guard until the replacement is signed (app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt:303). Accepting the warning for payment B deletes retained payment A before any device contact. Backing out of B then allows A to be signed again without warning. I reproduced the existing report on regtest: A was 12,000 sats; I accepted a 13,000-sat replacement, canceled before signing it, and returned to A. Two distinct transactions then each paid 12,000 sats. Keep A until the consented replacement is signed and durably retained.

QA for 69dea19:

API 36 ARM64 Android emulator, Trezor Bridge emulator and local regtest, with broadcast faults injected through an Electrum proxy. Built this head with E2E=true ./gradlew assembleDevDebug; the targeted testDevDebugUnitTest suites passed.

Retry a delivered transaction without signing twice ✅ Retry succeeded with identical signed bytes and no second device approval.

1a2x.2x.mp4

Forward-then-error followed by Retry. Identical raw transactions were checked in the proxy log; Bitcoin Core confirmed one payment.

Reopen an undelivered payment with its original fee ✅ Reopening kept the 141-sat fee locked and retried without another signature.
Initial uncertain send Reopen and retry
1b2x.2x.mp4
1b-reopen2x.2x.mp4

The proxy swallowed the first broadcast. Both attempts carried identical bytes; tapping the locked fee did not open an editor.

Warn before replacing an uncertain payment ✅ Changed amounts and addresses warned; Cancel stayed on review and Yes, Send allowed fresh signing.
Different amount Different address
1c2x.2x.mp4
1c-address2x.2x.mp4

No Trezor approval occurred before consent. The separate back-out case below exposes the loss of the original guard.

Keep the transaction after restarting the app ✅ Unobserved retries survived restart; an observed payment warned when repeated after restart.

1d-observed2x.2x.mp4

The observed transaction remained guarded after force stop and relaunch; Cancel stayed on review. The unobserved restart is recorded in the near-max case. A different payment proceeded without warning in the first leg of the refusal case.

Recover a stalled broadcast when its socket closes ✅ Closing the stalled socket allowed Retry with the original transaction.
Start the stalled broadcast Recover after the wait
1e-start2x.2x.mp4
1e-recover2x.2x.mp4

The sheet still blocked Back beyond 120 seconds, as documented in the Android recipe. After closing the socket, Retry succeeded without device approval; the proxy log confirmed identical bytes. This does not verify a working 120-second timeout.

Retry after a refused Electrum connection ✅ A real connection refusal allowed leaving; reopening signed anew, while same-screen Retry reused the signature.
Leave after refusal Reopen, refuse and retry
1f-native-leave2x.2x.mp4
1f-native-retry2x.2x.mp4

The app log reported Failed to connect to Electrum: Connection refused (os error 111). The record was released. Reopening the same payment required device approval; after the second refusal, restoring connectivity and tapping Retry needed no additional approval.

Release a rejected first attempt ✅ A first-attempt minimum-relay-fee refusal released the record and the next attempt requested a fresh signature.

1g2x.2x.mp4

The controller recorded a new set of device approvals on the second attempt. The recipient was paid once.

Keep a refused retry until the user decides ✅ A missing-inputs refusal on Retry kept the transaction and reopening showed the warning.

1h2x.2x.mp4

The retry used identical bytes and required no device approval. Cancel kept the review open. Bitcoin Core confirmed that the swallowed transaction had not paid the recipient.

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware was available.

Only emulators were attached, and the fixture provides no Jade emulator. USB, BLE, THP pairing and physical-device signing remain unverified.

Retry a near-max payment after fees rise ✅ After restart and a 1→50 sat/vB default-fee increase, the retained amount reached Retry with its original fee.
Original near-max send Restart, raise fee and retry
3-original2x.2x.mp4
3-reopen2x.2x.mp4

The retained amount was 10,753,291 sats, above the new 10,724,577-sat available amount. Review kept the original 586-sat fee locked. The proxy log confirmed identical bytes and no new signing approvals were needed.

Cancel a replacement without losing the original payment guard ❌ Canceling an unsigned replacement allowed a second 12,000-sat payment without a repeat-payment warning.
Accept the replacement warning Back out and return to the original Complete the second payment
1c2x.2x.mp4
42x.2x.mp4
4-duplicate2x.2x.mp4

To model delayed delivery, the proxy first withheld A, then I submitted A's signed bytes to the regtest node after canceling B. The original was dc4c37feb64e93b6565bb49f1e1921c131c930a968b7976b740cdc5470c15a85; the new payment was 4c04465c4060c98fe8980490b8c7d0368014d8fa3ff5b1a577f58430db054707. Bitcoin Core decoded both recipient outputs as 12,000 sats, and getreceivedbyaddress increased by another 12,000 sats after the second payment. Device approval was required again, but no warning that A could already have paid was shown.

Full review: 21f0b40..69dea19, including retained storage, watcher observation, cancellation, amount/fee gates and consent. Unreadable-record, wipe and Shop branches were checked through source and unit tests; new translations have no native-speaker verification from this run.

Twin: synonymdev/bitkit-ios#1208 matches the retention design and also abandons before entering signing in SendConfirmationView.swift (source check only; no iOS device run).


Reviewed by gpt-6.1-sol-high

@Jasonvdb

Jasonvdb commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Also fixed the Keychain diagnostics nit from the review in f4d69bd: scoped entries now check the actual key, so entryPresent is correct.

@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.

Code scan at f4d69bd5: no HIGH or MEDIUM, 1 LOW inline. Reviewed as a funds change.

f4d69bd5 fixes the double payment in @coreyphillips's thread on SendSheet.kt (traced below; I'm leaving that thread for its reviewer to resolve). It also fixes two things I had found at 69dea19 and not posted: an observed record for another payment was released before signing, so a failed new send dropped the warning for the original; and wallet removal used release, so a corrupt record survived. Checks 3-4 of broadcast-unknown-retry.md now match iOS word for word. Checks 5-6 differ only where the platform forces it.

Checked and clean:

  • Yes, Send writes nothing: consentToNewSignature sets in-memory consent and prepareRetainedSend returns Consented without touching the record. Record A is replaced in one save only at retainBeforeDispatch, after signing. A failed write throws before dispatch and leaves A in place.
  • Every exit before broadcast keeps A guarding A:
    • Back, system back and sheet dismiss all call cancel(), which clears consent, before popBackStack().
    • A device refusal, sign timeout or connect failure happens before pending exists.
    • Dismissing the passphrase clears consent.
    • Cancellation during the write runs under NonCancellable, and undoRetainBeforeDispatch restores A.
    • When B was dispatched but refused, not submitted, or past its deadline, restore puts A back only while the stored bytes are still B and unobserved.
  • backing out after consenting to a replacement keeps the original with one signature overall covers the regtest sequence from the HIGH thread.
  • A consented re-sign that produces identical bytes returns AlreadyHeld and settles as a Retry.
  • An observed record is overwritten only inside retain, which re-checks observed at write time.
  • settleFailure now completes as Success only when the observed record's bytes equal the settled bytes.
  • isBroadcastUnresolved: every exit from broadcast() ends in handleFailure or completeSend, and both reset it.
  • Keychain.entryPresent now probes the real scoped key (diagnostics only).
  • releaseRetainedFeeLock on entering Amount answers the Pay-from and edited-amount threads.
  • iOS twin synonymdev/bitkit-ios#1208 has the same replace-at-retain outcome, memory-only consent, release-or-restore and identical-bytes-as-retry.

perf: not relevant.

CI at f4d69bd5: green except ovi-reviewer pending.

Device gate (partial): f4d69bd5 — not run yet; broadcast-unknown-retry.md checks on an emulator with the Trezor emulator and a fault-injecting Electrum proxy are pending. The device result follows in a second review.

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical Trezor and Jade signing remains unrun.

Findings: None in this delta. The reopened-transfer Retry label is fixed and verified on the emulator.

QA for d58aa37:

API 36 ARM64 Android emulator, Trezor Bridge emulator, local Bitcoin regtest and an Electrum broadcast-fault proxy. Built the exact head. The claim-fee boundary also used the endpoint-only hook shown below.

Retry a retained near-max payment through hardware transfer ✅ The retained amount reached Retry above today's maximum and resent the original bytes.
Retain the original payment Restart and reopen as a transfer Retry
nearmax-original.2x.mp4
nearmax-reopen.2x.mp4
nearmax-complete.2x.mp4

Sent 2,599,800 sats to the Spark deposit address through ordinary Send at Slow, with a 200-sat mining fee, while the proxy swallowed the broadcast. After restart, Transfer To Spending accepted that exact amount above its current 2,599,430-sat maximum. Changing it to 2,599,700 disabled Continue. The original amount reached the sign screen with Retry and the original 200-sat fee. Retry reached Transaction Signed; the proxy recorded byte-identical transactions, the controller recorded no new device prompt, and Bitcoin Core's mempool contained one transaction. Added transfer regression for manual case 1.

Retry a retained payment below the current claim fee ✅ Retry remained enabled below the current claim ceiling; a fresh payment still enforced the minimum.
Retain 1,000 sats Reopen with the higher claim quote Retry Fresh-payment control
claim-retain.2x.mp4
claim-high.2x.mp4
claim-retry.2x.mp4
claim-fresh-minimum.2x.mp4

Retained a real signed 1,000-sat payment to the Spark deposit address on the plain head, with a 153-sat mining fee. After restart with the hook, the Spark SDK read a controlled 100 sat/vB fee estimate. The transfer showed a 10,100-sat claim ceiling, zero to Spending, the original 153-sat mining fee and an enabled Retry. Retry sent identical bytes with no device prompt and reached Funds In Transfer. The proxy, controller and Bitcoin Core mempool establish the unchanged bytes, no approval and one accepted transaction. After the record was released, a fresh 1,000-sat transfer stayed on Amount and showed a 10,101-sat minimum. Added claim-fee boundary for manual case 1.

The hook only routes regtest Spark SDK chain requests through a proxy of the same upstream. The proxy changes fee estimates; the SDK, quote calculations, retained-record lookup and native signing/broadcast decisions run unchanged. The hook was not pushed.

diff --git a/app/src/main/java/to/bitkit/env/Env.kt b/app/src/main/java/to/bitkit/env/Env.kt
--- a/app/src/main/java/to/bitkit/env/Env.kt
+++ b/app/src/main/java/to/bitkit/env/Env.kt
@@ -146,3 +146,4 @@
     fun sparkChainServiceUrl(network: Network): String? = when (network) {
         Network.BITCOIN -> bitkitEsploraUrl
+        Network.REGTEST -> if (isDebug && isE2eTest) "http://127.0.0.1:62781" else null // test hook: route SDK chain calls through fee-control proxy
         else -> null
Price a different hardware transfer at today's fee ✅ A different amount used a fresh quote and required consent before device signing.
Fresh quote and Cancel Consent and device rejection
fresh-transfer-control.2x.mp4
fresh-transfer-reject.2x.mp4

With the near-max original still retained, a fundable 100,000-sat transfer showed a fresh 663-sat mining fee and Open Trezor Connect. The warning appeared before device contact. Cancel kept the sign screen; Yes, Send then requested a new signature. Rejecting its recipient prompt broadcast nothing and preserved the original, which subsequently retried successfully in the near-max case. Device state and broadcasts were checked in the controller and proxy. Manual case 1, transfer-warning check 9, with the changed quote path.

Check: exact-head APK and unit suites ✅ APK assembly and all selected suites passed.

Ran assembleDevDebug and testDevDebugUnitTest for the retained-storage, hardware-wallet, hardware-send, send-flow, broadcast-classification and Spark-funding suites. No failures or skips, including the new exact-amount exemption, original-fee quote and claim-minimum regressions.

Check: unchanged ordinary retry and consent paths ✅ Earlier passing device evidence applies to the unchanged signer, storage and consent paths.

No new device run for the unchanged portions of manual case 1. The signer, hardware-wallet repository and SendSheet have no delta from the previous reviewed head. The extracted eligibility helper preserves the same ordinary-send predicate.

Passing reports retained:

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Android and USB inventories contained no physical Trezor or Jade. Bridge emulation cannot prove physical USB, BLE, THP pairing or signing; the documented fixture has no Jade emulator.

Delta review: 03cc384..d58aa37, all six changed files and reached amount, quote, dispatch and claim paths. Storage-read failures and refused/observed eligibility have source/JVM coverage; no device case induced those branches. These runs establish retry and UI behavior, not final Spark settlement: local Bitcoin and hosted Spark use different regtest chains. The documented native silent-socket limitation remains.

Twin: bitkit-ios#1208 fix: keep signed hardware sends on retry at 532d0ab matches the retained-transfer amount exemption, original-fee quote, claim-minimum exception and Retry label. Source comparison only; the documented automatic-funding and unreadable-entry differences remain.


Reviewed by gpt-6.1-sol-high

@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.

No findings in the delta since 03cc384 (d58aa37, near-max hardware transfer retry after a fee rise).

  • Same bytes on retry: the retry request carries the retained address, amount and fee rate. signUnlessRetainedSendWarns returns Retry only for an unobserved, unrefused record with the same address and amount, and prepareRetainedSend loads record.signedTx, so the device is never asked to sign again.
  • Max-cap bypass: acceptsAmount exempts only sats == retainedRetrySats. If that record no longer offers a retry, the amount falls back to the fresh hwQuote, which applies today's limits, so a stale cap fails safe. spendableSats is a USat sum, so no underflow path was added.
  • Claim-fee exemption (isBelowClaimFee, canSign) applies only to a retained-retry quote. The claim fee is still priced today and passed as the ceiling, and onConfirm re-quotes, so a claim-fee rise asks for another tap.
  • Lifecycle: Back to a different amount gets a fresh quote and then the Blocking dialog. Restart re-reads the record. useHardwareWallet resets retainedRetrySats. A failed record read loses only the exemption. A cancelled refreshMax never writes the cap.
  • offersRetryTo in AppViewModel is the old inline predicate, extracted unchanged.
  • CI at this head is green.

Device gate: d58aa37. Skipped — already driven this round: near-max retained retry above today's max and retained retry below the current claim fee, on Android with the Trezor emulator, by ovi-reviewer at d58aa37; both passed with identical bytes rebroadcast. Physical Trezor/Jade signing is still unrun. perf: not relevant; the delta adds one mutex-guarded keychain read per refreshMax/quote, and the retry path skips the fee fetch.

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical Trezor and Jade signing remains unrun.

Findings: None in this delta.

QA for caea116:

Check: ordinary hardware retry and consent ✅ Earlier passing device evidence applies to the unchanged signer, storage and consent paths.

Manual case 1, recipe checks 1–8: no new emulator run. The signer, retained-send repository, hardware-wallet watcher and Keychain have no delta from d58aa37; the send-sheet changes only add the swap error retry route. Passing evidence retained:

The documented native silent-socket limitation remains; socket-closure recovery does not establish a working 120-second timeout.

Check: retained hardware transfer amount and fee ✅ The previously tested amount exemption, original-fee quote and warning remain intact.

The passing report at d58aa37 proves retry above today's maximum, retry below the current claim fee, and a different transfer requiring consent before signing. Those amount, quote and sign paths are unchanged; this merge adds deposit-progress state after broadcast. Recipe check 9 also has the earlier passing replacement report at app code 037d639. No new emulator run; those reports do not establish final Spark settlement.

Check: automatic funding and hardware review readiness ✅ The retained near-max route and final review gate survive the merge.

The passing automatic-funding report proves the original hardware wallet and locked fee remain reachable after fees rise. Its retained-wallet lookup and fee preparation are unchanged. Source review confirms the merged swipe and final-confirmation gates still require isHardwareReviewReady; the new software maximum refresh excludes hardware wallets, and swap dispatch requires Lightning with no hardware wallet selected. No new emulator run.

Check: exact-head APK and payment unit suites ✅ APK assembly and all selected suites passed without failures or skips.

Ran E2E=true TREZOR_BRIDGE=true ./gradlew assembleDevDebug testDevDebugUnitTest, selecting HwRetainedSendRepoTest, HwWalletRepoTest, HwSendViewModelTest, AppViewModelSendFlowTest, BroadcastExceptionExtTest and SparkFundingViewModelTest. This includes retained review readiness, near-max eligibility, original fees, consent restoration and the merged send-flow regressions.

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Current Android and USB inventories contained no physical Trezor or Jade. Bridge emulation bypasses physical USB, BLE and THP pairing, and the documented fixture has no Jade emulator.

Delta review: d58aa37..caea116, the master merge's resolutions and reached retained-send, funding, confirmation and transfer paths. Incoming software Max, swap routing, RBF and transfer-progress UI changes were not driven on device in this round. Storage failures and refused/observed eligibility have source/JVM coverage only.

Twin: bitkit-ios#1208 fix: keep signed hardware sends on retry at 532d0ab matches signed-byte retention and restore-outcome consent. Android's documented unreadable-entry replacement policy differs. Source comparison only.



Reviewed by gpt-6.1-sol-high

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rechecked after 101 new commits (8bb27fd, 46ad2a9, 0336ee0, and 98 more). Nothing blocking remains.

still open

  • Warning copy says "may have been broadcast" when the app has seen the transaction (app/src/main/java/to/bitkit/ui/screens/wallets/send/HwSendViewModel.kt:462). For an observed record of the same payment, the review shows RETAINED_HARDWARE_SEND with "Your transaction may have been broadcast". The wallet watcher has already seen that transaction on the network. Saying so would help the user decide whether to pay again. HwSendViewModel.kt has no changes since d58aa37. Line 557 still maps an observed record for the same payment to Blocking, which shows RETAINED_HARDWARE_SEND (AppViewModel.kt:10505-10509) with the unchanged "may have been broadcast" copy (values/strings.xml:235-236). Nobody has replied to this point.
  • Amount screen cap and toast name the retained amount while Available shows today's max (app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountScreen.kt:176-190). When a hardware wallet keeps a transfer above today's maximum, the amount screen's limits stop agreeing with what it displays. SpendingAmountScreen now caps the number pad at inputCapSats (lines 75, 176-177), which is max(maxSats, retainedRetrySats). Continue is enabled only by acceptsAmount (line 273): up to maxSats, or exactly the retained amount. "Available" still shows maxSats (line 230). With max 80,000 and a kept 95,000: typing 90,000 leaves Continue disabled with no toast, because 90,000 is under the pad cap and MaxExceeded never fires. Typing past 95,000 snaps the field to 95,000, and onMaxExceeded (SparkFundingViewModel.kt:177) says transfers are "currently limited to 95,000" next to an Available of 80,000. Before this commit, anything above max was snapped to max with a matching toast. Sending the retained amount only rebroadcasts the same bytes, so no money is at risk. This is copy and feedback only, found by reading AmountInputViewModel.setMaxAmount and the screen. I did not run it. This code is unchanged. SpendingAmountScreen.kt:176-177 still caps the pad at inputCapSats, Available at line 230 still shows maxSats, and SparkFundingViewModel.kt:214 still names inputCapSats in the toast. Your reply agrees the point is valid and defers it, so it isn't a rebuttal. No issue is linked and the PR's Out of Scope section doesn't list it, so nothing tracks the deferral yet.

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical Trezor and Jade signing remains unrun.

Findings: None in this delta.

QA for 961dba4:

Check: ordinary hardware retry and consent ✅ Earlier passing device evidence applies to the unchanged retry and consent paths.

Manual case 1, recipe checks 1–8: no new emulator run. The signer, retained-send repository, hardware-wallet watcher and send screens are unchanged by this delta. Passing evidence retained:

The documented native silent-socket limitation remains; socket-closure recovery does not establish a working 120-second timeout.

Check: retained hardware transfer amount and fee ✅ The previously tested amount exemption, original-fee quote and warning remain intact.

The passing report at d58aa37 proves retry above today's maximum, retry below the current claim fee, and a different transfer requiring consent before signing. The amount, quote and sign paths are unchanged. Recipe check 9 also has the passing replacement report at app code 037d639. No new emulator run; those reports do not establish final Spark settlement.

Check: automatic hardware funding and review readiness ✅ The retained near-max route and final review gates survive the merge.

The passing automatic-funding report proves the original hardware wallet and locked fee remain reachable after fees rise. Its retained-wallet lookup and fee preparation are unchanged. Source inspection confirms both swipe and final confirmation still require isHardwareReviewReady. No new emulator run.

Check: exact-head APK and payment integration suites ✅ APK assembly and all selected suites passed without failures or skips.

Ran E2E=true TREZOR_BRIDGE=true ./gradlew --no-daemon assembleDevDebug testDevDebugUnitTest, selecting the retained-storage, hardware-wallet, hardware-send, send-flow, broadcast-classification, Spark-funding, backup, wipe, wake, receipt, contact-payment, Paykit SDK, Lightning and Pubky suites. This includes the retained-review, original-fee, near-max, consent-restoration and incoming merge integration regressions.

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Current Android and USB inventories contained no physical Trezor or Jade. Bridge emulation cannot prove physical USB, BLE, THP pairing or signing; the documented fixture has no Jade emulator.

Delta review: caea116..961dba4, the master merge and reached retained-send, funding, Keychain, backup and wipe paths. The merge preserves the retained-send key alongside the wake keys. Incoming receipt UI, wake handling, profile-payment enablement and terms changes were not driven on device here. Storage failures and refused/observed eligibility retain source/JVM coverage only.

Twin: bitkit-ios#1208 fix: keep signed hardware sends on retry at e242101 matches retained-byte retry, restore-outcome consent and retained-transfer amount/fee handling. Android's documented unreadable-entry replacement policy differs. Source comparison only.


Reviewed by gpt-6.1-sol-high

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rechecked after 48 new commits (c83e504, 7c844ba, 5ef861f, and 45 more). Nothing blocking remains.

still open

  • Warning copy says "may have been broadcast" when the app has seen the transaction (app/src/main/java/to/bitkit/ui/screens/wallets/send/HwSendViewModel.kt:462). For an observed record of the same payment, the review shows RETAINED_HARDWARE_SEND with "Your transaction may have been broadcast". The wallet watcher has already seen that transaction on the network. Saying so would help the user decide whether to pay again. HwSendViewModel.kt has no diff since caea116. An observed record of the same payment still resolves to Blocking (HwSendViewModel.kt:557), and AppViewModel.kt:6786 shows RETAINED_HARDWARE_SEND. Its text is still hardware__send_broadcast_uncertain_text (AppViewModel.kt:10538-10542, strings.xml:235). No response addresses the copy.
  • Amount screen cap and toast name the retained amount while Available shows today's max (app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountScreen.kt:176-190). When a hardware wallet keeps a transfer above today's maximum, the amount screen's limits stop agreeing with what it displays. SpendingAmountScreen now caps the number pad at inputCapSats (lines 75, 176-177), which is max(maxSats, retainedRetrySats). Continue is enabled only by acceptsAmount (line 273): up to maxSats, or exactly the retained amount. "Available" still shows maxSats (line 230). With max 80,000 and a kept 95,000: typing 90,000 leaves Continue disabled with no toast, because 90,000 is under the pad cap and MaxExceeded never fires. Typing past 95,000 snaps the field to 95,000, and onMaxExceeded (SparkFundingViewModel.kt:177) says transfers are "currently limited to 95,000" next to an Available of 80,000. Before this commit, anything above max was snapped to max with a matching toast. Sending the retained amount only rebroadcasts the same bytes, so no money is at risk. This is copy and feedback only, found by reading AmountInputViewModel.setMaxAmount and the screen. I did not run it. SpendingAmountScreen.kt and SparkFundingViewModel.kt have no diff since caea116. The pad is still capped at inputCapSats (SpendingAmountScreen.kt:176-177; SparkFundingViewModel.kt:645). Continue still depends on acceptsAmount (SparkFundingViewModel.kt:648, screen line 273). onMaxExceeded still names inputCapSats (SparkFundingViewModel.kt:210-214) while Available shows maxSats (screen line 230). The ovi-reviewer delta review does not address this.

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical Trezor and Jade signing remains unrun.

Findings: None in this delta.

QA for 5eb68d7:

Check: ordinary hardware retry and consent ✅ Earlier passing device evidence applies to the unchanged retry and consent paths.

Manual case 1, recipe checks 1–8: no new emulator run. The signer, retained-send repository, watcher, send screens and send-flow implementation are unchanged since the previous review. Passing reports retained:

Socket-closure recovery does not establish a working 120-second timeout; the documented native silent-socket limitation remains.

Check: retained hardware transfer amount and fee ✅ The previously tested amount exemption, original-fee quote and warning remain intact.

The passing report at d58aa37 proves retry above today's maximum, retry below the current claim fee, and a different transfer requiring consent before signing. Recipe check 9 also has the passing replacement report at app code 037d639. Those paths are unchanged by this delta. No new emulator run; these reports do not establish final Spark settlement.

Check: automatic hardware funding and review readiness ✅ The retained near-max route and final review gates survive the merge.

The passing automatic-funding report proves the original wallet and locked fee remain reachable after fees rise. The retained-wallet lookup and fee preparation are unchanged. Source inspection confirms both swipe and final confirmation still require isHardwareReviewReady. No new emulator run.

Check: QuickPay policy before dispatch ✅ The incoming policy implementation matches its passing device report.

The report at a85ce15 proves a failed invoice reopens at Confirm after disabling QuickPay, while a held payment remains Pending without another dispatch. QuickPayRepo and the changed Spark code are identical here. No new emulator run; Spark sends and settings changes during dispatch retain unit coverage only.

Check: QuickPay settings authentication ✅ The incoming settings UI and authorization host match the tested revision.

The device report for b5c3869b proves the QuickPay PIN journey, cancellation, activity recreation and process restart. The settings UI and shared authentication components are identical here; the final review confirms the later journey edits only clarify the existing steps. No new emulator run. The extracted Allowances and USDT authentication screens were not driven here.

Check: exact-head APK and payment regression suites ✅ APK assembly and the selected suites passed without failures or skips.

Ran E2E=true TREZOR_BRIDGE=true ./gradlew --no-daemon assembleDevDebug testDevDebugUnitTest, selecting retained storage, hardware wallet/send, send flow, broadcast classification, Spark funding, QuickPay, settings authorization, Allowances, USDT and Paykit suites. This includes the retained-send integration and incoming QuickPay regressions.

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Current Android and USB inventories contained no physical Trezor or Jade. Bridge emulation cannot prove physical USB, BLE, THP pairing or signing; the documented fixture has no Jade emulator.

Delta review: 961dba4..5eb68d7, all 50 changed files and reached integration paths. No new device run was needed for cases already proved on unchanged code. CI launcher changes have earlier passing validation. Storage failures and refused/observed eligibility retain source/JVM coverage only.

Twin: bitkit-ios#1208 fix: keep signed hardware sends on retry at c02bc65 matches retained-byte retry and restore-outcome consent. Android's documented unreadable-entry replacement policy differs. Source comparison only.


Reviewed by gpt-6.1-sol-high

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical Trezor and Jade signing remains unrun.

Findings: None in this delta.

QA for 47cc70c:

Check: ordinary hardware retry and consent ✅ Earlier passing device evidence applies to the unchanged signing, retention and consent paths.

Manual case 1, recipe checks 1–8: no new emulator run. The hardware signer, retained-send repository, watcher, Keychain and amount/sign screens are unchanged since the previous review. The changed shared confirmation still checks hardware review readiness and retained-send warnings before navigating to hardware signing.

Passing reports retained:

Socket-closure recovery does not establish a working 120-second timeout; the documented native silent-socket limitation remains.

Check: retained hardware transfer amount and fee ✅ The tested warning, amount exemption, original fee and claim-fee exception remain unchanged.

The d58aa37 device report proves retry above today's maximum, retry below today's claim fee and consent before signing a different transfer. Recipe check 9 also has the passing replacement report at app code 037d639. No new emulator run; those reports do not establish final Spark settlement.

Check: automatic hardware funding and final confirmation ✅ Matching retained payments still reach their original wallet and locked fee.

The retained-wallet selection, original-fee preparation and exact-amount exception are unchanged. The passing near-max BIP21 report remains applicable. Source review confirms both swipe and final confirmation require isHardwareReviewReady; hardware sends return through their signing route before the new software fee reviewer. No new emulator run.

Check: renewed approval of a higher prepared fee ✅ The incoming fee-review implementation matches its passing device report.

The device report at 94675a0 proves renewed swipe/PIN approval, Back cancellation, background interruption with the deferred not-sent toast, and two-minute expiry. The prepared-send repository/coordinator, native wrapper and fee-review methods match that revision. Exact-head regressions also cover handle release and preserving a newer send during cleanup. No new emulator run.

Check: overlapping endpoint publication during Profile Save ✅ The incoming coalescing implementation retains its tested acknowledgement and epoch guards.

The publication repository matches 97aa347; source review confirms the SDK still checks and invalidates reuse under its operation lock. The staging timing report proves saved profile fields and three saves within 30 seconds at that revision. The incoming rc9 receipt and link changes also have a passing device report on their unchanged implementation. No new emulator run; the combined initial-setup timing with rc9 was not measured here.

Check: exact-head APK and payment regression suites ✅ APK assembly and the selected suites passed without failures or skips.

Ran E2E=true TREZOR_BRIDGE=true ./gradlew --no-daemon assembleDevDebug testDevDebugUnitTest, selecting retained storage, hardware wallet/send, send flow, broadcast classification, Spark funding, Lightning, Paykit receipt/publication/SDK, Pubky, profile editing, web links and wake suites.

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Current Android and USB inventories contained no physical Trezor or Jade. Bridge emulation bypasses physical USB, BLE and THP pairing; the documented fixture has no Jade emulator.

Delta review: 5eb68d7..47cc70c, both master merges, all 55 changed files and reached hardware-send integration paths. Existing deferred warning-copy and transfer-cap feedback are unchanged. No new device run was needed for previously proved, unchanged cases. Storage failures, wipe races, refused/observed eligibility and new wake-registration timing have source/JVM coverage here; no device case induced them. New incoming translations have no native-speaker verification from this run.

Twin: synonymdev/bitkit-ios#1208 fix: keep signed hardware sends on retry at 7a8c468 matches retained-byte retries and restore-outcome consent. Android's documented unreadable-entry replacement policy differs. Source comparison only.


Reviewed by gpt-6.1-sol-high

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical signing and the additional Spark-only transfer remain unrun.

Findings: None in this delta. Existing deferrals remain unchanged:

QA for 661757a:

Check: ordinary hardware retry and consent ✅ Earlier passing device evidence applies to the unchanged retry and consent paths.

Manual case 1, recipe checks 1–8: the signer, retained-send storage, watcher, send screens and send-flow logic are byte-identical to 47cc70c. No new hardware emulator run. Passing evidence retained:

Socket-closure recovery does not establish a working 120-second timeout; the documented native silent-socket limitation remains.

Check: retained hardware transfer amount and fee ✅ The tested warning, exact-amount exemption, original fee and claim-fee exception remain unchanged.

The d58aa37 device report proves near-max retry, retry below today's claim fee and consent before signing a different transfer. Recipe check 9 also has the passing replacement report. No new hardware emulator run; those reports do not establish final Spark settlement.

Check: automatic hardware funding ✅ Matching retained payments still reach their original wallet and locked fee.

The passing near-max BIP21 report remains applicable. Wallet selection, fee preparation, exact-amount eligibility and both hardware review-readiness gates are unchanged. No new hardware emulator run.

Check: incoming Spark force-transfer integration ✅ The incoming implementation matches its passing funding and predictive-back report.

All 17 incoming runtime files match 8e36808. Its device report proves both listed journeys, starting from Savings and external funding after a cancelled back gesture. Exact-head funding, record, driver and predictive-back regressions passed. Those results do not establish completed force-transfer settlement.

Transfer a Spark-only balance to Savings ⏭️ Unrun: hosted regtest funding was refused by the faucet.

A fresh wallet on the exact-head APK connected to hosted Spark regtest. The normal faucet form rejected the automated funding request; no funds arrived, so no transfer or swipe ran. The incoming PR's local-fixture report also says the withdrawal could not complete because the operator rejects its leaf swap. That earlier unsuccessful run is not treated as a pass. The route has source/JVM coverage; complete transfer and the success-screen Continue button remain unverified in this round.

Check: exact-head APK and regression suites ✅ APK assembly and all selected checks passed.

Ran E2E=true TREZOR_BRIDGE=true ./gradlew --no-daemon assembleDevDebug testDevDebugUnitTest, selecting retained storage, hardware wallet/send, send flow, broadcast classification, Spark funding/exit, Savings, ContentView and AppStatus suites. The two opt-in hosted Spark checks initially skipped; both passed with SPARK_EXIT_REGTEST=1. No selected check remains skipped. The device setup APK was rebuilt from the same source with the repository's hosted-regtest Esplora proxy configuration.

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Current Android and USB inventories contain no physical Trezor or Jade. Bridge emulation bypasses physical USB, BLE and THP pairing; the documented fixture provides no Jade emulator.

Delta review: 47cc70c..661757a, all 47 changed files and reached integration paths. This merge imports Spark design work already present at the current base; retained-send implementation is unchanged. Storage failures, wipe races, refused/observed eligibility, returned-funding accounting and leftover-sweep edge states retain source/JVM coverage; no device case induced those branches here. Incoming translations have no native-speaker verification from this run.

Twin: synonymdev/bitkit-ios#1208 fix: keep signed hardware sends on retry at 70bc6a3 matches retained-byte retries and restore-outcome consent. Android's documented unreadable-entry replacement policy differs. Source comparison only.


Reviewed by gpt-6.1-sol-high

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical signing and completed Spark-only transfer remain unverified.

Findings: None in this delta. The deferred observed-payment warning wording and transfer-cap feedback are unchanged.

QA for 78bbee1:

Check: ordinary hardware retry and consent ✅ Earlier passing device evidence applies to the unchanged retry and consent paths.

Manual case 1, recipe checks 1–8: no new hardware-emulator run. The only send-flow change schedules private Paykit registration; retained signing, storage, watcher, original-fee and warning paths are unchanged.

Passing reports retained:

Socket-closure recovery does not establish a working 120-second timeout; the documented native silent-socket limitation remains.

Check: retained hardware transfer amount and fee ✅ The tested amount exemption, original fee, claim-fee exception and warning are unchanged.

The d58aa37 device report proves retry above today's maximum, retry below today's claim fee and consent before signing a different transfer. Recipe check 9 also has the passing replacement report. No new hardware-emulator run; those reports do not establish final Spark settlement.

Check: automatic hardware funding ✅ Matching retained payments still reach their original wallet and locked fee.

The passing BIP21 report remains applicable. Retained-wallet selection, fee preparation, exact-amount eligibility and both hardware review-readiness gates are unchanged. No new hardware-emulator run.

Check: save profile edits during payment setup ✅ The incoming scheduling implementation matches its passing device report.

The Android 13 report at fba9c8d proves J1: saving the edited name, bio, website and tag within 30 seconds, including a repeat save. The profile writes, operation lock, setup capability read, registration priorities, publication repository and journey match that revision. Identity checks, revision checks, ordered lifecycle barriers and bounded overtaking remain intact. No new profile device run.

Check: exact-head APK and payment regressions ✅ APK assembly and all selected checks passed.

Ran E2E=true TREZOR_BRIDGE=true ./gradlew --no-daemon assembleDevDebug testDevDebugUnitTest, selecting retained storage, hardware wallet/send, send flow, broadcast classification, Paykit scheduling, publication, settings, private payments, profile editing and Spark suites. Both opt-in hosted Spark checks passed when rerun with SPARK_EXIT_REGTEST=1; no selected check remains skipped.

Transfer a Spark-only balance to Savings ⏭️ Incomplete: the hosted faucet refused funding, and the local operator rejected the withdrawal's required leaf swap.

On Android 15 with the local fixture hook, a 200,000-sat deposit produced a 199,865-sat Spark balance. Transfer To Savings opened Please Confirm directly after the intro, skipping Network Fee & Availability. Swiping reached Funds In Transfer, then Transfer Failed. The app log reports failure to select leaves; the local operator log identifies adaptor-signature verification as the rejection. This reproduces the incoming PR's documented local-fixture limitation.

Completed settlement and the success-screen Continue action remain unverified. The separate exact-head hosted build connected successfully, but the normal faucet form rejected its automated funding request; that refusal was checked in the faucet response.

Local transfer attempt Hosted wallet remained unfunded
spark-local-transfer-2x.2x.mp4
spark-hosted-funding-2x.2x.mp4

Recordings are at 2× speed. The local build only redirects the Spark/chain endpoints and disables fee ladders as the fixture documents; the transfer code and native SDK are unchanged. The unpushed hook is below.

Local fixture hook
diff --git a/app/src/main/java/to/bitkit/services/SparkService.kt b/app/src/main/java/to/bitkit/services/SparkService.kt
index 594bc1137..e64fc8c89 100644
--- a/app/src/main/java/to/bitkit/services/SparkService.kt
+++ b/app/src/main/java/to/bitkit/services/SparkService.kt
@@ -43,6 +43,7 @@ import breez_sdk_spark.SendPaymentOptions
 import breez_sdk_spark.SendPaymentRequest
 import breez_sdk_spark.SyncWalletRequest
 import breez_sdk_spark.defaultConfig
+import breez_sdk_spark.parseSparkConfig
 import kotlinx.coroutines.flow.MutableSharedFlow
 import kotlinx.coroutines.flow.SharedFlow
 import kotlinx.coroutines.flow.asSharedFlow
@@ -178,8 +179,45 @@ class SparkService @Inject constructor(
         val mnemonic = keychain.loadString(Keychain.Key.BIP39_MNEMONIC.name) ?: throw ServiceError.MnemonicNotFound()
         val passphrase = keychain.loadString(Keychain.Key.BIP39_PASSPHRASE.name)
         val config = configure(defaultConfig(network), Env.breezApiKey, isExiting)
+        if (Env.isDebug && Env.network == Network.REGTEST) { // test hook: documented local Spark fixture
+            config.sparkConfig = parseSparkConfig("""{
+  "coordinator_identifier": "0000000000000000000000000000000000000000000000000000000000000001",
+  "threshold": 2,
+  "signing_operators": [
+    {
+      "id": 0,
+      "identifier": "0000000000000000000000000000000000000000000000000000000000000001",
+      "address": "http://10.0.2.2:39771",
+      "identity_public_key": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
+    },
+    {
+      "id": 1,
+      "identifier": "0000000000000000000000000000000000000000000000000000000000000002",
+      "address": "http://10.0.2.2:39772",
+      "identity_public_key": "024d4b6cd1361032ca9bd2aeb9d900aa4d45d9ead80ac9423374c451a7254d0766"
+    },
+    {
+      "id": 2,
+      "identifier": "0000000000000000000000000000000000000000000000000000000000000003",
+      "address": "http://10.0.2.2:39773",
+      "identity_public_key": "02531fe6068134503d2723133227c867ac8fa6c83c537e9a44c3c5bdbdcb1fe337"
+    }
+  ],
+  "ssp_config": {
+    "base_url": "http://10.0.2.2:39774",
+    "identity_public_key": "03e7343c4fdcffdce7b0041c4f482948a1058f8fe8d5a48e0a0c4e884d0e7cc124",
+    "schema_endpoint": "graphql/spark/rc"
+  },
+  "expected_withdraw_bond_sats": 10000,
+  "expected_withdraw_relative_block_locktime": 1000
+}
+""") // test hook
+            config.watchtowerFeeLadderEnabled = false // test hook: public operator requires P2A anchors
+        }
         val storageDir = File(Env.sparkStoragePath(walletIndex)).apply { mkdirs() }.path
-        val chainServiceUrl = Env.sparkChainServiceUrl(Env.network)
+        val chainServiceUrl = if (Env.isDebug && Env.network == Network.REGTEST) { // test hook
+            "http://10.0.2.2:39775/api" // test hook: same fixture chain
+        } else Env.sparkChainServiceUrl(Env.network)
         val connected = SdkBuilder(config, Seed.Mnemonic(mnemonic, passphrase)).use { builder ->
             builder.withDefaultStorage(storageDir)
             chainServiceUrl?.let { builder.withRestChainService(it, ChainApiType.ESPLORA, null) }
Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Current Android and USB inventories contain no physical Trezor or Jade. Bridge emulation bypasses physical USB, BLE and THP pairing; the documented fixture provides no Jade emulator.

Delta review: 661757a..78bbee1, all 10 changed files and reached integration paths, including an independent review. The merge imports profile scheduling already present at the base. No device case forced queue fairness, cancellation, identity-change or storage-failure branches; those retain source/JVM coverage.

Twin: bitkit-ios#1208 fix: keep signed hardware sends on retry at 70bc6a3 matches retained-byte retries and restore-outcome consent. Android's documented unreadable-entry replacement policy differs. Source comparison only; the incoming profile scheduling change is Android-only.


Reviewed by gpt-6.1-sol-high

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical signing and completed Spark-only transfer remain unverified.

Findings: None in this delta. The deferred observed-payment warning wording and transfer-cap feedback remain unchanged.

QA for d01c8c3:

Check: ordinary hardware retry and consent ✅ Earlier passing device evidence applies to the unchanged signing, retention and consent paths.

Manual case 1, recipe checks 1–8: the signer, retained-send repository, hardware watcher, Keychain and send screens are unchanged since the previous review. Passing reports retained:

No new hardware-emulator run. Socket-closure recovery does not establish a working 120-second timeout; the documented native silent-socket limitation remains.

Check: retained hardware transfer amount and fee ✅ The tested warning, exact-amount exemption, original fee and claim-fee exception are unchanged.

The d58aa37 device report proves retry above today's maximum, retry below today's claim fee and consent before signing a different transfer. Recipe check 9 also has the passing replacement report. These remain earlier passing runs; they do not establish final Spark settlement.

Check: automatic hardware funding ✅ Matching retained payments still reach their original wallet and locked fee.

The passing near-max BIP21 report remains applicable. Retained-wallet selection, original-fee preparation, exact-amount eligibility and both hardware review-readiness gates are unchanged. No new hardware-emulator run.

Check: dust force-close transfer settlement ✅ The incoming regtest evidence still covers the 400-sat dust and 420-sat viable-sweep cases.

The recorded manual cases in bitkit-android#1973 fix: settle dust force-close transfers were driven at 382871232 with native SegWit change. The later anchor-weight correction puts the cutoff at 405 sats, keeping both tested amounts on the same sides. Source review confirms the added readable-payment and address-change guards preserve those exercised outcomes. Exact-head unit regressions cover the current fee boundaries, batching, an already-held sweep, unreadable payments and cancellation cleanup. No new channel-close device run.

Check: exact-head APK and payment regressions ✅ APK assembly and all selected checks passed without failures or skips.

Ran E2E=true TREZOR_BRIDGE=true ./gradlew --no-daemon assembleDevDebug testDevDebugUnitTest, selecting HwRetainedSendRepoTest, HwWalletRepoTest, HwSendViewModelTest, AppViewModelSendFlowTest, BroadcastExceptionExtTest, SparkFundingViewModelTest, TransferRepoTest, LightningRepoTest, ClosedChannelDetailsTest, SparkExitViewModelTest and SparkExitDriverTest. Both hosted SparkExitRegtestTest checks also passed with SPARK_EXIT_REGTEST=1. The hosted device APK used the repository's Spark-regtest Esplora proxy configuration.

Transfer a Spark-only balance to Savings ⏭️ Incomplete: the hosted faucet refused funding, and the local operator rejected the withdrawal's leaf swap.

On Android 15, a 131,207-sat local deposit produced a 131,072-sat Spark balance. Transfer To Savings opened Please Confirm directly after the intro; Back also skipped Network Fee & Availability. Confirmation showed a 1,737-sat fee. Swiping reached Funds In Transfer, then Transfer Failed. The app log reports failure to select leaves; the operator log identifies adaptor-signature verification as the rejection. This matches the incoming transfer PR's documented local-fixture limitation.

Completed settlement and the success-screen Continue action remain unverified. The separate hosted build connected successfully, but the normal faucet form refused its funding request; that refusal was checked in the faucet response.

Local transfer attempt Hosted wallet remained unfunded
spark-local-transfer-2x.2x.mp4
spark-hosted-funding-2x.2x.mp4

Recordings are at 2× speed. The local build only redirects the Spark/chain endpoints and disables fee ladders as the fixture documents; the transfer code and native SDK are unchanged. This setup failure is not counted as a passing transfer or a new app finding. Additional transfer case carried from the previous review.

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Current Android and USB inventories contained no physical Trezor or Jade. Bridge emulation cannot establish physical USB, BLE, THP pairing or Jade signing.

Delta review: 78bbee1..d01c8c3, all nine changed files and reached transfer, channel-close, address-change and retained-send integration paths. This merge imports the dust force-close fix already present at the base; retained-send behavior is unchanged. Incoming closure fallbacks, evidence-read failures and cancellation timing have source/JVM coverage here; no device case induced those branches. Storage failures, wipe races and refused/observed eligibility retain source/JVM coverage.

Twin: bitkit-ios#1208 fix: keep signed hardware sends on retry at 0cb5bef matches retained-byte retry and restore-outcome consent. Android's documented unreadable-entry replacement policy differs. Source comparison only.


Reviewed by gpt-6.1-sol-high

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ⚠️ Not verified — no new findings; physical Trezor and Jade signing remains unverified.

Findings: None in this delta. The deferred observed-payment warning wording and transfer-cap feedback are unchanged.

QA for 2bf3461:

New device cases ran on an Android 16 Pixel 10 Pro emulator, with the Trezor Bridge emulator where signing was needed. Recordings are at 2× speed.

Check: ordinary hardware retry and consent ✅ Earlier passing reports apply to the unchanged signing, retention and consent paths.

Manual case 1, recipe checks 1–8 retain these passing reports:

The signer, watcher, retained-send repository, Keychain and ordinary send flow are unchanged. Socket-closure recovery does not establish a working 120-second timeout; the documented native silent-socket limitation remains.

Check: automatic hardware funding ✅ Matching retained payments still reach their original wallet and locked fee.

The passing near-max BIP21 report remains applicable: retained-wallet selection, original-fee preparation and hardware review-readiness gates are unchanged. The d58aa37 report also retains coverage for Retry below today's claim fee. These are earlier device runs, not new automatic-funding runs.

Retry a retained hardware transfer through the redesigned screens ✅ After restarting and raising fees, the retained amount reached Retry at its original fee and rebroadcast identical bytes without device approval.
  • Recipe check 9: retained 13,842,756 sats with a 1,386-sat mining fee. At 100 sat/vB, current Max was 13,797,942 sats. A nonmatching amount of 13,842,755 stayed on Amount; the retained amount reached Retry.
  • The proxy captured identical replacement and retry bytes. Bitcoin Core accepted txid 291aabd89645b6f09d2a1ae4255158f231230143511da94411df1e619a26016b once; the Trezor controller stayed on Homescreen, with no approval commands during Retry.
  • The recording captures the redesigned Transaction Signed screen and then Funds in Transfer. It does not establish settlement of this hardware deposit into Spark.
  • Used the existing debug Blocktank endpoint setting to control fee quotes, plus the Electrum fault proxy. App source and the native SDK were unchanged.

hardware-retry-final-2x.2x.mp4

Warn before replacing a retained hardware send with a transfer ✅ Cancel and device rejection preserved the original; a replacement was signed only after explicit consent.
  • A swallowed 38,100-sat ordinary send retained its 153-sat fee. A different transfer warned before device contact. Cancel stayed on Sign; Yes, Send followed by recipient rejection produced no broadcast.
  • After restart, the original amount still showed Retry with the 153-sat fee. A later near-max replacement warned again, then required the recipient, amount, locktime and summary approvals before saving new bytes. The controller and broadcast trace confirm these transitions.
Cancel and reject Reopen original and approve replacement
hw-consent-reject-2x.2x.mp4
hw-consent-approve-2x.2x.mp4
Check: Transfer to Spending fee grid and funding options ✅ Earlier passing transfer and unavailable-funding cases remain covered, with new hardware-screen evidence above.

The incoming design's transfer report and final device review, at db88d41, cover transfer confirmation, status and unavailable-funding behavior on unchanged code. This run closes the previously uncaptured Transaction Signed step. Banner relaunch is covered separately below.

Check: dust force-close transfer settlement ✅ Earlier passing dust and viable-sweep evidence remains applicable to unchanged settlement paths.

The previous review carries the 400-sat dust and 420-sat viable-sweep evidence from #1973, plus current-boundary regressions. Those settlement paths have no changes in this delta. No new channel-close device run.

Check: exact-head APK and payment regressions ✅ APK assembly and selected retained-payment and transfer checks passed without failures or skips.

Built 2bf3461 and ran the retained-send, hardware-wallet, hardware-signing, app send-flow, broadcast-classification, transfer repository, Lightning repository and transfer-screen/view-model suites. The fee-control APK was rebuilt from the same unchanged source using the existing debug endpoint setting.

Reopen transfer progress after restarting the app ✅ The Home banner reopened transfer progress after relaunch, and completion cleared it.

Incoming transfer-banner-opens-progress.xml, including the previously unproved relaunch step: a Normal 34,583-sat transfer opened Processing Payment from the banner. After force stop and relaunch, the banner reopened Funds in Transfer. It completed to Funds Moved to Spending; Awesome returned Home with the banner gone. Used hosted regtest with no app source hooks.

banner-relaunch-2x.2x.mp4

Transfer a Spark-only balance to Savings ✅ A funded Spark-only balance completed the transfer, and Continue returned Home.

The previously incomplete case now passed on hosted regtest: 249,901 sats in Spark opened Please Confirm directly after the intro, without Network Fee & Availability. The 2,190-sat withdrawal fee left 247,711 sats in Savings. Funds Moved to Savings → Continue returned Home with Spending at zero. No app source hooks.

spark-only-transfer-2x.2x.mp4

Send with physical Trezor and Jade wallets ⏭️ Unrun: no physical hardware wallet was attached.

Manual case 2 remains unverified. Android and USB inventories contained no physical Trezor or Jade. The available Bridge fixture covers Trezor emulation; it cannot establish physical USB, BLE, THP pairing or Jade signing.

Delta review: d01c8c3..2bf3461, all 45 changed files and reached integration paths, including an independent review. Amount-unit refresh and locale changes received source/regression checks; no new device locale sweep.

Twin: bitkit-ios#1208 fix: keep signed hardware sends on retry at 766cd3c matches retained-byte retries and payment-bound consent. Android's documented unreadable-entry replacement policy differs intentionally. Source comparison only; the incoming Android presentation changes were not tested on iOS.



Reviewed by gpt-6.1-sol-high

@jvsena42

Copy link
Copy Markdown
Member

@Jasonvdb this conflicts with master; please rebase. I'll review it again once it merges cleanly.

@Jasonvdb

Copy link
Copy Markdown
Contributor Author

@jvsena42 I merged master in and fixed the conflicts, so it merges cleanly now. Ready for another look when you have time.

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ✅ Approve

Findings: None in this delta. The deferred observed-payment warning wording and transfer-cap feedback are unchanged.

QA for e069934:

Check: ordinary hardware retry and consent ✅ Earlier passing device evidence remains applicable to the unchanged signing, retention and consent paths.

Manual case 1, recipe checks 1–8: the signer, retained-send repository, watcher, Keychain and amount/sign screens have no delta from the previous review. Source review confirms the merged confirmation gates still require hardware review readiness and retained-send consent. The spending-balance update applies only to Lightning payments.

Passing reports retained:

These are earlier device runs. Socket-closure recovery does not establish a working 120-second timeout; the documented native silent-socket limitation remains.

Check: automatic funding keeps the original wallet and fee ✅ Matching retained payments still reach their original wallet and locked fee.

The passing near-max BIP21 report remains applicable. Source comparison confirms retained-wallet selection, exact-amount eligibility and original-fee preparation are unchanged. No new automatic-funding device run.

Check: retained hardware transfer warning and retry ✅ Earlier passing warning, replacement and original-byte retry evidence remains applicable.

The 2bf3461 report proves recipe check 9 through the redesigned screens: Cancel and device rejection preserve the original; an approved replacement signs new bytes; restarting and raising fees still allows identical-byte Retry at the original fee without device approval. The claim-fee boundary report also remains applicable.

Source comparison confirms retained-transfer amount, quote, warning and signing decisions are unchanged. The instant-claim fee clamp applies to Savings transfers; the hardware-screen change guards fee-unit switching when no usable exchange rate exists. No new hardware-emulator run. These reports establish retry behavior, not final settlement of the hardware deposit into Spark.

Check: exact-head APK and payment regressions ✅ APK assembly and the full JVM suite passed; both opt-in hosted Spark probes also passed.

Ran E2E=true TREZOR_BRIDGE=true ./gradlew --no-daemon assembleDevDebug testDevDebugUnitTest. The only skipped checks were the two opt-in SparkExitRegtestTest probes; both passed when rerun with SPARK_EXIT_REGTEST=1. No failing or unrun planned check remains.

Not driven: manual case 2 requires physical Trezor and Jade wallets. No physical hardware wallet was attached; Bridge emulation cannot establish USB, BLE, THP pairing or Jade signing. This hardware-only case was excluded from the runnable plan.

Delta review: 2bf3461..e069934, the master merge, all production hunks, merge resolutions and reached integration paths, including an independent review. No new device run: earlier passing cases retain their evidence; incoming master UI, restoration, recovery and lifecycle changes received source/JVM checks here.

Twin: synonymdev/bitkit-ios#1208 fix: keep signed hardware sends on retry at bc40bf2 matches retained-byte retries and payment-bound, restore-outcome consent. Android's documented unreadable-entry replacement policy differs intentionally. Source comparison only.


Reviewed by gpt-6.1-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

This branch has not been deployed

No deployments
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.

bug: hardware send asks to sign again on retry

5 participants