Skip to content

Personal Messaging App: A WhatsApp Replacement Whose Server Cannot Read It

My messenger is my replacement for WhatsApp. It carries text, voice calls and video calls for me and my family, it runs on hardware I control, and its server relays ciphertext it cannot read.

I built it to take back my freedom, privacy and security. I don't trust big tech with my family's conversations.

It is built for a handful of people who know each other, not as a social network. There is a web app in TypeScript that also installs on the desktop, an iPhone app in SwiftUI, an Android app in Kotlin and Compose, and one Rust server. The first commit is from April 2026, when it ran on Cloudflare Workers and D1. In June I moved it onto a k3s box at home.

What it does

  • Conversations between two people and groups of up to eight, with photos, files, voice notes and video notes.
  • Voice and video calls between two people.
  • A disappearing timer per conversation, enforced by the server, and view-once photos.
  • Sign-up only through a member's one-use invitation. The account is a key, and twelve recovery words are the only way back without a device.

The encryption

Each person has an Ed25519 identity key and an X25519 key for key agreement, signed by the identity key. Two people start with an X3DH handshake, then the Double Ratchet gives every message its own key. Sessions run per pair of devices, so the server holds one sealed copy of a message per device, and deletes it 7 days after that device fetched it. Each device keeps its own history, sealed at rest.

Groups use sender keys: an HMAC-SHA256 ladder, AES-256-GCM, and key hand-outs signed with Ed25519. Typing, receipts, reactions and call signals use a pair key between two accounts. Photos, voice notes and files are encrypted with AES-GCM on the device, and photos lose their location and camera data first.

The primitives come from the platform: WebCrypto, CryptoKit, and the Android Keystore and JCA. The ratchet is written once in shared TypeScript, and the Swift and Kotlin versions match it byte for byte against pinned test vectors.

Each client pins a person's keys the first time it sees them. If the server ever serves a different identity key, the app covers that conversation and sends nothing until the keys are compared again out of band. The server cannot see that alarm or lift it.

How calls work

Calls do not use WebRTC. All three clients speak one small protocol, and its signals (offer, ringing, answer, end) go over the server's WebSocket, sealed with the pair key. Audio is Opus and video is H.264. Every frame is sealed with AES-256-GCM under keys both sides derive from their pair key and the call ID. The call sheet shows six words from the same secret: if both people read the same six, nobody is in the middle.

Frames take one of three roads, best first: straight between the two phones over UDP, through a UDP relay on my box, or through the server's WebSocket. A browser always takes the WebSocket. The phones ask only my server for their public address, from a STUN responder built into the Rust binary. There is no TURN server: I deployed coturn once, nothing used it, and in September it was holding the port my relay needed, so I removed it.

Running it at home

Everything runs under k3s on one box, in well under 400 MB of memory:

  • the API: Rust with Axum and Tokio, SQLite, and media files on disk
  • nginx, serving the web app and proxying /api
  • Redis, for sessions, rate limits and WebSocket fan-out
  • a UDP pod on the host network for STUN and the call relay
  • ntfy, self-hosted, to wake the Android phones
  • a nightly backup job, and a watchdog that checks the API, backups and disk every five minutes

A Cloudflare Tunnel publishes it, so Cloudflare, a third party, ends TLS and sees the same metadata my server does.

A deploy is one script on the box. It pulls main, builds the images with the commit hash inside, takes a backup, rolls out, and reports success only when /api/health answers with that hash. Backups are sealed with age to a key that is not on the box, and the nightly copy off the box counts only if the newest backup opens.

Android wakes through my ntfy. The iPhones are signed with a free Apple developer team, which has no push entitlement, so iOS lets the app check in only when Background Refresh allows. An opt-in setting goes round that: my ntfy forwards a poll request, only a topic ID and a time, to ntfy.sh, a third party, so Apple wakes the ntfy app on the iPhone. A closed browser tab can opt in to its browser's push service, also a third party.

How it is tested and shipped

The clients must agree byte for byte, so the contract lives in one shared folder: 18 files of pinned vectors for call seals, identity checks, sign-in, recovery and group keys, read by the web, iOS and Android tests. Guard tests read the other platforms' sources, so drift fails the build. One reads every call source and fails on a STUN server that is not mine.

At 0.2.19 there are about 370 Rust tests, 227 web unit-test files, 19 Playwright specs, 197 Android unit-test files and 234 iOS test files. A Forgejo Actions workflow for my self-hosted Forgejo defines five jobs: clippy and cargo test; the web typecheck, tests and build; the Android tests and APK build; the iOS suites, which need a Mac runner; and dependency audits.

There is no app store. Android installs an APK. A free team's iPhone signature lasts seven days, so a LaunchAgent on my Mac rebuilds, re-signs and reinstalls the app when it expires.

Limits I would rather state plainly

  • Metadata is visible. The server and Cloudflare see who talks to whom, when, message sizes, IP addresses, and that a call was offered and answered. Encryption protects content, not the shape of the traffic.
  • Calls were not always sealed. Until 0.2.9 in September, frames on the WebSocket road travelled inside TLS only, so the server and Cloudflare could have heard them. Both roads are sealed now.
  • My home line is behind carrier-grade NAT. Over IPv4 nobody outside can reach my relay, so a phone on an IPv4-only network falls back to the WebSocket.
  • There is no reset. Lose every device and the twelve words, and the account is gone.
  • There are no group calls. The browser mesh for them failed its own three-way Playwright test, so I removed it.