Paul HittandClaude Opus 5 cda64d8c2e A contact who reinstalled could never be messaged again
🔴 **The chat header said "keys unchanged since you met" while every send was
refused with "identity keys changed".** Found by driving two real apps: the
iOS side relaunched with -FNMSGResetState, which is a genuinely new device with
new keys, and Android correctly refused to send to it. Correct — and then
there was no way out.

`Trust.state()` could return UNKNOWN, VERIFIED or PINNED and nothing else.
CHANGED was computed inside `record()` while a send was in flight and thrown
away, because `Vault.Trust` had nowhere to remember it. So:

- the header kept reporting the OLD pinned keys as unchanged,
- the "Accept new keys" button, which only renders for CHANGED, never appeared,
- `acceptIdentityChange()` was unreachable from the UI,
- and the contact stayed unmessageable for ever, with the app insisting
  nothing was wrong.

That is precisely what a tester does on day one: reinstall, and discover their
friend can no longer reach them.

`Vault.Trust` now carries `changed`, `record()` persists the detection without
adopting the offered keys and drops the verified tick (whatever was compared in
person was compared against the old key), `state()` reports it, and accepting
clears it. Keys that match again also clear it, so a transient wrong answer
does not strand somebody behind a banner for ever.

Verified live on the emulator: the banner appears with its full text, Accept
new keys is reachable, and the header returns to "keys unchanged" afterwards.
Four tests in TrustTest; three of them fail against the old `state()`.

---

🔴 **An expired session told the user their passphrase was wrong.** Hit
immediately afterwards: a send failed with "That handle or passphrase isn't
right", ten hours after a successful sign-in, because AccountsClient mapped
EVERY 401 and 403 to BadCredentials. The natural reading is that the password
stopped working or was changed by someone else, and the natural response is to
change a password that was never wrong.

Only `sessions` and `accounts` actually present a passphrase, so only those can
report one as wrong. Everything else now raises SessionExpired, which the app
states as what it is. Two tests cover both directions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 07:09:08 -04:00

Flamenet Messenger — Android

Nothing here is an app yet. This is the engine, and it is deliberately first.

An Android client needs the protocol implemented a third time. That third implementation is the one that finds the places where the specification says less than the two existing engines quietly agreed on — but only if it is written against the spec and the published vectors rather than against a reading of our own Swift and JavaScript. So the engine comes first, it is a plain Kotlin/JVM library with no Android in it at all, and it is held to engine/test/vectors/protocol-v1.json — the same file the other two engines are checked against, read from that one location rather than copied here.

./gradlew :engine:test

No Android SDK, no emulator, no device. It runs anywhere a JVM does, which is also what lets it run in CI on Linux.

What the engine covers today

Area Spec State
Safety numbers §7 Done — fingerprints and conversation ordering match the published vectors
Key transparency verification §19 Done — RFC 6962 leaf/node hashing, unbalanced split, bottom-up audit paths
Byte helpers — Unsigned comparison, constant-time equality

What it does not cover

Listed rather than left to be discovered, because a table of green ticks with the hard parts quietly missing is worse than no table:

Area Spec State
X25519 / Ed25519 §3 Not started — needs a provider that works on both JVM and Android
X3DH key agreement §4 Not started
Double Ratchet §6 Not started
Sealed sender §12 Not started
ML-KEM-768 hybrid §11 Not started
ML-DSA-65 identities §20 Not started
Relay client §8 Not started
The app itself — Not started

Until those exist, Android is honestly marked "not started" on the website, and a conversation gets the protocol's guarantees only when both ends are iOS.

Why the vectors matter more than the code

Two implementations that agree may both be wrong in the same way, especially when one was written while reading the other. The audit-path ordering in §19 is the worked example: a top-down reading of a bottom-up path produces the correct root for every left-spine index, so it passes any test that only checks index 0. The vector file pins a right-descending index for that reason, and the Kotlin tests assert both that the published path verifies and that the same path reversed does not.

If this engine ever disagrees with the file, the interesting question is which of the three is wrong — not this one by default.

S
Description
Flamenet Messenger for Android — the Kotlin engine, held to the published protocol vectors. No app yet. MIT.
Readme MIT
22 MiB
Languages
Kotlin 99.3%
Shell 0.6%
Python 0.1%