iOS app
Source-available. Owns the Curve25519 identity, the per-message symmetric keys, the encrypted local store, and the Safety Number verification workflow. Never talks to a server except the configured relay.
Architecture
Three layers, each with one job, and a clear protocol on each boundary. The relay is the only network-attackable surface; the iOS app is the only attackable surface at rest.
Source-available. Owns the Curve25519 identity, the per-message symmetric keys, the encrypted local store, and the Safety Number verification workflow. Never talks to a server except the configured relay.
Source-available. Stateless packet dropbox. Receives sealed,
signed envelopes; persists them for at most
MAX_TTL_SECONDS; delivers on request. Cannot
read the payload; cannot forge a sender.
File store (FileRelayStore) or in-memory
(InMemoryRelayStore). Production uses file.
State is opaque envelopes plus acknowledged tombstones; the
relay has no separate history.
The wire protocol is JSON over HTTPS. The relay accepts a versioned envelope:
{
"protocolVersion": 2,
"id": "uuid-v4",
"senderID": "64-hex peer id",
"recipientID": "64-hex peer id",
"sealedPayloadBase64": "base64 of AES-GCM ciphertext",
"signatureBase64": "base64 of Ed25519 signature",
"createdAt": "RFC 3339 with offset",
"expiresAt": "RFC 3339 with offset"
}
The sealedPayloadBase64 is the AES-GCM ciphertext
produced by the iOS app after:
The relay never has the recipient's private key, so it cannot decrypt the symmetric key, so it cannot decrypt the body. The relay only stores and forwards the opaque envelope.
An attacker with full control of the relay can:
MAX_TTL_SECONDS.An attacker with access to the device can:
The iOS app is the cryptographic root of trust. If a malicious build of the app is installed, it can exfiltrate the device's private key and the local message store. Pin the build to a known commit (see releases) and verify the SHA-256 after download.
The iOS app pins the relay's TLS certificate via standard system trust. A successful CA compromise or a misissued certificate is the only realistic DNS-spoofing vector. The signed-envelope guarantee is independent of the TLS transport: even a successful MITM cannot forge a sender.
For the canonical list of every endpoint, header, file, and distribution channel, see docs/CURRENT-ENDPOINTS.md.