Rust · Tauri · 100% Tor · E2EE

Tornel

A serverless, end-to-end encrypted messenger for desktop and Android — every instance hosts its own Tor v3 onion service, so peers meet over a 6-hop circuit and neither side learns the other's IP.

Role
Architect & sole developer
Stack
Rust · Tauri v2 · Arti · SQLCipher
Status
Verified end-to-end · not audited
Platform
Windows · macOS · Linux · Android
Tornel desktop 2-pane chat workspace
The desktop chat workspace — a 2-pane layout with the conversation list and the active thread.
Tornel Android responsive single-pane chat layout
The same codebase on Android — a responsive single-pane layout.
0 servers, phone numbers, or IP addresses
6-hop Tor circuit, rendezvous point
90-day crypto-shredding retention
RFC 9420 MLS group ratcheting
Tornel group chat with the Members & Roles drawer
Group chat with the Members & Roles drawer — Owner, Admin, Moderator, Member.
Tornel Identity & Keys screen with contact code, fingerprint, and escrow
Identity & Keys — contact code, fingerprint, and optional user-held escrow.

The core principle

Tornel is a serverless, end-to-end encrypted messenger for desktop and Android, written in Rust with Tauri v2. There is no account server, no push relay, no message broker — nothing to subpoena, breach, or log.

Every running instance hosts its own Tor v3 onion service (via embedded Arti), and peers meet at a rendezvous point over a 6-hop circuit: neither side ever learns the other's IP address. Your identity is a locally generated Ed25519 + X25519 keypair encoded into a self-checksummed Bech32m contact code (anon1…) — no phone number, no email, no username.

Messages are authenticated end-to-end (X25519 + Ed25519 for 1-on-1, RFC 9420 MLS for groups), images are stripped of EXIF/GPS and rebuilt before they ever leave the device, and everything is stored locally in SQLCipher behind a passphrase you hold, with an automatic 90-day retention policy.

How it works

You hold the keys — the app starts locked

On first launch you choose a passphrase. It derives the SQLCipher database key via Argon2id (64 MiB, 3 passes) and is never stored on disk. Your identity seed lives in the OS keychain (Windows Credential Manager / macOS Keychain / Linux Secret Service). Forget the passphrase and the history is unreadable; that is what makes it protection rather than a formality.

Tornel unlock screen asking for the passphrase
Every launch asks for your passphrase — nothing machine-held remains.
Tornel personas screen
Optional personas: separate processes, vaults, and Tor state.

Your identity is a contact code, not a phone number

The app generates an Ed25519 signing keypair + X25519 agreement keypair from OS entropy and encodes them into a Bech32m contact code with a BLAKE3 checksum. Display names are local labels only. Peers exchange signed invites (tornel1:…) that bind the identity, onion address, and discovery key with an Ed25519 signature.

Tornel adding a peer from a signed invite
Adding a peer from a signed invite — the signature prevents alteration.

Messages travel over Tor rendezvous — both ways

Every instance hosts its own Tor v3 hidden service through embedded Arti (isolated from any Tor Browser install). When you send, your client connects out through Tor to the peer's onion service; the two circuits meet at a rendezvous point, and neither peer learns the other's IP. Frames are padded into fixed size buckets (512 B → 512 KiB), AEAD-encrypted, and signed.

Groups ratchet with MLS, and removal requires consent

Group messages use RFC 9420 MLS (openmls): every membership change advances the epoch and derives fresh tree secrets, so a removed member is cryptographically locked out of future messages. Sensitive rotations — like removing a member — open a nonce-bound, Ed25519-signed consent modal before taking effect; ignoring it fails closed.

The security model

Risk / attack vectorHow Tornel mitigates it
Central server compromise, subpoena, or metadata loggingZero central servers — no user registry, no account server, no push relay, no message broker
Clearnet IP leakage / accidental fallbackStructural fail-closed transport gate — refuses to transmit unless the transport is TorOnion and Ready with a published v3 onion service; builds without Tor fail closed
Exposing your IP to a chat peerBidirectional Tor v3 onion rendezvous over a 6-hop circuit — neither peer ever learns the other's IP
Phone number, email, or username correlationSelf-sovereign cryptographic identity — a locally generated Ed25519 + X25519 keypair in a Bech32m contact code
Disk forensics & stolen data backupsUser-held passphrase + OS keychain — the SQLCipher key is derived via Argon2id and never stored on disk
Historical data retentionAutomatic 90-day TTL enforcement across every content table, with monthly bucket retirement
Compromised or removed group member reading future messagesRFC 9420 MLS ratcheting + human-in-the-loop consent — removal locks the member out of future messages
Embedded attachment metadata and original filenamesMandatory fail-closed sanitization — every image is decoded, stripped of EXIF/GPS/XMP, rebuilt, and renamed before sending
Honest about the limits

This software has not yet undergone a formal third-party cryptographic or network-anonymity audit. Tor is a low-latency anonymity network, so a global passive adversary can still correlate timing and volume. Direct messages have no forward secrecy yet, and forensic key erasure is not implemented — retiring a bucket label does not destroy the derivation secret.

The three guarantees

1. No clearnet fallback — enforced, not documented

There is no mode that degrades to direct TCP/IP. AnonymityTransport::send refuses unless the class is TorOnion; sending over a local route is a hard error; and a build with no Tor backend gets OfflineTransport, which fails closed. An automated CI scan (check-no-clearnet.ps1) forbids direct sockets outside the Arti wrapper.

2. 90-day retention — enforced, not asserted

Two bugs in the original design were found and fixed before implementation: the purge query was silently a no-op (string comparison on a text timestamp), and VACUUM is not a physical erase. All times are now integer epoch seconds, every row carries a precomputed absolute expires_at, tables are STRICT, and message ciphertext uses a per-month derived data key. A test fails if a new content table is added without an expires_at column.

3. Consent is a security control, not a notification

A denied or expired rotation leaves an explicit rotation_stale state and turns into a hard error — ignoring the prompt never silently continues. The frontend can only decide a proposal the backend already issued, the proposal is Ed25519-signed over exactly the fields the user sees, and every decision is logged with its proposal id.

Engineering choices

The workspace is split into focused crates, each behind its own trait boundary so either can be replaced without touching the wire format: anon-core (identity, contact codes, escrow), anon-storage (SQLCipher, STRICT schema, 90-day purge), anon-transport (the fail-closed gate, Arti client + onion service), anon-mls (RFC 9420 ratcheting), anon-messaging (wire format, padding, replay protection), anon-consent (rotation proposals), anon-ipc (the Rust↔webview boundary), and anon-app (the Tauri shell).

Arti is pre-1.0 and onion-service hosting is its least mature surface, so every Arti call stays behind AnonymityTransport. The dependency graph is pinned deliberately — rusqlite at 0.37 is the intersection of what arti-client and openmls_sqlite_storage both accept.

Why the Windows build lagged and crashed

Windows was the only platform where the app felt sluggish and occasionally died. Three separate causes, all fixed: every command ran on the UI thread (now #[tauri::command(async)]), the refresh loops overlapped and never paused (now they skip a tick when the previous one has not finished), and the UI rebuilt itself on every tick (now it compares a cheap signature and returns early).

Status

Embedded Arti bootstrap, v3 onion-service descriptor publication, and authenticated two-peer 1-on-1 and MLS group message/attachment delivery over Tor rendezvous have been verified end-to-end, both standalone and alongside an active Tor Browser daemon. The app builds for Windows, macOS, Linux, and Android, with signed APKs from CI.

Not yet implemented: immediate discovery revocation and per-contact identities, and automated background polling of peer-hosted offline mailboxes. The mailbox storage and quota engines are implemented and tested, but live chat delivery currently targets online peers directly over Tor rendezvous.

Related projects