System Architecture
Federated, relay-based architecture functioning as a blind router. Intelligence and keys reside exclusively on the user's device.
Non-Negotiable Engineering Rules
Rule 1: Never Custom Crypto
Use Veil Engine (Signal Protocol Implementation). Use AES-256-GCM / ChaCha20-Poly1305. Never invent key derivation schemes.
Rule 2: Server Must Never Decrypt
No decryption code on server. Server sees only ciphertext, recipient_id, and timestamp. Zero knowledge.
Rule 3: Hardware Key Binding
Keys must live in Secure Enclave (iOS) or StrongBox (Android). App-level secure storage is insufficient.
Rule 4: Silent Push Only
Push payloads must contain NO content. Only a wake-up signal. App decrypts locally after waking.
01High-Level Overview
graph TD
ClientMobile["Mobile App
(React Native + Veil FFI)"] -->|TLS 1.3| LoadBalancer["Load Balancer"]
ClientWeb["Web App
(React + Veil WASM)"] -->|TLS 1.3| LoadBalancer
subgraph CloudInfrastructure ["Elixir/Phoenix Backend"]
LoadBalancer --> Phoenix["Phoenix Socket Hub
(Cowboy/Plug)"]
Phoenix --> Relay["Message Relay
(OTP GenServers)"]
Relay --> NATS["NATS JetStream
(Message Queue)"]
Relay --> Scylla["ScyllaDB
(Offline Inboxes)"]
Relay --> Redis["Redis
(Session Cache)"]
Relay --> Push["Push Gateway
(FCM/APNS - Silent)"]
end
classDef deviceNode fill:#171717,stroke:#38bdf8,stroke-width:2px,color:#fff;
classDef infraNode fill:#4c1d95,stroke:#8b5cf6,stroke-width:2px,color:#fff;
class ClientMobile,ClientWeb deviceNode
class LoadBalancer,Phoenix,Relay,NATS,Scylla,Redis,Push infraNode
Component Stack
Relay Backend (Elixir)
- • Framework: Phoenix (Erlang VM)
- • Concurrency: OTP GenServers per User
- • WebSocket: Phoenix Channels
- • Queue: NATS JetStream
Client Core (Rust)
- • Mobile: React Native + FFI
- • Web: React + WASM
- • Crypto: Veil Engine (In-House)
- • Keys: Secure Enclave (Mobile)