feat: add seedqr wallet recovery - #1319
Conversation
|
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
jvsena42
left a comment
There was a problem hiding this comment.
No new findings at bb92c731b. Ben's clipboard-as-Compact and system-Back threads are still open, and I have not repeated them.
Checked and clean:
- Decode. bitkit-core 0.5.18 Standard decoding requires 48 digits, indices < 2048, and
validate_mnemonic. A malformed Standard QR errors out and leaves the words untouched.replaceAllWordsre-runs the BIP39 check anyway. 24-word and 32-byte payloads fall through toInvalidPayload, which matches the 12-word scope. - Key material. The payload and mnemonic are never logged, and no effect carries the mnemonic. A SeedQR scanned from Send or the main scanner is only logged as a redacted hash, lands in the address field, and fails decode. Nothing is persisted and nothing goes to the clipboard.
scanResultis nulled right after delivery, andBlockScreenshots()covers the in-screen scanner. - Back and cancel. Toolbar Back in the scanner only flips
isScanningSeedQr. An invalid scan keeps the words, and a valid scan replaces only the words; the passphrase is kept. - Payment QR regression.
selectQrCodePayloadstill picks the first barcode with a non-nullrawValue. The binary fallback applies only whenacceptsBinaryPayload, and every non-restore call site leaves that false. - Dependency. The only change is the first-party bitkit-core pin, 0.5.14 → 0.5.18. The same pin is in synonymdev/bitkit-ios#760.
Unverified, device-only: that ML Kit rawBytes for a byte-mode Compact SeedQR is exactly the 16 payload bytes, including bytes ≥ 0x80. Scanning bitkit-core's fixture 5bbd9d71a8ec7990831aff359d426545 on a physical device should give forum undo fragile … off merit.
jvsena42
left a comment
There was a problem hiding this comment.
Delta since bb92c731b (f2e57daf9): no findings. Clipboard and debug input now go through textQrCodePayload with rawBytes = null, so a 16-character paste can no longer decode as Compact entropy. The camera and gallery paths still take ML Kit rawBytes through selectQrCodePayload. BackHandler(enabled = isScanningSeedQr) closes the inline scanner on system Back and keeps the form.
|
QA reviewed on f2e57da. Since the review on bb92c73, one commit. System Back on the restore scanner returns to the form. Clipboard and debug text no longer carry raw bytes, so a 16-character paste is not treated as Compact SeedQR. Ran on Pixel_6: typed a word, opened Scan QR Code, pressed system Back. The form and the word were still there. On the S22, a 12-word Standard SeedQR filled the words. The matching Compact SeedQR did too, after a closer hold. An invalid code and a 24-word code were rejected and left the words alone. iPhone 17: Standard and Compact both filled the same phrase. Invalid and 24-word were rejected with the 12-word SeedQR message. Twin synonymdev/bitkit-ios#760: same import. Its two low notes are fixed in f710485. FindingsLOW
ScaleHIGH must be fixed before merge · MEDIUM good to fix here or in a follow-up · LOW non-blocking, nit |
|
Fixed the LOW |
jvsena42
left a comment
There was a problem hiding this comment.
Delta since f2e57daf9 (f89a295e0): no findings. An invalid scan now shows onboarding__restore_seedqr_error, which is added in alphabetical order.
|
QA reviewed on f89a295. Since the review on f2e57da, one commit. Invalid and unsupported SeedQR on Restore now uses "This QR code does not contain a valid 12-word SeedQR," matching iOS. Reviewed the restore scanner toast key and the surrounding decode path; no device run this round. Twin bitkit-ios#760: already reviewed on f710485. No findings. Checked and clean
|
f89a295 to
b33de79
Compare
|
Squashed commits |
Closes #1277
Related to bitkit-ios#760.
This PR:
Description
Out of Scope
Design
Restore wallet › Restore walletandSend (QuickPay) › Scan QR invoice Quickpay.Preview
QA Notes
Manual Tests
regression:Restore Wallet → enter or paste a valid 12-word mnemonic manually: recovery remains available without using the scanner.regression:Send → scan and paste text-based Bitcoin, Lightning, LNURL, and Bitkit links: existing scanner routing is unchanged.regression:Home tab bar and Add Contact: the scan glyph is optically aligned with adjacent icons and the tab-bar scan button retains its previous apparent size.Automated Checks
RestoreWalletSeedQrViewModelTest.kt: decoded mnemonics populate all recovery fields, while invalid scans preserve state and emit error feedback.RestoreWalletViewModelTest.kt: existing restore behavior uses the injected SeedQR repository without changing manual mnemonic coverage.just compile,just test, andjust lintpass; detekt reports only repository-baseline findings.