Protocol & architecture

The protocol under everything.

One wire protocol carries messaging, channel events, and typed RPC over three transports. Every product surface — chat, games, agents — is a consumer of the same backbone.

The big picture

Five layers. One contract.

Clients speak to one SDK runtime; the runtime speaks one protocol; the server core fans out to application modules. Swap any layer without renegotiating the wire.

Multi-transport

QUIC for modern low-latency paths, TCP for compatibility, WebSocket for browsers — native clients fail over between transports; the protocol never changes.

Channels first

Messaging, presence, game events, bot replies, and business pushes all ride the same channel model. Learn it once.

Transfer RPC

Typed request-response routes over the live connection. Application modules add capabilities without touching the transport.

Server authority

Message ids, sequence points, read cursors, and recovery stay server-authoritative. Client caches stay fast — and honest.

Connection lifecycle

From cold start to recovery, defined.

Every stage of the connection has explicit semantics — which is what makes reconnect and multi-device sync boring, in the best way.

01

Connect

The SDK picks a transport — QUIC or TCP on native, WebSocket on the web — and establishes one long-lived connection.

02

Authenticate

Token-based auth binds the connection to a user and device. Refresh flows renew credentials without dropping the wire.

03

Subscribe

Clients subscribe to channels with short-lived tickets. Messages, presence, and business events start flowing immediately.

04

Publish & RPC

Channel publishes fan out to subscribers; typed transfer routes carry request-response calls over the same connection.

05

Resume

After any interruption the client re-authenticates, re-subscribes, and recovers from server sequence — no lost messages.

Transports

Three transports. Zero app changes.

The protocol is transport-agnostic: QUIC/TCP with runtime failover on native clients, WebSocket on the web — application code never changes.

TransportStrengthsBest for
QUICLowest latency, multiplexed streams, connection migrationModern mobile & native clients
TCPMaximum compatibility, battle-tested operational toolingServers, desktops, restricted networks
WebSocketRuns everywhere a browser runs, proxy-friendlyWeb apps, PWAs, embedded webviews

The stack

Four pieces, built to compose.

Open-source server and SDKs below; the commercial Platform and agent channels above — adopt the backbone alone or the whole stack.

PrivChat Server

A Rust realtime core: gateway, auth, channels, message sync, file hooks, and operational tooling — built for self-hosting.

PrivChat SDK

A Rust reference engine with native Kotlin bindings via UniFFI, plus an idiomatic TypeScript implementation for the web — one protocol everywhere.

PrivChat Platform

The commercial application layer — accounts, wallets, payments, games, admin, and assistants — built on the open backbone.

Agent Channels

Bots and assistants are first-class citizens: they subscribe, publish, and answer typed RPC on the same channels as users.

Go deeper

Read the code, not just the diagram.

The server, transports, and SDKs are open source — the architecture page is a map, the repositories are the territory.

Explore open source