hrth / how it works · draft · November 9, 2026

A decentralized social network, on servers that can’t read it.

groups
MLS · RFC 9420 · OpenMLS
suite
X25519 · AES-128-GCM · SHA-256 · Ed25519
files
AES-256-GCM · 1 MiB chunks · a key per file
device keys
Ed25519 · never leave the device
servers
Ed25519-signed HTTP · valid 5 minutes
calls
LiveKit · frames encrypted with a key from the MLS group
reports
message franking · HMAC commitments
server
Rust · axum · SQLite
clients
Vue · Rust core compiled to WASM

Abstract

hrth is chat, calls and shared spaces for groups of people who know each other. Instead of one service everyone joins, people run small servers of their own, each hosting as many spaces as they like, and the servers federate: someone on one server can share a space, a DM or a call with someone on another, and no server sits in the middle of everyone.

That only works if running a server is cheap, safe and boring, and if a server can be trusted with as little as possible. So in hrth a server delivers, orders and enforces, but it can’t read. Every conversation is an MLS group whose keys exist only on its members’ devices. The server holds encrypted messages until each device has fetched them, then deletes them. What it can’t avoid seeing, metadata, we say plainly below.

§1 Principles

  1. 01Decentralized. Anyone can run a server, for as many spaces as they like, or use a friend’s. Servers link up as peers, and no server, ours included, is one everyone depends on.
  2. 02The server can’t read it. Messages, attachments, calls, party activity, and the names of spaces and channels are end-to-end encrypted. A server sees metadata, not content.
  3. 03The server is a delivery queue. Messages and files live on people’s devices. A server holds them only until every device has them, 30 days at most.
  4. 04Small enough to run yourself. One Rust program and a SQLite file, happy on a cheap VPS or a computer at home. Built for groups of friends (2 to 200 people), not public audiences.
  5. 05Yours to leave. Export everything, move your account to another server, or start your own.
  6. 06No invented cryptography. MLS (RFC 9420) through OpenMLS, AES-GCM, Ed25519, HKDF and SHA-256.

Not goals: compatibility with Matrix, Signal or Discord, or hiding from a server who talks to whom.

§2 Servers and federation

A person is name@domain, tied to the server they joined, like an email address. Their apps talk only to that server, their home server. Everything else in hrth lives somewhere too: each space and each conversation lives on the server where it was created, which is its host.

 alice's phone                       bob's laptop
      │ HTTPS + WebSocket                  │
      ▼                                    ▼
 ┌──────────────────┐   signed    ┌──────────────────┐
 │ friends.example  │────────────►│  band.example    │
 │ alice's home     │◄────────────│  hosts /the-band │
 └──────────────────┘   request   │  orders its log  │
                                  └──────────────────┘
alice posts in a space hosted on bob’s server

The host orders its conversations’ logs. A conversation has one append-only log, and the host accepts an MLS commit only at the current epoch, so a log never forks and there is no state for servers to reconcile. This is the main way hrth differs from designs like Matrix: there’s no replicated room state and no resolution algorithm. The cost: while its host is down, a conversation can be read from your devices but takes no new messages.

When you act on something hosted elsewhere, your app asks your home server, which forwards the request to the host. Requests between servers are signed with the sending server’s Ed25519 key over the method, path, date, acting device and body, and are valid for five minutes. A server can only act for its own people, and it sends requests only to public DNS names. With federation on, a server talks to any public hrth server. Depending on what it’s for, an admin can block particular servers, limit theirs to a list, or keep it to itself, as a business or a private group might.

A server is also careful about what it accepts from others. It lists a space or DM from another server only if its person joined or accepted it, won’t let another server claim a conversation that’s hosted here or known to be elsewhere, and stores MLS Welcomes only from servers its person has something on.

When another server doesn’t answer within five seconds, sync says which conversations and spaces it couldn’t ask about, and the apps keep them, marked as unreachable and readable from the device, rather than treating silence as being removed. The apps open from what’s on the device before any server answers; with your own server down they stay signed in and read-only until it’s back.

Federation is on by default. An admin who wants a server kept to itself sets HRTH_FEDERATION=false. Its remaining gaps are in §9.

§3 Identity and devices

There are no passwords. A device is an Ed25519 key pair that never leaves it. It’s the device’s MLS credential, and it signs in by answering a challenge. Each person has as many devices as they like, and each is a separate member of every MLS group they’re in.

  • linkAn existing device makes a single-use link (or QR code) that lasts ten minutes. The new device joins every conversation by itself, and can receive a one-off transfer of history and kept files, encrypted with a key that travels only in the link’s fragment, which browsers never send to a server.
  • recoverA 160-bit recovery code, stored on the server only as a hash, registers a fresh device that rejoins everything. The code also derives a key the server never sees, which seals a backup of your spaces’ keys, so their names come back even with nobody else online. Old messages come back only from an export or another device.
  • removeRemoving a device leaves a record on the server. The removed device proves who it is, is told, and erases itself.
  • readWhat you’ve read syncs between your devices inside your account’s own private MLS group, so the server can’t see how far you’ve read.

