Skip to content

rChat documentation

rChat is an end-to-end encrypted messenger that you run yourself. Messages are encrypted on your phone with a hybrid key agreement (X25519 with the post-quantum ML-KEM-768) and the Double Ratchet, using XChaCha20-Poly1305. The server, called the relay, passes on ciphertext it cannot decrypt.

rChat is self-hosted software, published by PDG Global Limited (Hong Kong) under AGPL-3.0-or-later. PDG Global Limited does not run relays for users. The relay is a single Rust binary that terminates TLS 1.3 itself and can obtain its own Let’s Encrypt certificate. The clients are a native Android app, installed from our download page, and a native iOS app for iPhone and iPad that is waiting for App Store review; a Mac app is coming later. The relay’s source is in rchat-core.

This documentation describes protocol version 3, used by rChat 2.0.0 and later. The relay refuses apps that don’t speak it, and such an app can’t connect until you update it.

  • It cannot read messages. Messages are end-to-end encrypted, and the relay holds no message keys.
  • It cannot swap in keys of its own. Each account’s keys are signed with its identity key, and the app refuses keys that are not. When you add someone by scanning their code, rChat remembers their keys and will not talk to them under different keys.
  • It does see connection metadata while it runs. It can see which accounts are connected, when, and from which IP address, and which two of them have a conversation open. When two people first connect, or after one of them gets a new phone or changes keys, it can also see for up to ten minutes which account is trying to reach which. It does not write this to its logs.
  • It keeps no lasting record of who talks to whom. Conversations after the first are matched by a code that changes every 10 minutes and at every reconnect. While a conversation is open, the relay’s memory still links its two members (as it did before). Once both have been gone about 10 minutes, nothing it keeps names the pair; waiting blind asks name no one; and no token or circuit id links one connection period to the next. What it holds in memory to route a conversation is discarded within ten minutes of both people disconnecting. Messages for someone who is offline are held in memory for at most 72 hours, filed under the recipient, and deleted once delivered. Someone watching a relay live can still see two accounts connect to each other at the same moment.

The security model lists what rChat protects against and what it does not.

Your phone rChat relay Contact's phone
────────── ─────────── ───────────────
Message → [Double Ratchet, padded] → WebSocket in TLS 1.3 → [route] → [decrypt]
  1. You join a relay by scanning its invite, which pins the relay’s identity. The app connects over WebSocket inside TLS 1.3, checks the relay’s signed identity, and proves its own identity over that TLS session.
  2. It publishes its public keys (including its post-quantum key), signed by its identity key.
  3. A conversation opens only when both people have asked for it. Someone who has your code but whom you haven’t accepted shows up as a request. Later conversations between you are paired by a rotating blinded token.
  4. The two phones agree a session key with a hybrid X3DH (X25519 and ML-KEM-768) and continue with the Double Ratchet, so every message uses a fresh key. Every message is padded to a size bucket.
  5. The relay forwards the encrypted packets, or holds them in memory while the recipient is offline.