Skip to main content

P1. Protocol overview and profile

Work in progress — not audited

Normative protocol documentation for the current implementation. Not independently audited.

P1.0 Notation

Symbol / termMeaning
Byte stringUint8Array; on the wire as JSON array of integers 0–255
ConcatenationA || B
HexLowercase hex digits; test vectors omit 0x prefix
TextUTF-8 unless noted
IK, EK, …Signal/MLS symbols per upstream specs when cited

Keywords MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are interpreted per RFC 2119 in all P-chapters and appendices.

P1.1 Protocol identifier

This document defines profile:

EnkryptedChat-Profile-v0

Implementations claiming this profile MUST:

  1. Use WebRTC data channels as the transport (see P2, ch. 3).
  2. Use JSON UTF-8 objects as application PDUs on the data channel (see P4).
  3. When application E2EE is enabled, apply cascade layers in order MLS → Signal → ML-KEM → AES on plaintext (see P5).
  4. Follow processing rules in P6.

Alternate profiles (non-normative for v0):

ProfileDescription
EnkryptedChat-Profile-v0-MLS-fallbackCascade disabled or failed; MLS-only envelope
EnkryptedChat-Profile-v0-fast-fileFast file transfer; cascade MAY be bypassed; DTLS only for bulk data

P1.2 Layer stack

LayerComponentNormative reference
L0Signaling (PeerJS / WSS)P2
L1WebRTC (DTLS, SCTP data channel, SRTP for media)RFC 8825–8829; ch. 3
L2Session handshake PDUsP3
L3Cascade layer 1 — MLSRFC 9420
L4Cascade layer 2 — Signal (X3DH + Double Ratchet)Signal spec; Appendix B
L5Cascade layer 3 — ML-KEM-768FIPS 203 / project quantum doc
L6Cascade layer 4 — AES-GCM-256Web Crypto API; password-derived in implementation
L7Application PDU (type field)P4

Encrypt direction (plaintext to wire): L7 payload → L3…L6 cascade → wrapped in encryptedMessage → L2 PDU → L1 DTLS.

P1.3 Product configuration (Enkrypted Chat)

Authoritative product settings in glitr-chat:

enableCascadingCipher = true
cipherLayers = ["MLS", "Signal", "ML-KEM", "AES"]
enableSignalProtocol = true

The p2p library defaults enableCascadingCipher = false; the product shell overrides to true.

P1.4 Security properties (normative summary)

Legend: Provides · Partial · Does not provide

PropertySignalingHandshakeTransport (DTLS/SRTP)Application message
Confidentiality (content)N/APartial — key material in JSON PDUsProvidesProvides — cascade + DTLS
IntegrityProvides (TLS)PartialProvidesProvides — AEAD per layer
Forward secrecy (message)Does not providePartialProvides (ephemeral)Provides — Signal + MLS epochs
Post-quantum confidentialityDoes not provideDoes not provideDoes not providePartial — ML-KEM layer only
Authentication (peer identity)Partial — Peer IDPartial — in-band keysDoes not providePartial — no global PKI
Metadata minimizationDoes not provideDoes not provideDoes not providePartial
Offline / async deliveryDoes not provideDoes not provideDoes not provideDoes not provide

PQ wording: ML-KEM-768 adds post-quantum protection for message content at the cascade layer; transport and handshake are not post-quantum.

At-rest protection for local keys is product-dependent and not claimed by this profile.

P1.5 Explicit non-properties

Implementations of EnkryptedChat-Profile-v0 do not provide:

  • Offline / asynchronous message delivery without both peers online
  • Global identity or account system
  • Guaranteed anonymity (IPs visible to TURN/peers)
  • Interoperability with Signal, WhatsApp, or Matrix clients
  • Independently audited security (see disclaimers)

P1.6 Formal verification scope

In-house formal work applies to the Rust Signal Protocol core only. It does not cover the browser stack, cascade composition, WebRTC, or JSON PDU layer. See Signal Protocol formal verification.

P1.7 EnkryptedChat-Profile-v1 (future freeze)

EnkryptedChat-Profile-v0 remains unfrozen. Before publishing v1, implementations MUST meet:

  1. Frozen PDU schemas (no new required fields without version bump).
  2. Mandatory specVersion: "1.0" on every application PDU.
  3. Implemented protocol-error PDUs (P8.8).
  4. Golden hex vectors in Appendix A.
  5. Normative Appendix B.
  6. Independent security audit completed or documented waiver.

Until then, receivers SHOULD ignore unknown JSON fields. See CHANGELOG-SPEC.

Optional field in current builds: specVersion (string) MAY appear on PDUs for forward compatibility; MUST NOT be required until v1.

P1.8 Vulnerability disclosure

Report security issues via GitHub Security Advisories on positive-intentions/chat. See SECURITY.md in that repository.

P1.9 Document boundary

In protocol spec (P0, P1–P8, appendices)In product spec (ch. 1–12)
Data channel PDUs, handshake, cascadeModule federation, UI, OPFS, calendar
WebRTC/signaling profileCompetitive analysis, roadmap
Limits, errors, test vectorsDeployment, CSP/SRI MUSTs
Design rationales (P0)SFrame UX (informative Appendix D)