feat(recovery): assisted recovery, no old email: one-time code + passkey or CoinPay (CLI 0.18.0) (#305)

Email recovery needs the recovery code from the enrollment email. People who
delete their mail lose it, and with it the only way back in.

`logicsrc vault recovery enable --assisted` (opt-in) replaces that code with a
fresh sign-in: recovery asks for the one-time code emailed at that moment and a
confirmation in the browser with a passkey of the account or its connected
CoinPay identity (bound by subject, never by email, never creating an account,
no session made).

- Server: U is kept sealed under VAULT_ESCROW_KEY in vault_recovery_assisted
  (migration 015) only for accounts that ask. A step-up
  (vault_recovery_stepups) is single use, lives ten minutes, names no account
  and is approved only by a proof belonging to the account being recovered.
  The second proof is checked before the one-time code, so a missing
  confirmation never spends it. A claim without a confirmed step-up never
  returns U. disable and a plain re-enroll delete the stored U.
- CLI: `passwd --email` and `vault recover --email` print the link, wait for
  the confirmation, then ask for the one-time code. The re-arm keeps the mode.
- This mode is custodial: the server holds everything that opens the vault.
  docs/opencreds/security.md says so; accounts that do not opt in keep the
  split-key scheme unchanged.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-12-02 22:17:56 -08:00 • committed by GitHub
parent 896eba3c07
commit 6ff3089088
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 799 additions and 62 deletions

View file

@ -58,6 +58,7 @@ why it is instant on a vault of any size.
logicsrc vault recovery status [--json] # enrolled? since? email (masked)? purchased?
logicsrc vault recovery buy # CoinPay checkout link ($5, lifetime)
logicsrc vault recovery enable # enroll; emails a recovery code to keep
logicsrc vault recovery enable --assisted # no old email needed: one-time code + passkey or CoinPay sign-in (custodial, see security.md)
logicsrc vault recovery disable # server deletes its escrow share and blob
logicsrc vault recover --email # recovery code + fresh one-time code, then a new password
logicsrc passwd --email # the same two codes, then ONE new password for the vault and the SSH keyring