feat: add wallet recovery flows to bdk_demo#65
Merged
reez merged 6 commits intobitcoindevkit:mainfrom Apr 30, 2026
Merged
Conversation
Contributor
Author
j-kon
reviewed
Apr 27, 2026
Contributor
j-kon
left a comment
There was a problem hiding this comment.
Nice work on wiring recovery through the service, UI, route, and tests. I left a few small comments around keeping BIP-39 validation aligned with BDK as the source of truth, plus one sensitive-input hardening suggestion. The flow is understandable and well-covered overall.
Collaborator
|
just needs a rebase and then I will merge |
reez
approved these changes
Apr 30, 2026
j-kon
approved these changes
Apr 30, 2026
j-kon
approved these changes
Apr 30, 2026
45206f7 to
f2e50a5
Compare
f2e50a5 to
3bc67dd
Compare
reez
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue #5
Notes to reviewers
validateRecoveryPhrase()does local word-count and word-membership checks, then delegates checksum validation to BDK viaMnemonic.fromString(). This keeps validation fast and user-friendly without duplicating checksum logic outside the library that already owns it._buildAndPersistWallet(...)is an internal refactor seam introduced to keepcreateWallet()and the new recovery flows aligned on name validation, persistence, and disposal-on-failure behavior. That refactor is intentionally isolated so reviewers can verify the no-behavior-change step separately from the feature additions.ScriptType.unknown. A raw descriptor string may be watch-only or secret bearing, and this PR does not claim the app can reliably infer spend capability from descriptor shape alone. The safer contract here is local reconstruction and persistence only, with explicit spend capability, surfacing is deferred to later work once the app is able to demonstrate this model across service and UI layers.RecoverWalletPagemirrorsCreateWalletPagepatterns for snackbar feedback, mounted guards, and provider ownership.New features
validateRecoveryPhrase()with user-friendly recovery validation errors._buildAndPersistWallet(...)as a shared, so create and recover flows use the same persistence and cleanup rules.WalletService.recoverFromPhrase(name, network, scriptType, phrase)andWalletService.recoverFromDescriptors(name, network, descriptor, changeDescriptor).RecoverWalletPageand route/recover-walletto the recovery flow.test/features/wallet_setup/.