Everything, Everywhere
Verified Specification | Standardized Formulas | Instant Precision
Secure & Private (Zero Data Retention) Free Access • No Sign-Up
IETF RFC 9420 (July 2023) TreeKEM Binary Ratchet HPKE (RFC 9180) Post-Compromise Security

MLS (Messaging Layer Security, RFC 9420) & TreeKEM Architecture Studio

An architectural workbench and interactive simulator for the modern IETF standard in End-to-End Encrypted (E2EE) group messaging. Explore TreeKEM binary ratchet trees, direct path key rotations, copath resolutions, parent hashing, and unmerged leaves. Dissect Forward Secrecy (FS) and Post-Compromise Security (PCS), and synthesize production OpenMLS Rust and Go implementations.

8 Members
Active Tree Capacity
O(log N) = 3
TreeKEM Update Cost
Epoch 4
Group State Epoch
MLS_128_DHKEMX25519
HPKE Cipher Suite
ACTIVE (HEALED)
Post-Compromise State

Interactive TreeKEM Binary Ratchet Tree Visualizer

TreeKEM organizes group participants into the leaves of a balanced binary tree. Updating a member's key rotates only the ancestor nodes along the member's direct path up to the root, encrypting new node secrets to the copath resolution using HPKE in (O(log N)) steps.

Active Leaf (Member) Parent Node (HPKE Keypair) Copath Resolution Node Blanked Node (Post-Removal) Compromised / Adversary
Tree initialized with 8 members. Click 'Alice Key Update' to observe Direct Path & Copath computation...

MLS Key Schedule & Epoch Secret Derivation Pipeline

Each commit advances the group to a new epoch. The new epoch secret is derived from the previous epoch's init_secret combined with the commit_secret extracted from the root node of the TreeKEM ratchet tree.

EPOCH TRANSITION EQUATIONS (RFC 9420 SECTION 8) HKDF SHA-256
joiner_secret = HKDF-Extract(commit_secret, init_secret[epoch - 1])
welcome_secret = HKDF-Expand-Label(joiner_secret, "welcome", "", 32)
epoch_secret = HKDF-Expand-Label(joiner_secret, "epoch", GroupContext, 32)
└── encryption_secret → Sender Data Ratchet (AES-128-GCM Payload Keys)
└── confirmation_key → HMAC Confirmation Tag on Commits
└── membership_key → Message Framing Authentication
└── resumption_psk → Post-Shared Key for Epoch Reconnects
└── next init_secret → Input Secret for Epoch [epoch + 1]
Epoch Secret Name Derivation Label Output Length Security Function & Purpose
joiner_secret "joiner" 32 Bytes Bridge secret shared between existing members and newly joined members via Welcome message.
epoch_secret "epoch" 32 Bytes Root master secret for the current epoch, bound to the serialized GroupContext transcript.
encryption_secret "encryption" 32 Bytes Seed for the per-sender symmetric ratchet. Ratchets forward per message to guarantee Forward Secrecy.
confirmation_key "confirm" 32 Bytes Computes the HMAC confirmation tag verifying that all members agree on the exact same tree state.
init_secret "init" 32 Bytes Passed forward into the next epoch's HKDF-Extract stage, chaining epoch history cryptographically.

MLS Framing, Proposals, Commits & Welcome Wire Anatomy

MLS group changes follow a two-phase lifecycle: participants broadcast Proposals (Add, Remove, Update, PreSharedKey), and any member can subsequently aggregate proposals into an atomic Commit message containing the new TreeKEM UpdatePath.

Protocol Architecture Comparison: MLS vs Signal vs Matrix Megolm

How Messaging Layer Security compares to the historic industry standards across mathematical scalability, forward secrecy, and post-compromise security guarantees.

Protocol Characteristic MLS (RFC 9420) Signal (Sender Keys) Matrix (Megolm Ratchet)
Group Key Topology TreeKEM Binary Ratchet Pairwise Double Ratchet + Sender Keys Pairwise Olm + Shared Megolm Session
Member Update Bandwidth O(log N) — Logarithmic O(N) — Linear O(N) — Linear
Forward Secrecy (FS) Strict Per-Message FS Strict Per-Message FS Ratchet Advance (Weak FS)
Post-Compromise Security (PCS) Instant on Member Update Requires Full Key Re-distribution No Built-In PCS
Maximum Practical Group Size 50,000+ Members ~1,000 Members (Bandwidth bound) ~1,000 Members (Session bound)
Untrusted Delivery Service Cryptographically Enforced (Parent Hash) Server is trusted for delivery ordering Server is trusted for key forwarding

Production OpenMLS Rust & Go Implementations

Production implementation blueprints featuring official IETF RFC 9420 libraries: OpenMLS (Rust) and Go MLS with Delivery Service integration.

Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement