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.
MlsGroup represents an MLS group with a high-level API for managing group membership, sending messages, and handling commits. This is the primary interface for interacting with MLS groups in OpenMLS.
Overview
TheMlsGroup struct provides a complete interface to the Delivery Service, where functions that modify the public state return messages that can be sent directly to the Delivery Service. Incoming messages from the Delivery Service can be processed through process_message().
Creating a group
new
Creates a new group with a random group ID and the creator as the only member.OpenMLS provider for cryptographic operations and storage
Signer for creating signatures
Configuration for group creation
The creator’s credential with associated key material
Returns a new
MlsGroup instance or an error if group creation failsnew_with_group_id
Creates a new group with a specified group ID.OpenMLS provider for cryptographic operations and storage
Signer for creating signatures
Configuration for group creation
The desired group ID
The creator’s credential with associated key material
Returns a new
MlsGroup instance or an errorGroup membership
add_members
Adds members to the group by providing their key packages. This operation includes an update path (updating the committer’s leaf).OpenMLS provider for cryptographic operations and storage
Signer for creating the commit
Key packages for the members to add
Returns a tuple of (Commit, Welcome, optional GroupInfo) or an error. Returns error if there is a pending commit.
add_members_without_update
Adds members without forcing an update of the committer’s leaf. Only includes a path if required by pending proposals.OpenMLS provider
Signer for creating the commit
Key packages for the members to add
Returns (Commit, Welcome, optional GroupInfo)
remove_members
Removes members from the group by their leaf indices.OpenMLS provider
Signer for creating the commit
Leaf indices of members to remove
Returns (Commit, optional Welcome if add proposals were pending, optional GroupInfo)
leave_group
Leaves the group by creating a Remove proposal. The proposal must be committed by another member.OpenMLS provider
Signer for the proposal
Returns the Remove proposal message
members
Returns an iterator over all members in the group.Iterator over group members
Message processing
process_message
Processes incoming messages from the Delivery Service. Performs syntactic and semantic validation, and decrypts encrypted messages.OpenMLS provider
The message to process
Returns the processed message or an error
merge_staged_commit
Merges a staged commit into the group state after inspection.OpenMLS provider
The staged commit to merge
Returns
() on successProposals
propose_add_member
Creates a proposal to add a member to the group.OpenMLS provider
Signer for the proposal
Key package of the member to add
Returns (proposal message, proposal reference)
propose_remove_member
Creates a proposal to remove a member from the group.OpenMLS provider
Signer for the proposal
Leaf index of the member to remove
Returns (proposal message, proposal reference)
commit_to_pending_proposals
Creates a Commit that covers all pending proposals in the group’s proposal store.OpenMLS provider
Signer for the commit
Result
Result<(MlsMessageOut, Option<MlsMessageOut>, Option<GroupInfo>), CommitToPendingProposalsError>
Returns (Commit, optional Welcome, optional GroupInfo). Returns error if there is a pending commit.
Getters and configuration
group_id
Returns the group ID.Reference to the group ID
epoch
Returns the current epoch.The current group epoch
ciphersuite
Returns the group’s ciphersuite.The ciphersuite used by the group
own_leaf_index
Returns the leaf index of the client in the tree.The client’s leaf index
is_active
Returns whether the client is still a member of the group.true if the client is a member, false if evictedpending_commit
Returns a reference to the pending commit if one exists.Optional reference to the pending commit
pending_proposals
Returns an iterator over pending proposals.Iterator over queued proposals
configuration
Returns the group configuration.Reference to the group configuration
set_configuration
Sets the group configuration.Storage provider
New configuration
Returns
() on successExport and secrets
export_secret
Exports a secret from the current epoch.Cryptographic provider
Label for the exported secret
Context bytes for the derivation
Desired key length in bytes (max: u16::MAX)
Returns the exported secret or an error
export_group_info
Exports a GroupInfo object for this group.Cryptographic provider
Signer for signing the GroupInfo
Whether to include the ratchet tree extension
Returns the GroupInfo message
export_ratchet_tree
Exports the ratchet tree of the group.The group’s ratchet tree
epoch_authenticator
Returns the epoch authenticator of the current epoch.Reference to the epoch authenticator
resumption_psk_secret
Returns the resumption PSK secret of the current epoch.Reference to the resumption PSK secret
Storage
load
Loads a group from persistent storage.Storage provider
ID of the group to load
Returns the group if found,
None if not found, or an errordelete
Removes the group’s persisted state from storage.Storage provider
Returns
() on successState management
clear_pending_commit
Clears any pending commit, setting the group state to operational.Storage provider
Returns
() on successclear_pending_proposals
Clears all pending proposals from the proposal store.Storage provider
Returns
() on successGroup state
TheMlsGroup maintains an internal state that determines available operations:
- Operational: Normal state with full functionality
- PendingCommit: A commit has been created but not yet merged; most operations are restricted
- Inactive: The client has been removed from the group; no operations are available
MlsGroupState documentation.