mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-30 16:26:02 +00:00
Spec Layer
How does the code work? What does each function do? What are the security invariants?
Conventions
Each spec file documents:
- Purpose — What this component does
- Protocol reference — Link to
protocol/file (where applicable) - Types — Key data types with field descriptions
- Functions — Every exported function with call graph
- Security notes — Trust assumptions, validation requirements
Function documentation format:
### Module.functionName
**Purpose**: ...
**Calls**: Module.a, Module.b
**Called by**: Module.c
**Invariant**: SI-XX
**Security**: ...
Index
Protocol Implementation
- smp-protocol.md — SMP commands, types, encoding
- xftp-protocol.md — XFTP commands, chunk operations
- ntf-protocol.md — NTF commands, token/subscription lifecycle
- xrcp-protocol.md — XRCP session handshake, commands
- agent-protocol.md — Agent connection procedures, queue rotation
Cryptography
- crypto.md — All primitives: Ed25519, X25519, NaCl, AES-GCM, SHA, HKDF
- crypto-ratchet.md — Double ratchet + PQDR
- crypto-tls.md — TLS setup, certificate chains, validation
Transport
- transport.md — Transport abstraction, handshake, block padding
- transport-http2.md — HTTP/2 framing, file streaming
- transport-websocket.md — WebSocket adapter
Server Implementations
- smp-server.md — SMP server
- xftp-server.md — XFTP server
- ntf-server.md — Notification server
Client Implementations
- smp-client.md — SMP client, proxy relay
- xftp-client.md — XFTP client
- agent.md — SMP agent, duplex connections
Storage
- storage-server.md — Server storage backends
- storage-agent.md — Agent storage backends
Auxiliary
- encoding.md — Binary and string encoding
- version.md — Version ranges and negotiation
- remote-control.md — XRCP implementation
- compression.md — Zstd compression
Security
- security-invariants.md — All security invariants