Merge pull request 't_2fb507c6: F8 rotate prekey (Node::rotate_prekey + invite re-encode)' (#101) from wt/t_2fb507c6 into main
Some checks failed
android-ci / android (push) Successful in 8m28s
ci / test (push) Has been cancelled
ci / sdk (push) Has been cancelled
ci / fuzz (push) Has been cancelled

Reviewed-on: #101
This commit is contained in:
sirius 2026-09-18 01:21:45 +00:00
commit 24b5c93c43
7 changed files with 177 additions and 2 deletions

View file

@ -32,7 +32,8 @@ Each install holds:
- **Identity** — ed25519 keypair. The 32-byte public key **is** the person.
Roster primary key. Displayed as 64 lowercase hex chars (the fingerprint).
- **Prekey** — x25519 keypair. This is the Noise IK *static*. It is long-lived
in v1. Rotating the onion (`F4`) does **not** rotate it.
in v1 — rotate it with `F8`, which hard-cuts every stored session. Rotating
the onion (`F4`) does **not** rotate it.
- **Onion** — Tor v3 address. Locator only. Disposable.
A friend is `{identity_pk, current_onion, current_prekey_pk}`. Pasting the same

View file

@ -16,6 +16,10 @@ A signed `loc` frame (`onion`, `ts`, `sig`) rewrites a friend’s locator **only
`F4` changes the locator only. The identity key is unchanged. Anyone who already has your pubkey can still prove they are talking to you, and a later invite paste with the same `k` updates their row. To become a new person, `/wipe-all` (new identity key). There is no in-band unfriend/revoke in v1.
## Rotating the prekey is a hard cut, and it is wider than F4
`F8` rotates the long-lived signed prekey. The identity key and the onion are unchanged, but the prekey is our Noise static **and** the seed of the bootstrap ratchet epoch, so once it moves nothing is reachable any more: a friend's dial uses the prekey they pinned from your invite, and their stored epoch is derived from the old one. There is no push path for a prekey — it only travels inside a signed invite — so every friend, online or offline, has to F3-paste the new invite before chat works in either direction again. F8 therefore also drops the local ratchet state for every friend, exactly as a peer's own prekey change does. Rotating the prekey shrinks the forward-secrecy window of the long-lived static; it is not a revocation (the old invite holder still learns nothing new, but they also cannot talk to you).
## Your store is encrypted
The sqlite store is SQLCipher (`rusqlite` feature `bundled-sqlcipher-vendored-openssl`).
@ -128,7 +132,9 @@ device.
- *No one-time prekeys.* The bootstrap epoch uses the long-lived signed prekey
only, so there is no per-session prekey consumption. A peer prekey change
drops the state locally and the next chat frame re-bootstraps; there is no
in-band reset and no key confirmation.
in-band reset and no key confirmation. The same is true of your **own**
prekey: `F8` rotates it, drops every stored state, and each friend has to
re-paste your invite, because a new prekey is never pushed.
- *A compromised endpoint is out of scope.* The ratchet state lives in the same
SQLCipher file as the chat log, under the same passphrase. Anyone who opens
the store holds the roots, both chain keys, the skipped keys and the plaintext