The Messaging Layer Security (MLS) protocol provides end-to-end encryption for messaging applications. OpenMLS is a Rust implementation of MLS as specified in RFC 9420.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/openmls/openmls/llms.txt
Use this file to discover all available pages before exploring further.
What is MLS?
MLS is a security layer for group messaging that provides confidentiality, integrity, and authentication for messages exchanged within a group. It is designed to be efficient even for large groups and supports asynchronous communication. The protocol enables:- End-to-end encryption: Messages are encrypted on the sender’s device and can only be decrypted by intended recipients
- Forward secrecy: Compromising current keys does not compromise past messages
- Post-compromise security: The protocol can recover security after a key compromise
- Asynchronous group management: Members can be added to groups without all participants being online simultaneously
Protocol version
OpenMLS currently supports MLS 1.0 (protocol versionmls10):
Core protocol components
Groups
An MLS group is a collection of clients that can securely exchange messages. Each group has:- Group ID: A unique identifier chosen at group creation (typically random)
- Group epoch: A counter incremented with each group state change
- Group members: Clients represented by their leaf nodes in the ratchet tree
- Group context: Agreed-upon state including extensions and configuration
Ratchet tree
The ratchet tree (also called TreeSync) is a binary tree structure that maintains the group’s cryptographic state. Each member occupies a leaf position, and the tree is used to efficiently distribute group keys. Key properties:- Leaf nodes contain member credentials and public keys
- Parent nodes contain shared secrets for subgroups
- The root contains the shared secret for the entire group
- Tree updates enable forward secrecy and post-compromise security
Messages
MLS defines several message types:- Application messages: Encrypted content sent between group members
- Proposals: Suggested changes to the group (add/remove members, update keys)
- Commits: Batch group state changes by applying one or more proposals
- Welcome messages: Initialize new members with the current group state
Message flow
Client creates key packages
Clients generate and publish key packages containing their public keys and credentials.
Adding members
The group creator adds members by committing Add proposals that reference their key packages.
Security properties
Message protection
MLS provides:- Confidentiality: Only group members can read messages
- Authentication: Recipients can verify the sender’s identity
- Integrity: Messages cannot be modified without detection
Forward secrecy
When a member updates their keys or new members join, old keying material is deleted. This ensures that compromising current keys cannot decrypt past messages. See the forward secrecy documentation for details.Post-compromise security
If a member’s keys are compromised, the group can recover security by having that member send an update proposal with fresh randomness that an attacker cannot predict.Group epochs
The group epoch is a counter that increments with each valid commit:- Messages from different epochs cannot be confused
- Receivers can detect and reject replayed messages
- The group has a clear linear history of state changes
Every commit increments the group epoch by 1, creating a new cryptographic epoch with fresh keys derived from the updated ratchet tree.
MLS architecture
The MLS architecture document defines abstract services that support the protocol:- Authentication Service: Validates the binding between credentials and client identities
- Delivery Service: Routes MLS messages between clients
Related concepts
Architecture
Learn about OpenMLS’s modular architecture and provider traits
Ciphersuites
Explore supported cryptographic algorithms and configurations
Credentials
Understand how client identities are represented
Key packages
Learn about pre-published key material for asynchronous group operations