feat: a new profile from Landing is backed by a recovery code (recovery-code-v3, Phase 7)

recoveryCodeProfileWriter replaces seedProfileWriter, and
CreateProfileRoute.withWallet becomes withBackup. Nothing in the app
makes words from random bytes any more; wallet-audit fails on
MnemonicCode.toMnemonics outside RecoveryCodeKeys. A code, or its
exported words, restores the same npub and id on an empty device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5.5 committed 2026-11-25 23:27:29 +02:00
1 parent 5c6082d7d2
commit f367294cb1
7 files changed
+82 -41

No files matched your search

+8 -2
View File
@@ -5,7 +5,7 @@
# docs/scripts/wallet-audit.sh lists the lines that break a rule
# docs/scripts/wallet-audit.sh --check and exits 1 if there are any
#
# Giza keeps no wallet, and Bennu, which it takes fixes from, keeps several. Four rules
# Giza keeps no wallet, and Bennu, which it takes fixes from, keeps several. Five rules
# catch one coming back:
#
# 1. a retired kind's number (30331-30337, 30350-30366) in the app's own code. They
@@ -18,7 +18,10 @@
# transactions, Electrum. Named rather than every *Wallet*: the profile pickers under
# widgets/wallet/ and the SovereignWallet* startup kept Phoenix-era names, and the
# files that decline a wallet (WalletRefusal, RemoveWalletsMigration) are about one;
# 4. an amount in sats in a string a person reads.
# 4. an amount in sats in a string a person reads;
# 5. a phrase made from random bytes (`MnemonicCode.toMnemonics`) in the app's code. A new
# profile is backed by a recovery code (docs/recovery-code-v3.md), whose 24 words are
# made in RecoveryCodeKeys.kt and nowhere else. Phrases are restored, never made.
#
# Needs only bash and git, like the other two audits, so the CI budgets job can run it.
@@ -45,6 +48,8 @@ files=$(
sats=$(git grep -niE '>[^<]*\b(sats?|satoshis?)\b' -- composeApp/src/commonMain/composeResources)
phrases=$(git grep -nE 'MnemonicCode\.toMnemonics' -- "${MAIN[@]}" ':!*/identity/recoverycode/RecoveryCodeKeys.kt')
report() {
local title=$1 lines=$2 n=0
[[ -n "$lines" ]] && n=$(printf '%s\n' "$lines" | wc -l)
@@ -58,6 +63,7 @@ report "Retired wallet kinds in the app's code" "$kinds"
report "lightning-kmp imports" "$lightning"
report "Files named for a wallet's pieces" "$files"
report "Amounts in sats in the strings" "$sats"
report "Phrases made from random bytes" "$phrases"
if (( CHECK && total > 0 )); then
echo "Giza keeps no wallet. See docs/giza-wallet-removal.md before bringing one back." >&2