Architecture โ
System Components โ
Data Flow โ
User Enrollment โ
Record Creation โ
Private feed storage โ
The feed generator collects posts hosted by Stratos and protected posts from PDS users whom Stratos lists as members. It checks each PDS user's signed update before adding those posts to its encrypted local database. A viewer can read posts and attachments only from boundaries they currently belong to. See Feed Generator for storage, access, and startup checks.
Repository & MST Architecture โ
Stratos maintains a per-user Merkle Search Tree (MST) and signed commit chain compatible with the ATProto repo format. Every record write produces a signed commit that updates the MST root, enabling cryptographic verification of repository contents.
| Layer | Contents |
|---|---|
| Signed Commit (v3) | did, version: 3, data (MST root CID), rev (TID), sig (P-256 signature) |
| MST | Sorted key-value tree mapping collection/rkey โ record CID |
| Endpoint | Description |
|---|---|
com.atproto.sync.getRecord | CAR with signed commit + MST inclusion proof + record block |
zone.stratos.sync.getRepo | Full repo as a CAR file |
zone.stratos.repo.importRepo | Import repo from CAR with CID integrity verification |
Storage Architecture โ
Each enrolled user gets either an isolated SQLite database (default) or an isolated PostgreSQL schema.
SQLite layout:
/data/stratos/
โโโ service.sqlite # Enrollment, OAuth sessions
โโโ blobs/ # Blob storage (local provider)
โ โโโ {did}/{cid}
โ โโโ temp/{did}/{key}
โ โโโ quarantine/{did}/{cid}
โโโ actors/
โโโ ab/
โ โโโ did:plc:abc123/
โ โโโ stratos.sqlite # Records, repo blocks
โโโ cd/
โโโ did:plc:cdef456/
โโโ stratos.sqliteDatabase Schema โ
stratos_record โ record metadata
CREATE TABLE stratos_record (
uri TEXT PRIMARY KEY,
cid TEXT NOT NULL,
collection TEXT NOT NULL,
rkey TEXT NOT NULL,
repoRev TEXT,
indexedAt TEXT NOT NULL,
takedownRef TEXT
);stratos_seq โ event sequencing for subscriptions
CREATE TABLE stratos_seq (
seq INTEGER PRIMARY KEY AUTOINCREMENT,
did TEXT NOT NULL,
time TEXT NOT NULL,
rev TEXT NOT NULL,
event TEXT NOT NULL -- JSON-encoded operation
);