As an identity holder, I want to export a key file for an identity and store it somewhere safe, so that I can restore the identity if I lose this phone.
Situation
I have an identity on this phone and I am not sure I still have its recovery words, or it came from my vault and I never saw them. I am on the Me tab and I have a safe place ready, such as a password manager.
What I do
Open the identity from Me.
Scroll to "Backup" and tap "Export key file".
Read the warning and tap "Reveal".
Tap "Copy", or "Share…" and choose my password manager.
Tap "Hide".
What I should see
Under "Backup" there is one row, "Export key file", and the note "The key file is your unencrypted private key. Anyone who has it can act as this identity." See Identity detail.
Tapping the row shows an alert titled "Reveal the private key?" with "The export is your unencrypted private key. Keep it somewhere safe and never share it with anyone you don’t trust." and the buttons "Reveal" and "Cancel".
After "Reveal", the key file appears in place of the row as a short block of text I can select, with "Copy", "Share…" and "Hide" under it.
"Copy" puts the text on the clipboard. "Share…" opens the system share sheet.
"Hide" removes the text and brings "Export key file" back.
The text is also hidden when I switch identity or remove this one.
The revealed text shows only on the screen of the identity it belongs to, never on another identity's screen.
Pasting the same text into Import identity restores the same identity.
When something goes wrong
If I tap the row by mistake, "Cancel" closes the alert and nothing is revealed.
If the identity was removed on another device in the meantime, the screen says "This identity is no longer on this device." I restore it with Import an identity I already have.
Not included
The export cannot be protected with a password. It is always the plain key. See Current limits and known gaps.
The recovery words cannot be shown again. A key file is the only backup the app can produce after creation.
No file is written to Files. I get text to copy or share.
Revealing asks for no passcode or Face ID, and "Copy" gives no confirmation.
If the export fails, no message is shown and the row simply stays. The share and copy rows have no automated interface test. See Contract UI tests.
Trace
Story US-ID-05, 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 Backup section, the reveal alert and the revealed key | |
Entry point: the current identity row | |
Where the key file is used again | |
The Reveal the private key? alert | |
Selectable monospace text for the key file | |
Export, Copy, Share… and Hide rows | |
The reveal confirmation in the alert inventory | |
Copy and Share… for the key file | |
Danger goes last and asks first | |
Exporting and key revealed states | |
The footer says plainly what a key file is | |
The exact warning wording | |
Monospace caption for the key file |
Implementation
Page | Part it plays |
|---|---|
Orientation: the package that owns identities | |
MeIdentityScreen and the export actions; the export shows only on its own screen | |
meExportKey: the only answer that carries a key | |
exportSeedKey and the key file format | |
The key file matches the desktop format byte for byte | |
meExported and meExportFor | |
The built-in copyText, share and showModal calls | |
No password protection for key files | |
The UI tests that reveal and hide the export | |
Unit tests for the export format and its safety checks |
Code
File | What |
|---|---|
Backup section: Export key file, revealed text, Copy, Share…, Hide | |
Reveal the private key? dialog | |
meExported and meExportFor | |
meExportText | |
meAskExport, meReveal, meHideExport, meCopyExport, meShareExport | |
meSwitch clears a revealed export | |
the export is passed only to the screen of its own identity | |
meExportKey | |
buildSeedKeyExport | |
exportSeedKey | |
A second key file codec, exercised only by tests |
Tests
File | What it checks |
|---|---|
me: identity detail exports the key file after asking, and removes | |
me: an exported key shows only on its own identity's screen | |
.seedkey: export format; import round trip and errors; exportSeedKey from the store | |
export never returns another account key from a mismatched record | |
seedkey desktop JSON parity |
Delivery
Delivered by #1470.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime