There are two main ways to create an MLS group in OpenMLS: usingDocumentation 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.
MlsGroup::new() with a configuration object, or using the builder pattern with MlsGroup::builder(). Both approaches give you full control over group parameters and extensions.
Basic group creation
The simplest way to create a group is withMlsGroup::new(), which creates a group with a random group ID:
Every group is assigned a random group ID during creation. The group ID cannot be changed and remains immutable throughout the group’s lifetime. Choosing it randomly helps avoid collisions with other groups in the same system.
Creating a group with a specific ID
If you already have a group ID (for example, provided by a server), you can create a group with a specific ID:Using the builder pattern
The builder pattern offers more flexibility and cleaner syntax for configuring groups:Configuring group extensions
The builder provides methods for setting required capabilities and external senders. These settings are stored in the group context as extensions:Setting up supported extensions
When creating a group, you should define all supported and required extensions. The negotiation mechanism in MLS works by setting an initial list of extensions at group creation time and choosing key packages of new members accordingly.let capabilities = Capabilities::new(
None, // Defaults to the group's protocol version
None, // Defaults to the group's ciphersuite
Some(&[ExtensionType::Unknown(0xff00)]),
None, // Defaults to all basic proposal types
Some(&[CredentialType::Basic]),
);
let key_package = KeyPackage::builder()
.build(ciphersuite, provider, signer, credential_with_key)?;
Related types
MlsGroup::new()- Creates a group with a random IDMlsGroup::new_with_group_id()- Creates a group with a specific IDMlsGroup::builder()- Returns anMlsGroupBuilderfor fluent configurationMlsGroupCreateConfig- Configuration object for group creation
Next steps
Group configuration
Learn about all available configuration options
Adding members
Add members to your newly created group