core: wallet review fixes, and show the derived addresses

Concurrency: the account index is incremented in SQL and read back in the
same transaction, so two profiles cannot be handed the same key. Importing
a phrase is one transaction and single_seed is UNIQUE, so a phrase cannot
be discarded in favour of a key created meanwhile, and a device cannot end
up with two keys.

Wallet commands are no longer forwarded to a remote host: the recovery
phrase must not leave the device, and the raw command is logged there.

/wallet delete removes the key, confirmed by the last word of the phrase,
so creating a key before importing your own is no longer a dead end.

/wallet now shows every profile on the key with the first two name
addresses each, to check derivation against other wallets. Hidden profiles
are left out, as they are by /users. A bad phrase no longer says which word
was wrong. /wallet export uses the profile's own key.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
This commit is contained in:
Alain BrenzikoferandClaude Opus 5 committed 2026-09-09 09:05:47 +00:00
1 parent 257cdc02c8
commit ee11b368b6
13 files changed
+232 -152

No files matched your search

+15 -11
View File
@@ -223,20 +223,24 @@ walletHelpInfo :: [StyledString]
walletHelpInfo =
map
styleMarkdown
[ green "Your wallet key:",
indent <> highlight "/wallet " <> " - the address that would own the next name you buy",
indent <> highlight "/wallet create " <> " - create the key, and this profile's account under it",
indent <> highlight "/wallet import " <> " <phrase> - use a key you already have",
indent <> highlight "/wallet export " <> " - the recovery phrase, to write down",
[ green "Wallet commands:",
indent <> highlight "/wallet " <> " - your key, and the addresses it derives",
indent <> highlight "/wallet create " <> " - create your key, or add this profile to it",
indent <> highlight "/wallet import <phrase>" <> " - use a key you already have",
indent <> highlight "/wallet export " <> " - show your recovery phrase",
indent <> highlight "/wallet delete <word> " <> " - delete the key, confirmed by the last word of the phrase",
"",
"One key per device, and one account per chat profile under it. A name gets",
"its own key at " <> highlight "m/44'/60'/<profile>'/0/<name>" <> ". That is ordinary BIP-44,",
"so importing the phrase into another wallet reaches the same addresses.",
"Please note: this is in development. You cannot buy a name yet.",
"",
"Anyone who knows a recovery phrase controls the names it owns. The risk is",
"theft, not loss.",
"One key per device, one account per chat profile. Each name gets its own",
"key at " <> highlight "m/44'/60'/<profile>'/0/<name>" <> ". This is standard BIP-44, so your",
"phrase works in other wallets.",
"",
"Please note: this is in development. Nothing can be bought or signed yet."
"The key is stored in the chat database. It is only encrypted if you set a",
"database passphrase with " <> highlight "/db encrypt" <> ", and it is included in " <> highlight "/db export" <> ".",
"",
"Anyone who has your recovery phrase controls your names. Keep it secret,",
"and keep a copy."
]
incognitoHelpInfo :: [StyledString]