0xMiden / 0xMiden/wallet

Trigger deferred recovery-phrase backup after first funds arrive

Đang mở
#842 1 bình luận 1 reaction 1 người được giao Được @0xnullifier nhận Xem trên GitHub
enhancement
Ngôn ngữ chính
TypeScript
Star
5
Fork
28
Merge trung bình
9 giờ 50 phút
Pull request đã merge (30 ngày)
123

Mô tả

## Summary

Bread already defers recovery-phrase backup until after onboarding. Keep that flow unchanged, but do not surface the backup reminder until the wallet receives its first asset. Once value is at risk, keep reminding the user until they complete the existing verification flow.

This follows Zodl's behavior: one-tap wallet creation first, then a prominent backup reminder after the wallet receives funds.

## What already exists

- A newly created wallet goes directly through protection setup, Guardian selection, and confirmation without showing the recovery phrase.
- Creation seeds the existing VerifySeedPhrase wallet prompt; importing or recovering a wallet does not.
- The existing flow already provides:
- biometric, passcode, or password authentication before reveal;
- recovery-phrase review with screenshot protection; and
- a first-and-last-word verification step.
- The prompt is marked complete only after successful verification, and that state is persisted.

This issue should refine that implementation, not add another backup flow or put phrase backup back into onboarding.

## Current gap

The seeded VerifySeedPhrase prompt is currently eligible on Home immediately, even while the wallet is empty. It is also dismissible through the generic prompt behavior, which records a permanent Dismissed status even though the user has not verified the phrase.

## Required behavior

- Keep the current onboarding and wallet-creation flow unchanged.
- Keep seeding the VerifySeedPhrase prompt for newly created wallets only.
- While the wallet is empty, do not include the backup prompt in the Home prompt carousel.
- Make the prompt eligible after a successful sync discovers either:
- a valid, recognized claimable or consumable note addressed to the wallet with a positive asset amount; or
- a non-zero wallet balance.
- A received note should count before it is consumed into the balance: the recovery phrase is already needed to recover that value.
- When eligible, show a prominent Backup required prompt on Home. Its primary action should jump directly into the existing authenticated recovery-phrase review and verification flow.
- Replace permanent dismissal with Zodl-style Remind me later behavior. The reminder should return after:
1. 2 days;
2. then 2 weeks;
3. then 1 month.
- Before snoozing, make the user acknowledge that an unverified recovery phrase may leave their funds unrecoverable.
- Persist the reminder phase, next reminder time, and completion state across app restarts.
- Continue to mark the reminder complete only after successful phrase verification. Merely viewing or copying the phrase does not count.

This is a persistent safety reminder, not a transaction gate. Sending, claiming, and other wallet actions remain available.

## Existing wallet states

- Completed remains completed and must never be re-armed.
- Pending remains pending but is hidden until the first-funds condition is met.
- Dismissed means unverified under the current implementation. For a funded wallet, migrate it into the new reminder flow rather than treating it as complete.

## Security requirements

- Reuse the existing authenticated reveal and verification flow.
- Preserve the existing screenshot and screen-recording protection.
- Never include the recovery phrase or its words in logs, errors, analytics, or reminder state.

## Acceptance criteria

- A newly created empty wallet completes the current onboarding flow and reaches Home without a recovery-phrase prompt.
- An empty wallet's seeded prompt remains hidden across restart and sync.
- Receiving the first positive-value, recognized asset-bearing note causes the prompt to appear after sync, including when the note arrived while the app was in the background.
- A claimable note triggers the prompt before it is consumed into the balance.
- Backup now opens the existing authenticated review and verification flow.
- Remind me later follows the 2-day, 2-week, and 1-month cadence and survives restart.
- Successful verification removes the prompt permanently and survives restart.
- Imported and recovered wallets are not incorrectly prompted.
- Existing Pending, Dismissed, and Completed states migrate as described above.
- Mobile and extension tests cover empty, first-note, funded, snoozed, completed, and imported/recovered cases.

## Out of scope

- Any change to seed generation, seed storage, Guardian recovery, or the key model discussed in #841.
- Moving recovery-phrase backup back into onboarding.
- Blocking transactions until backup is complete.
- Shielding or unshielding behavior.

## References

- [Wallet UX discussion in Slack](https://midengroup.slack.com/archives/C0A73K81FNZ/p1788775925289429?thread_ts=1788775717.868239&cid=C0A73K81FNZ)
- [Zodl: Backing up your recovery phrase](https://support.zodl.com/article/12-backing-up-zodl)
- [Zodl iOS implementation: wallet-backup banner and reminder cadence](https://github.com/zodl-inc/zodl-ios/blob/90fea17814867d43d7ce70ab2c9d877d2450a7b1/secant/Sources/Features/SmartBanner/SmartBannerStore.swift)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.