Export quantus-cli wallet files #8
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?
The counterpart to #7. Filed because the assumption that blocked it turns out to be false.
The question
No — we can. The CLI's own format has a null-mnemonic variant, it produces those itself, and it accepts one written by something else.
Evidence
The CLI writes
"mnemonic": nullfor raw-seed wallets.crystal_alice, created byquantus developer create-test-wallets, has exactly that alongside"derivation_path": "m/"— and is a fully functional CLI wallet.So a wallet with no mnemonic is not a degraded artifact the CLI tolerates; it is one of its normal shapes.
Confirmed empirically rather than inferred. A CLI-format wallet was constructed from key material alone —
mnemonic: null, Argon2id + AES-256-GCM, container version 2 — dropped into~/.quantus/wallets/, and:quantus wallet listlisted it, with the right address, scheme and human checkphrasequantus wallet viewshowed itquantus wallet export --format mnemonicfailed with "Mnemonic phrase is not available for this wallet"That last one is the proof. Reaching that error requires the CLI to have derived the Argon2 key, opened the AES-GCM box, parsed the payload JSON and inspected a field inside it. It is a correct answer about our file, not a rejection of it.
As a positive control, the same wallet written with the dev phrase in it round-tripped:
export --format mnemonicreturned the phrase verbatim. Both probes were removed afterwards.What a null-mnemonic export costs the user
Nothing about spending. It costs exactly one thing:
quantus wallet export --format mnemonicon that wallet will say the phrase is unavailable, and the CLI cannot derive further accounts from it.That is the honest consequence of the extension not storing a phrase it was shown once — and it is the same position a user is in with a raw-seed CLI wallet today.
Why do it
#7 lets a user bring a CLI wallet in. Without this, that is a one-way door, and the extension's own backup is readable only by polkadot-js-format tooling (quantus/extension#8). Export closes the loop and removes the "your backup only works in the thing that made it" problem.
Scope
{ name, keypair: { public_key, private_key, scheme }, mnemonic: null, derivation_path, metadata }argon2_paramsas a PHC string so a future CLI reads them rather than assumes oursencryption_version: 2, emptykyber_*addressin the outer container, from the account idderivation_pathwhere known;"m/"for a raw-seed account, matching what the CLI writesMark it in
metadataas exported by the extension. A CLI maintainer looking at a bug report should be able to tell where the file came from.Acceptance
quantus wallet listwith the correct address and schemequantus wallet viewshows itexport --format mnemonicsays the phrase is unavailable, rather than failing obscurely