As an identity holder, I want to bring an identity I already have onto this phone with its recovery phrase or key file, so that I am the same person here as on my other devices.
Situation
I created my identity somewhere else, on Seed desktop or on another phone. I have its 12 or 24 recovery words on paper, or the text of a key file I exported. I am on the Me tab.
What I do
Tap "Import identity".
Type the words, or paste the key file text, into the large field.
Read the line under the field until it says the input is good.
Optionally type a name for the key.
Tap "Import".
What I should see
A sheet titled "Import identity" with "Cancel" and "Import". See Import identity.
The field is headed "Recovery phrase or key file" and hints "12 words, or paste a .seedkey file".
The keyboard does not capitalise, correct or spell check what I type.
While I type, the line under the field counts, for example "7 of 12 words." in red.
A complete, correct phrase turns the line grey: "12 words, checksum OK." A 24 word phrase is accepted the same way.
Pasted key file text shows "Key file" in grey.
"Import" is enabled only when the line is grey.
After "Import" the button reads "Importing…", the sheet closes, and the identity is current at the top of Me.
The same sheet opens from "Import recovery phrase or key" on Vault and from "Import identity" in Edit profile.
When something goes wrong
A wrong word is named: "Word 2 is not a valid recovery word." or "Words at positions 2, 4 are not valid recovery words." I correct those words in place.
Words in the wrong order or a wrong last word give "Invalid recovery phrase checksum. The 12th word must match the checksum of the others." I check the paper and retype.
A name already in use gives "Name already exists, delete it first." I change the name and tap "Import" again.
A broken key file gives a reason that starts "Invalid key file:", for example "Invalid key file: not valid JSON." I paste the complete text again.
Not included
Key files protected by a password are refused with "Password-protected key exports are not supported yet." See Current limits and known gaps.
There is no file picker and no camera scan. A key file has to be pasted as text.
Identities from the earlier React Native app are not carried over automatically. See the same limits page.
Trace
Story US-ID-02, status Shipped. These links are kept in step with the traceability matrix and with the "User stories" section of every page listed here.
Design
Page | Part it plays |
|---|---|
The sheet with the one field for a phrase or a key file | |
Entry point and where the imported identity appears as current | |
Second entry point: Import recovery phrase or key | |
Third entry point when the key for a profile is missing | |
The row that shows the imported identity | |
The text area and name field with keyboard help switched off | |
Cancel and Import in the sheet bar | |
Live validation under the field, grey for good and red for bad | |
Lists this form with every status message | |
The prominent Import button and its disabled rule | |
Every status line of the import sheet | |
Why importing is a modal sheet | |
The error says which word is wrong | |
Wording of validation messages | |
The exact import strings |
Implementation
Page | Part it plays |
|---|---|
Orientation: the package that owns identities and servers | |
MeImportScreen and the import actions | |
meCheckImport and meImportIdentity, and the checkImport logic | |
Key file parsing, name rules and Keychain storage | |
Phrase validation and phrase to key derivation | |
Phrase and key file vectors shared with the other clients | |
meImportText (never persisted), meImportCheck and meImported | |
The import route and its modal presentation | |
meImported refreshes the identity list, then makes it current | |
Why phrase derivation yields during import | |
How an imported key is folded into the vault | |
Password-protected key files and React Native installs | |
The UI tests that import phrases and key files | |
Unit tests for the import check and storage |
Code
File | What |
|---|---|
MeImportScreen | |
pkg:me decl: meImportText, meImportName, meImportCheck, meImported | |
meOpenImport, meEditImport, meEditImportName, meImport, meAfterImport | |
view wiring for the import route | |
normalizeWords and checkImport | |
meImportIdentity | |
addFromMnemonic and keepIdentity | |
ENCRYPTEDSEEDKEYERROR and parseSeedKey | |
nameError | |
isMnemonicWord | |
keyPairFromMnemonicAsync |
Tests
File | What it checks |
|---|---|
me: an invalid phrase is refused with the reason | |
me: import a phrase, import a key file, switch, remove after asking | |
me: a duplicate name is refused | |
checkImport: empty, messy valid phrase, bad words, partial, checksum, key file | |
import normalizes key names before storing and checking uniqueness; reimporting the same identity and name is idempotent; concurrent mnemonic imports cannot reserve the same key name twice | |
.seedkey import round trip and errors | |
seedkey desktop JSON and mnemonic parity vectors |
Delivery
Delivered by #1470.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime