---
language:
- en
license: apache-2.0
tags:
- taper
- matrix
- matrix-fork
- encrypted-messaging
- end-to-end-encryption
- e2ee
- messaging-protocol
- privacy
- security
- cryptography
- ephemeral-messaging
- forward-secrecy
- tor
- onion-service
- opaque
- webauthn
- post-quantum
- vodozemac
- olm
- megolm
- websocket
- self-hosted
- federated-chat
- nodejs
- gtk4
- open-source
---
# Taper — End-to-End Encrypted Ephemeral Messaging Protocol
End-to-end encrypted group chat where messages, files, and backups expire after 21 days—built as a hardened, non-compatible fork of Matrix with OPAQUE auth and Tor.
**Taper** is a self-hosted messaging protocol, reference Node.js homeserver, zero-build web client, and Tor-only GNU/Linux desktop app derived from the [Matrix specification](https://spec.matrix.org). It removes Matrix backwards compatibility so Room Version 13 with State Resolution v2.1, mandatory Olm/Megolm end-to-end encryption ([vodozemac](https://github.com/matrix-org/vodozemac)), password-never-leaves-device [OPAQUE](https://www.rfc-editor.org/rfc/rfc9807) authentication (RFC 9807), 21-day crypto-shredded message retention, Padmé frame padding, and anti-scraping budgets are enforced unconditionally.
> **Preview & experimental status:** Taper works end to end and passes its automated server, browser, desktop, fuzz, and memory-inspection test suites, but **has not yet undergone an independent third-party security audit**. Federation is **experimental**: State Resolution v2.1, verified joins, soft-fail, depth bounds, and peer key pinning are implemented, while **cross-server media, outbound delivery retry queues, and backfill are not yet built**. Do not bet personal safety on Taper until an external audit is complete. See [the 1.0 release checklist](docs/release-checklist.md).
Dark mode preview
---
## What Taper Fixes vs. Standard Matrix
Taper enforces security invariants at the protocol layer instead of leaving them as opt-in room or client settings.
| Known Matrix Protocol / Ecosystem Problem | Taper Mitigation | Implementation & Specification |
| --- | --- | --- |
| **State-reset attacks ([CVE-2025-49090](https://nvd.nist.gov/vuln/detail/CVE-2025-49090))** | Implements **Room Version 13** with **State Resolution v2.1** (empty initial state map in iterative auth checks, conflicted state subgraph, infinite creator power level, self-certifying `!room_id` SHA-256 hashes, `auth_events` covered by event signatures), persisted resolved state/heads across restarts, and current-state soft-fail for remote messages. | [`server/state-res.js`](server/state-res.js), [`server/rooms.js`](server/rooms.js), [`server/federation.js`](server/federation.js), [`content/rooms/v13.md`](content/rooms/v13.md) |
| **E2EE key-injection & impersonation ([Albrecht et al., IEEE S&P 2023](https://eprint.iacr.org/2022/1222))** | Disables in-band room key forwarding and requests; enforces `TrustRequirement.CrossSigned` on to-device sync decryption and requires a cross-signed sender device on every room `decrypt()` (with rate-limited key refresh); requires a 128-bit `binding` inside and outside ciphertext, room-ID matching, `t.relates_to` equality, sender-scoped replay checks, encrypted `sender_ts` skew warnings, and optional per-room verified-only sending. | [`client/crypto.js`](client/crypto.js), [`content/security.md`](content/security.md) |
| **Indefinite message & history retention** | Hard **21-day retention ceiling** on message events, encrypted media, per-day encrypted key backups, expired `leave` membership state, and dead rooms. Daily AES-256-GCM wrapping keys are shredded once expired (~22–23 days after creation) and SQLite WAL is truncated (`PRAGMA wal_checkpoint(TRUNCATE)`). Room creators/admins (PL 100) can set shorter lifetimes via `t.room.retention` (minimum 1 minute by default). Clients tombstone Megolm sessions older than 22 days, refusing decryption and backup re-export. | [`server/store.js`](server/store.js), [`server/rooms.js`](server/rooms.js), [`client/crypto.js`](client/crypto.js), [`content/client-server-api/modules/message_retention.md`](content/client-server-api/modules/message_retention.md) |
| **Unencrypted rooms & plaintext room metadata** | No unencrypted message mode. `t.room.encrypted` strictly whitelists encrypted envelope fields (rejecting extra plaintext keys like `body`); non-routing room metadata (room name, topic) must be encrypted state (`t.room.encrypted`); plaintext `reason` fields are rejected/stripped on member kicks/bans and redactions. | [`server/state-res.js`](server/state-res.js), [`server/rooms.js`](server/rooms.js), [`content/rooms/v13.md`](content/rooms/v13.md) |
| **Server sees login passwords** | Authentication uses **OPAQUE ([RFC 9807](https://www.rfc-editor.org/rfc/rfc9807))** over WebSocket with Argon2id (64 MiB, 3 passes, 4 lanes) on the client; the server never receives passwords. Optional **FIDO2/WebAuthn** hardware keys provide step-up checks for sensitive actions and single-device revocation (`t.devices.list`, `t.devices.delete`). | [`client/opaque.js`](client/opaque.js), [`server/webauthn.js`](server/webauthn.js) |
| **One-time key (OTK) exhaustion & forged cross-signing** | Server enforces both per-(requester, target device) (`TAPER_OTK_CLAIM_LIMIT`, default 4 / 5 min) and aggregate per-target-device (`TAPER_OTK_DEVICE_LIMIT`, default 16 / 5 min) OTK claim caps plus daily budgets; restricts key/OTK/to-device visibility strictly to mutually **joined** rooms; and verifies Ed25519 signatures on device keys, own master keys, and federated master keys. | [`server/keys.js`](server/keys.js) |
| **Unverified federated joins & server key swaps** | `remoteJoin` is serialized per room and verifies `t.room.create` v13 hashes, signatures, bounded integer `depth`, timestamps, and Room v13 auth rules on every returned state/auth-chain event. Federation uses allowlist-only peers, TOFU + cryptographically chained signing-key rotation/pinning (`admin.js rotate-signing-key`, `repin-peer`), old-key retention while referenced by stored state, per-peer daily budgets, and linear-time ReDoS-safe `t.room.server_acl` glob matching. | [`server/federation.js`](server/federation.js), [`server/state-res.js`](server/state-res.js) |
| **Directory scraping, enumeration & fingerprinting** | No public user or room directory, uniform `T_FORBIDDEN` invite errors (no user-existence oracle), proof-of-work registration & per-connection login PoW, optional private single-use `ti_…` invite tokens (`TAPER_INVITE_ONLY`), canary-tiered read/write budgets, Padmé padding on all frames and plaintext, silent `noop` cover traffic, and a cover website on every non-gateway HTTP/WS path. | [`server/padding.js`](server/padding.js), [`server/auth.js`](server/auth.js), [`server/quota.js`](server/quota.js), [`server/gateway.js`](server/gateway.js), [`content/client-server-api/modules/scraping_resistance.md`](content/client-server-api/modules/scraping_resistance.md) |
---
## Core Security & Cryptographic Architecture
### End-to-End Encryption & Deniability
- **Olm & Megolm via `vodozemac`:** Uses `@matrix-org/matrix-sdk-crypto-wasm` with mandatory cross-signing, SAS emoji verification (local and cross-server), and automatic Megolm session rotation (1 day / 100 messages max, plus immediate session invalidation on member leave, kick, ban, or `t.device_lists` updates).
- **Deniable message content:** Message events carry no long-term sender signatures, and federation request keys are retired and published with their private halves so recorded transcripts do not serve as third-party proof of what was said. *(Caveat: cross-signing `user_signatures` are Ed25519-signed and stored on the signer's homeserver, which records who verified whom—not message content.)*
- **Client-side integrity checks:** Clients verify `t.room.create` SHA-256 room ID hashes, room version `13`, `joined`-only history visibility, and encryption settings, warning on tampering or newly joined unverified members.
### Storage, Persistence & Memory Hygiene
- **Zero message plaintext on disk or in server RAM:** Sealed SQLite storage ([`server/store.js`](server/store.js)) encrypts events, room metadata, queued to-device messages, encrypted media, and key backups under daily keys kept in a separate `TAPER_KEY_DIR`. Account records (OPAQUE records, hashed tokens, public device/cross-signing keys, `user_signatures`, deleted user IDs) are stored as metadata rows in SQLite. Automated memory tests ([`server/test-backend-encryption.js`](server/test-backend-encryption.js)) search disk, logs, wire frames, and live `/proc//mem` for message/room/file plaintext.
- **Desktop vs. browser client persistence:**
- **GNU/Linux desktop app (`desktop/`):** Uses an ephemeral WebKitGTK session by default—nothing is written to disk unless the user explicitly enables persistence once via `taper-desktop --keep-data`.
- **Web browser (`client/`):** Uses `sessionStorage` to survive tab reloads and an encrypted IndexedDB crypto store (`taper-crypto-`) cleared on logout or wipe. Opt-in *"Keep this device signed in"* seals credentials in `localStorage` under a user passphrase (PBKDF2-HMAC-SHA256, 600,000 iterations + AES-256-GCM) with configurable idle auto-lock (default 15 minutes).
- **Client Megolm key expiry:** Tombstoning permanently refuses decryption and backup re-export after 22 days; because `@matrix-org/matrix-sdk-crypto-wasm` does not expose per-session deletion inside IndexedDB, physical removal of the underlying IndexedDB database occurs on logout, device wipe, or ephemeral desktop exit.
### Transport Stealth, Tor & Emergency Wipe
- **TLS 1.3 & post-quantum key exchange:** When configured with TLS certificates, the server serves TLS 1.3 only, preferring hybrid post-quantum `X25519MLKEM768` (falling back to `X25519` for clients without it) and refusing plaintext HTTP/WS on non-loopback addresses. *(Note: direct Tor `.onion` connections rely on Tor's native onion encryption rather than an additional TLS layer.)*
- **Tor-only desktop shell:** The GTK 4 / libadwaita desktop app ([`desktop/README.md`](desktop/README.md)) bundles the static client locally so a server cannot swap client JavaScript, forces every connection through Tor (with built-in Snowflake and WebTunnel/lyrebird bridge support), and verifies optional update notices with Ed25519 signatures over Tor.
- **Dead man's switch:** Operators can configure signed command, M-of-N quorum, dead-hand check-in, and duress modes to cryptographically wipe server keys and data ([`docs/dead-mans-switch.md`](docs/dead-mans-switch.md)).
---
## Quick Start
### Requirements
- **Server & web client:** **Node.js `>=22.13`** (unflagged `node:sqlite`; tested on Node.js 24), no external database required.
- **Desktop app (GNU/Linux):** Python `>=3.11`, `python3-gi`, `gir1.2-gtk-4.0`, `gir1.2-adw-1`, `gir1.2-webkit-6.0`, and `tor`.
### Clone & Run Locally (Server + Zero-Build Web Client)
```bash
git clone https://huggingface.co/abr00kx/taper
cd taper
scripts/dev.sh
# Open http://127.0.0.1:8080/_taper/gateway/v1/
```
The Node.js server hosts the static web client directly under its gateway path with a strict Content Security Policy and zero frontend build step.
### Install the GNU/Linux Desktop App
```bash
(cd client && npm ci --omit=dev --ignore-scripts)
desktop/install.sh
taper-desktop "http://example.onion//"
```
### Production Deployment (systemd, Container & Tor)
- **systemd service:** [`deploy/taper.service`](deploy/taper.service) (hardened unit with separate `0700` data/key directories, `ProtectSystem=strict`, `LimitCORE=0`, `MemoryMax=512M`) and [`deploy/taper.env.example`](deploy/taper.env.example).
- **Container image:** Build with `podman build -f deploy/Containerfile -t taper .` (requires `TAPER_TLS_CERT`, `TAPER_TLS_KEY`, and a random `TAPER_GATEWAY_PATH` when `HOST=0.0.0.0`, or set `HOST=127.0.0.1` behind a Tor onion service / reverse proxy).
- **Operator guide:** Follow [`deploy/README.md`](deploy/README.md) for TLS 1.3, Tor onion services, pluggable transports, private `ti_…` invite tokens (`admin.js invite`), signing-key rotation (`admin.js rotate-signing-key`), peer key re-pinning (`admin.js repin-peer`), and backups.
---
## Verification, Testing & Supply Chain
Run the local CI gate from the repository root (`TAPER_GATE_OFFLINE=1` skips network-dependent `redocly` OpenAPI lint and `grype` vulnerability scans; browser/desktop suites require Chromium and Xvfb/GTK):
```bash
TAPER_GATE_OFFLINE=1 scripts/ci/gate.sh
```
| Verification Layer | Command / Suite | What It Covers |
| --- | --- | --- |
| **Server & Protocol (10 suites)** | `cd server && npm test` | Core gateway & retention (`test.js`), Room v13 auth / State Res v2.1 / ACLs / soft-fail / restart-after-purge (`test-state-res.js`), Olm/Megolm E2EE & Albrecht et al. regressions (`test-e2ee.js`), federation, key pinning/rotation & depth/soft-fail (`test-federation.js`), Tor SOCKS isolation (`test-tor.js`), WebAuthn / backups / password change (`test-webauthn.js`), admin CLI, invite-only & device revoke (`test-admin.js`), dead man's switch (`test-dms.js`), protocol & upgrade fuzzer (`test-fuzz.js`), and disk/log/RAM plaintext scan (`test-backend-encryption.js`). |
| **Browser E2EE** | `node client/test-browser.mjs` | Two-user headless Chromium E2EE chat, encrypted media, SAS emoji verification, verified-only sending, device revocation, idle auto-lock, zero-secret `localStorage`, Padmé padding, and zero CSP/page errors. |
| **Desktop Tor App** | `python3 desktop/test_desktop.py` | Headless WebKitGTK shell, bundled client serving, WebAssembly + WebCrypto + IndexedDB checks, Tor/lyrebird bridge handling, signed update verification, and proxy-only egress isolation. |
| **Spec & Docs** | `scripts/ci/check-docs.py`, `scripts/check-*.py` | Validates OpenAPI/JSON/event schemas (`data/`), documentation links/anchors, documented `TAPER_*` settings, and index completeness. |
| **SBOM & Reproducibility** | `scripts/sbom/generate.py --check`, `scripts/release/verify-reproducible.sh` | Verifies CycloneDX 1.6 SBOMs ([`sbom/`](sbom/)) and dependency justifications ([`DEPENDENCIES.md`](DEPENDENCIES.md)). Release tarballs rebuild bit-for-bit on tested hosts (not yet verified independently across multiple machines; container image is not reproducible). |
---
## Threat Model, Privacy Guarantees & Limitations
- **Zero telemetry:** Taper contains no analytics, crash reporting, or third-party requests. The web client talks only to its configured gateway; the desktop app connects exclusively through Tor to the gateway and, if explicitly configured by a packager/operator, a signed update-notice URL (disable with `TAPER_NO_UPDATE_CHECK=1`).
- **Explicit limits (read before deploying):**
- **Endpoint compromise:** End-to-end encryption cannot protect messages read on a compromised OS, browser, or device.
- **Malicious federated peers:** A remote homeserver can ignore the 21-day retention rule on its own copy of ciphertext and room state.
- **Global passive adversary:** Padmé padding, cover traffic, and Tor raise traffic-analysis cost, but do not defeat an adversary observing all network ingress and egress simultaneously.
- **Pre-1.0 gaps:** No independent external security review yet; WebAuthn has only been tested with software/virtual authenticators rather than physical YubiKeys; federation is experimental (no cross-server media, delivery retry queue, or backfill); SQLite WAL truncation does not erase OS-level swap or flash wear-leveled blocks.
Read the full [`docs/threat-model.md`](docs/threat-model.md), [`docs/operator-handover.md`](docs/operator-handover.md), and [`docs/user-guide.md`](docs/user-guide.md).
---
## Repository Structure
| Path | Description |
| --- | --- |
| [`server/`](server/README.md) | Node.js Taper homeserver, Room v13 / State Res v2.1 engine, sealed SQLite store, admin CLI, dead man's switch, and 10 test suites |
| [`client/`](client/README.md) | Zero-build static web client (`vodozemac` WASM E2EE, OPAQUE login, WebAuthn, headless Chromium tests) |
| [`desktop/`](desktop/README.md) | GNU/Linux GTK 4 / libadwaita + WebKitGTK desktop shell with built-in Tor and bridge support |
| [`deploy/`](deploy/README.md) | Production deployment templates: systemd unit, Containerfile, environment reference, and Tor/Snowflake configs |
| [`content/`](content/) | Taper protocol specification (Client-Server API, Server-Server API, Room v13, security, retention, scraping resistance) |
| [`data/`](data/) | OpenAPI 3.1 definitions and Room v13 event JSON Schemas (`t.*`) |
| [`docs/`](docs/README.md) | User guide, threat model, operator handover guide, reproducible builds, dead man's switch, and release checklist |
| [`sbom/`](sbom/) | Validated CycloneDX 1.6 Software Bills of Materials for server, client, desktop, and spec site |
| [`scripts/`](scripts/) | Local CI gate (`scripts/ci/gate.sh`), doc checks, schema validators, SBOM generator, and reproducible release builder |
---
## Contributing, Security Disclosure & License
- **Hosting & source:** Published on Hugging Face at [`abr00kx/taper`](https://huggingface.co/abr00kx/taper) (development branch `taper/rebrand-and-retention`).
- **Contributing:** See [`CONTRIBUTING.rst`](CONTRIBUTING.rst) and [`docs/docs-as-code.md`](docs/docs-as-code.md).
- **Security issues:** Follow [`SECURITY.md`](SECURITY.md) for responsible disclosure rather than posting vulnerabilities publicly.
- **License & Attribution:** Licensed under the [Apache License 2.0](LICENSE). Taper is a non-compatible hard fork of the [Matrix specification](https://spec.matrix.org); see [`NOTICE`](NOTICE) and [`DEPENDENCIES.md`](DEPENDENCIES.md) for upstream and dependency attributions.