§4 Encryption and delivery

Every channel and DM is one MLS group. The server decides who may be in it, MLS decides who can decrypt it, and the clients reconcile the two. Members read from when they joined. A device with nobody else online can still join a conversation it’s allowed into, by an external commit; when someone leaves, their access ends at once and the next member online commits their removal, which changes the keys.

Messages are small versioned envelopes inside MLS: text, reactions, edits, deletions, files, party state, names. The server is MLS’s delivery service. Its WebSocket only carries pokes; clients pull from a cursor per conversation, so a dropped connection or a lost poke costs nothing. A log entry is deleted once every device has confirmed it, or after 30 days.

The names and symbols of spaces and channels are encrypted too, with a key per space that travels in the invite link’s fragment. The server refuses names it could read. Removing someone rotates that key. Role names aren’t encrypted, because the server has to enforce what roles allow.

Push notifications carry only which conversation and who, encrypted to the receiving device.

§5 Meeting people

Every first DM starts as a message request, on any server, even between people in the same space. A request goes to a full ID, outside MLS, and does nothing until it’s accepted. Its sender gets the same answer whether the account exists, declined, or blocked them, so requests can’t be used to find out who is on a server. Unanswered requests lapse after 30 days, and admins can turn off requests from other servers.

Starting an MLS conversation needs the other person’s key packages, and those are rationed. A home server hands them out only for a connection it can see for itself: an accepted request, or a space that person joined through that host. Another server gets ten of a person’s one-time packages an hour. Looking someone up across servers (their profile, picture or devices) likewise needs a connection each server can check.

§6 Files, calls and parties

Files are encrypted on the sender’s device with a key of their own, carried inside the MLS message, in 1 MiB chunks whose order and end are bound in so they can’t be shuffled or cut short. The sender’s device also makes the thumbnail, so showing one fetches nothing. Uploads and downloads go in parts and resume. The server never streams: a device downloads the whole file, keeps it, and plays it from there. Once every device has it, or after 30 days, the server deletes it.

Calls run through LiveKit, but each frame is encrypted with a key exported from the conversation’s MLS group, so it changes with membership and LiveKit forwards frames it can’t read.

Watch parties and listening rooms are a queue of shared files and play state, sent as encrypted messages. The server knows who’s in the room, not what’s playing.

§7 Leaving

In a decentralized network, leaving a server shouldn’t mean leaving your friends. You can export your account and history as one file, or move your account to another server, into a new account or one you already have.

A move is driven by a code your device makes and no server sees. It derives what the old server checks, and the keys that seal your spaces’ keys and your history in transit, so neither server can open them. Handover comes last: until the new side finishes, anything going wrong abandons the move cleanly and changes nothing. After it, your DMs continue on the other side, spaces on other servers swap you for your new account, and the people you talk to see your new name only if your old device’s signed statement checks out against the key they pinned for it.

Moving a server to a new machine is copying its data directory.

§8 What it protects, and what it doesn’t

protects against

  • Anyone watching the network.
  • A curious or compromised server reading what you say, send or show on a call.
  • A key stolen today unlocking what was said before (forward secrecy), or for long after: the group heals as it moves on.

mitigates

  • A server slipping an extra device into a conversation. Clients warn when a device claims to be you with a key your server doesn’t list, when a known device’s key changes, and when someone’s devices change. Safety numbers catch people being split into separate groups.

doesn’t protect against

  • Metadata: who talks to whom and when, how much, who is in which space, display names and profile pictures, and when pushes are sent.
  • Someone in a conversation sharing what they can read.
  • Someone who left a space keeping the key to its old names.

A server can still refuse a commit that would remove a device it slipped in, so clients warn rather than remove; closing that fully needs something like key transparency. Reports work despite the encryption: each message carries a franking key inside it, and the server keeps a commitment for 30 days, so a reported message checks out only if its sender really sent exactly that.

§9 Known gaps

hrth is in a private alpha. What isn’t done yet:

  • Federation has no retry queue yet, and conversations hosted on another server don’t send push notifications yet.
  • New members can’t read history from before they joined.
  • A space’s name key rotates when someone is removed, not yet when someone leaves.
  • A space stays on the server it was made on: moving your account doesn’t move the spaces you host.
  • A server can’t change its domain yet.
  • The apps use the same WASM core as the browser, not a native one with keys in the OS keystore. No iPhone app or iOS push yet.
  • No formal security review or fuzzing yet.

§10 Next: your own storage not built yet

Today a server keeps files only until they’re delivered. Shared libraries of photos, video and music are coming back on storage people own: a NAS at home or an S3 bucket in their own account, guarded and streamed by a gateway its owner runs. hrth apps become the way you and your friends reach it, and the chat server never holds the files, their keys or where they are. We took out an earlier version of libraries to get this right; the dev blog has why.