This is for someone reading src/chelonia/auth.js. The README explains what
happens without any of this; start there if you have not.
Two more key names appear here, next to the three from sharing.md. Both are derived from the password and neither is ever stored:
| name | what it does |
|---|---|
ipk |
signs the message that creates the account |
iek |
encrypts the account's other secrets inside the contract, so logging in on a new machine can open them |
- Register a salt against
/zkpp/register/:username. The server gets a blinded hash, never the password, and returns a salt plus a one-time token. - Derive
ipkandiekfrom the password and that salt. - Generate the everyday keys,
csk,cekand#sak. Their secret halves go into the contract encrypted to theiek. chelonia/out/registerContract, signed by theipk, with the username in theshelter-namespace-registrationheader and the token inshelter-salt-registration-token.- Keep
csk,cekand#sak. Discardipkandiek. - Create the account's first list. See sharing.md.
GET /name/:usernamegives the contract ID.- Prove the password against
/zkpp/:contractID/auth_hashand/contract_hash, which returns the same salt as at signup. - Derive the
iekand hand it to Chelonia as a transient key. chelonia/contract/retain. Syncing the contract decryptscsk,cekand#sakwith theiekand stores them. That is the whole recovery.- Discard the
iek. - Load the
listsslot and open each list in it.
A wrong password comes back from the server as a 500, not as a clean failure, so the app tells a bad password apart from a connection problem by whether the server answered at all.
None of the above. The secrets and the contract state are already in the saved blob, so it only re-syncs.