feat(base): the changes of SimpleLogin accounts' keys, each with the password and a fresh sign-in (ADR 0020, D20)

Every change takes the password's proof by its own proof key (the
recovery phrase's for a lost password) and a SimpleLogin sign-in of the
last ten minutes on the device (`KeysOwnerProof`, its attempt), as ADR
0017's take the password and a code. The sign-in is checked before the
proof and taken with the change, so a wrong proof leaves it standing and
each sign-in serves one change.

- `keys.set(attempt, setup, handle?)`: the first keys of an account that
  SimpleLogin was added to (anonymous before, or signing in with GitHub
  or a code), with the handle where it has none; the sign-in alone, as
  there is no password to prove yet.
- `keys.changePassword`, `keys.beginPhrase` and `keys.resetPassword` (a
  lost password, with the phrase): every other session ends, in every
  service, as ADR 0017's change has it.
- `keys.setRecoveryKeys`: a new phrase.
- `account.delete(keysProof)`: an account without SRP's verifier deletes
  itself with the proof and the sign-in; `requireOwnerToDelete` no longer
  asks such an account for SRP.
- `newKeysPasswordDigest` on both sides, held to each other by a test; a
  challenge purpose of its own for the phrase's proof while signed in.
- Members ask the register for all of it; `RemoteRegister` and the
  instance API carry the five new operations and the deletion's proof.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-23 22:11:49 +02:00
commit 7c58d23424
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -38,8 +38,13 @@
a migration that drops nothing); `simpleLogin.signUp` in one call (D18) and
`simpleLogin.checkHandle`, both for someone new's identity alone; `keys.begin` and
`keys.unlock`, the proof counted as ADR 0017's; every sign-in into an account kept ten
minutes under its attempt as D20's confirmation. The changes (first keys, a new or
lost password, a new phrase, the deletion) and the mending come next.
minutes under its attempt as D20's confirmation. Then the changes, each through the
register: the first keys (and handle, where none) of an account SimpleLogin was added
to (`keys.set`), with the sign-in alone, as there is no password to prove yet; a new
password, a lost one with the phrase (`keys.beginPhrase`, `keys.resetPassword`), a new
phrase and the deletion (`account.delete`'s `keysProof`), each with the proof and the
sign-in, which the change takes: one change for each sign-in. A new or lost password
ends every other session, as ADR 0017's change does. The mending comes next.
- **Builds on:** ADR 0010 (email sign-in), ADR 0011 (profile pages), ADR 0016 (the
register), ADR 0017 (a password, TOTP and the keys).
- **Changes:** ADR 0017's way in on an instance that offers SimpleLogin (its keys, their