feat: show wallet's recovery phrase (requires password) #161
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
README.md:880lists "Show wallet's recovery phrase (requires password)" as anopen TODO, and it is genuinely missing. Grepping the callers of
decryptWithPasswordfindsdeleteWallet.js:52,confirmTx.js:305,addressDetail.js:338,background/index.js:745,background/index.js:804—none of them display the phrase.
This is a core wallet function. A user who created a wallet in AutistMask and
did not write the phrase down has no way to retrieve it, which means the
wallet's own docs (
docs/README.md: "With your recovery phrase, you canrestore your wallet in AutistMask or any other compatible wallet at any time")
are not achievable from within the product.
Existing precedent to follow
Per-address private key export already exists and is the right model to
copy: logic at
src/popup/views/addressDetail.js:297-374, markup atsrc/popup/index.html:352-405, view idexport-privkeyregistered atsrc/popup/views/helpers.js:33, reachable from the AddressDetail "more"dropdown (
addressDetail.js:281-296, markupindex.html:320-340). It ispassword-gated and derives via
getSignerForAddress(...).privateKey.Mirror its structure, its password gate, and its warning treatment.
Implementation requirements
(
type: "privkey") have no phrase; the action must not appear for them. Notea third type exists,
type: "xprv"(addWallet.js:242) — it also has norecovery phrase, so it must be excluded too. Decide and state where the entry
point lives; the wallet row in Settings is the natural place since that is
where per-wallet actions (rename, delete) already are.
decryptWithPassword, exactly asdeleteWallet.js:52andaddressDetail.js:338do. A wrong password mustproduce a full-sentence error and reveal nothing.
accepted. Do not render it into the DOM before it is unlocked.
Policy. Follow the monochrome, text-first, no-images style; use the same
warning-box treatment the AddWallet backup warning uses.
anyone with these words can take the funds.
does not persist in the nav stack, is not written to state, and cannot be
restored by
RESTORABLE_VIEWS(src/popup/index.js:104-115) — a secretscreen must never be what the popup reopens onto.
src/shared/log.jsoutput.helpers.jsand wire the nav stack so "Back"behaves correctly.
ExportPrivKey and SettingsAddToken are all currently missing from that map;
adding those is tracked in the docs issue, so here just add your own screen.
Definition of done
wallets do not.
shows a full-sentence error and reveals nothing.
this screen.
transitions, in the established format.
README.md:880is ticked.TODO.mdupdated in the same commit.make checkpasses.