/ encryption ← all documentation

Encryption: how it works and where it stops

What a private space actually does to a message, and the honest list of what version 1 does not protect against. If you are deciding whether to trust it with something, read the second half first.

1. Encryption (E2EE v1)

A space is either encrypted or not, chosen once at creation and immutable — the server rejects plaintext bodies in encrypted spaces, so a space can never be silently downgraded. Direct messages created now are sealed by default, except a DM with a bot (a bot has no key) and DMs created before this slice.

Message bodies are sealed on the client; the server stores and forwards an opaque string. Channel names, member lists, timestamps, message lengths and who talks to whom stay visible.

Keys

One long-term X25519 identity key per account. The desktop client generates it on first sign-in and keeps it in %APPDATA%/yap/identity.json (override the directory with YAP_DATA_DIR), one key per (server host, username). The public half is published with PUT /keys; members fetch the current list with GET /spaces/{id}/keys. A member without a published key is fatal to sending rather than silently unreadable, except bots, who are left out of the wrap set.

Envelope

"yap1:" + base64url(
u8      version = 1
u8      n = number of wrapped keys
n × {   u64be recipient_id | 24-byte nonce | 32-byte message key | 32-byte tag }   (96 bytes)
16-byte salt
24-byte body nonce
        body ciphertext || 32-byte tag )

A fresh random 32-byte message key seals the body once; each recipient gets that key sealed to their static key, including the sender. Derivations are HKDF-SHA256 with the envelope salt: K_wrap from "yap/v1/e2ee/wrpx" || u64be(recipient) || u64be(sender) over X25519(me, their_pk), and K_body from "yap/v1/e2ee/body" over the message key. The 42-byte AAD ("yap/v1/e2", version byte, sender id, channel id, salt) is fed to every seal, so a body cannot be replayed into another channel, attributed to another sender, or moved to another message.

Sealing is ChaCha20 with HMAC-SHA256, encrypt-then-MAC, independent keys, because Poly1305 written by hand is a large amount of arithmetic to get right and this construction is easy to audit. The tag is checked in constant time before decrypting; anything that fails shows a placeholder, never partial plaintext.

Limits: 4000-character plaintext, 16 KiB sealed envelope, at most 255 recipients. The server checks only the shape it can see — the yap1: prefix, a base64url body of at least 200 characters, the 16 KiB cap.

2. Encryption gaps

Known and accepted for v1. Read these before trusting it with anything that matters.

Updated . Yap technical documentation is part of the documentation index; the product itself is at getyap.dev.