46caa4d795
CRITICAL: Move NWC wallet secret from plaintext nwc_connection.txt to OS keychain. The NWC secret is a private key that can authorize Lightning payments — storing it in plaintext allowed any process to steal funds. Security fixes: - NWC secret stored in OS keychain as "nwc_<npub>" (per-account) - accounts.json.enc is now the sole source of truth for cold boot - Eliminate bunker_uri.txt, last_account.txt, nwc_connection.txt - Legacy files deleted on first startup (one-time cleanup) - logout(deleteKey=true) now removes account from accounts.json.enc - Corrupted accounts.json.enc backed up as .corrupt.<timestamp> Cold boot rewrite: - loadSavedAccount() routes by SignerType from accounts.json.enc - No longer reads stale bunker_uri.txt (fixes nsec→bunker confusion) - No longer reads last_account.txt (uses activeNpub from metadata) Multi-account improvements: - NWC connections are per-account (switch account = switch wallet) - Each account type (Internal/Remote/ViewOnly) loads correctly - saveBunkerAccount() no longer writes to bunker_uri.txt Updated 8 existing test files to use accountStorage instead of writing legacy files directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>