OpenMLS defines several traits that must be implemented to use the library. The main goal is to allow OpenMLS to use different implementations for cryptographic primitives, persistence, and random number generation. This makes it possible to plug in anything from WebCrypto to secure enclaves.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.
The provider architecture
OpenMLS separates concerns through a provider pattern. The mainOpenMlsProvider trait combines three sub-providers:
Core provider traits
OpenMLS requires implementations for three main provider traits:Crypto provider
Handles all cryptographic operations including HKDF, hashing, AEAD, signatures, and HPKE
Random provider
Provides cryptographically secure random number generation
Storage provider
Manages persistence of group state, keys, and other OpenMLS data
Default implementations
Because implementing the crypto provider is challenging and requires tremendous care, OpenMLS provides two production-ready implementations:Rust crypto provider
The go-to default implementation using commonly used, native Rust crypto libraries. Supported ciphersuites:MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519MLS_128_DHKEMP256_AES128GCM_SHA256_P256
Libcrux crypto provider
A crypto provider backed by the high-assurance cryptography library libcrux. Supported ciphersuites:MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519MLS_256_XWING_CHACHA20POLY1305_SHA256_Ed25519
Storage implementations
OpenMLS provides two storage implementations:Memory storage
In-memory storage using a
HashMap. Suitable for testing or ephemeral applications.SQLite storage
Persistent storage using SQLite. Suitable for production applications requiring persistence.
When to implement custom providers
You should consider implementing custom providers when:- Storage provider: You need persistent storage with a specific backend (PostgreSQL, Redis, etc.)
- Crypto provider: You need to integrate with hardware security modules (HSMs) or platform-specific crypto APIs
- Random provider: You need to use a specific entropy source or integrate with platform-specific random number generators
It is not necessary to implement all sub-traits. If you only need custom storage, implement the
StorageProvider trait and combine it with the provided crypto and randomness implementations.Implementation notes
Mixing implementations
You can combine different implementations of the sub-traits:Thread safety
All provider traits requireSend + Sync implementation for thread safety. Ensure your implementations are thread-safe if you plan to use OpenMLS in a multi-threaded environment.
Next steps
Implement crypto provider
Learn about the crypto provider trait and its methods
Implement storage provider
Learn about the storage provider trait and persistence
Custom implementation guide
Step-by-step guide to implementing custom providers
Random provider
Learn about the random provider trait