Implement the flow using the recovery flow happy path#3453
Merged
Conversation
Contributor
Author
|
New UX: Copy pasting all the words Screen.Recording.2025-10-31.at.10.04.18.movInvalid mnemonic Screen.Recording.2025-10-31.at.10.05.46.movManually adding last word Screen.Recording.2025-10-31.at.10.05.58.mov |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a recovery phrase input UI and the underlying flow to recover an identity using a 24-word BIP-39 mnemonic phrase. The implementation includes SLIP-0010 key derivation, mnemonic validation, and authentication logic.
- Adds a recovery phrase input form with 24 word fields supporting keyboard navigation and paste functionality
- Implements SLIP-0010 Ed25519 key derivation from BIP-39 mnemonics with proper hardened path support
- Creates a recovery flow that validates the mnemonic, derives the identity, and authenticates against the canister
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/frontend/src/routes/(new-styling)/recovery-phrase/+page.svelte | Implements the recovery phrase UI with 24 input fields, keyboard navigation, paste handling, and auto-submit on completion |
| src/frontend/src/lib/utils/recoveryPhrase.ts | Provides SLIP-0010 key derivation utilities, BIP-39 mnemonic validation, and Ed25519 identity generation from mnemonics |
| src/frontend/src/lib/utils/recoveryPhrase.test.ts | Tests SLIP-0010 derivation against official test vectors and validates behavior with invalid mnemonics |
| src/frontend/src/lib/flows/recoverWithPhraseFlow.svelte.ts | Orchestrates the recovery flow including mnemonic validation, identity derivation, and authentication with the canister |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sea-snake
reviewed
Nov 3, 2025
| words: string[], | ||
| ): Promise< | ||
| | { success: true; info: IdentityInfo; identity: DelegationIdentity } | ||
| | { success: false; error: Error } |
Contributor
There was a problem hiding this comment.
Why not just throw the error?
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Nov 3, 2025
* Recovery flow happy path * Refactor to a function * Support pasting words * Use global agent options and submit on enter or word pasting * Revert and improve comments * Remove unnecessary comment and unused import * Remove unnecessary import * GH review changes * Change submit trigger * Refactor to throw instead of variant
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.
Motivation
Enable users to recover access to their identities using the recovery phrase.
In this PR, I set up the flow until the recovery phrase enables an authenticated connection with the backed, effectively restoring access.
NOT IN THIS PR:
Changes
iiConnectionand legacy directory.recoverWithPhraseFlow.svelte.tsto encapsulate the recovery logic, including phrase validation, device lookup, and authentication.isValidMnemonicand enforced mnemonic validation infromMnemonic(previouslyfromMnemonicWithoutValidation), throwing an error for invalid mnemonics.Tests
Tested locally: