Group Types
Standard Groups
Multi-member conversations supporting 1 toMAX_GROUP_SIZE inboxes:
- Creator becomes sole super admin
- Configurable permission policies
- Custom metadata (name, description, image)
- Member management (add/remove)
Direct Messages (DMs)
Two-person conversations with special handling:- Uses
PolicySet::new_dm()(fixed permissions) - Cannot leave (prevented by validation)
- Automatically created on first message
- Deduplicated by participant pair
DMs are deduplicated using a
dm_id composed of both inbox IDs. Multiple DM groups may exist temporarily, but they get “stitched” together based on the last active one.Group Creation
Creating a Group
- Group ID: Random bytes from OpenMLS
- Members: Just the creator’s installation
- Creator’s inbox ID mapped to
sequence_id=0inGroupMembership - Creator marked as only super admin
- Updates creator’s
sequence_idto current value - Automatically adds creator’s other installations
Creating with Members
Add members during creation:Member Management
Adding Members
By inbox ID:- Validate member count doesn’t exceed
MAX_GROUP_SIZE - Fetch current key packages for all installations of each inbox
- Create MLS commit with Add proposals
- Update
GroupMembershipextension - Send welcome messages to new members
Removing Members
- Create MLS commit with Remove proposals for all installations of the inbox
- Update
GroupMembershipextension - Publish commit to network
Removing an inbox removes all of its installations from the group.
Updating Installations
Check for identity changes and sync group membership:- Automatically before sending messages (if > 5 minutes since last update)
- Manually via
update_installations() - During member add operations
- Fetch latest association state for all group members
- Compute diff: new installations and revoked installations
- Create commit adding new installations and removing revoked ones
Group Metadata
Mutable Metadata
User-facing properties stored inGroupMutableMetadata:
group_name: Display name (max 100 chars)description: Group description (max 1000 chars)group_image_url_square: Avatar URL (max 2048 chars)group_pinned_frame_url: Pinned frame URL- Custom attributes for app-specific data
Protected Metadata
Immutable properties inGroupMetadata:
Querying Metadata
Updating Metadata
- Validates against
update_metadata_policyfor that field - Creates MLS commit updating
GroupMutableMetadataextension - Publishes to network
Permission Policies
Each group has aPolicySet controlling restricted actions:
Permission Levels
Preconfigured Policies
AllMembers: Everyone can modifyManaging Admins
Updating Policies
Messaging
Sending Messages
- Check group is active (not inactive)
- Update installations if needed (periodic check)
- Store message locally with
Unpublishedstatus - Create
SendMessageIntent - Process intent queue
- Publish MLS application message
- Update message to
Publishedstatus
Querying Messages
- Time range (
sent_after_ns,sent_before_ns) - Message kind (application vs. membership changes)
- Delivery status (published, unpublished, failed)
- Limit and direction
Enriched Messages
Get messages with reactions, replies, and deletion status:Message Deletion
Delete your own messages or (if super admin) others:- Message must belong to this group
- Caller must be original sender OR super admin
- Message type must be deletable
- Message not already deleted
DeleteMessage which clients use to hide the original.
Syncing
Sync Messages
Pull new messages from network:- Fetch group messages since last cursor
- Decrypt and validate each message
- Store in local database
- Process any intents (commits to apply)
- Update cursor
Sync Welcomes
Discover new groups you’ve been added to:Sync All
Sync welcomes then sync all groups:Group Queries
Finding Groups
Conversation List
Get groups with last message preview:Consent and Blocking
Setting Consent
Allowed: Accepted contactDenied: Blocked contactUnknown: No preference set
InboxId: Block an entire inboxAddress: Block a wallet addressConversationId: Block a specific group
Leaving Groups
- Must be a group member
- Group must have > 1 member
- Cannot be a DM (DMs can’t be left)
- Cannot be a super admin (must be demoted first)
- Send
LeaveRequestmessage to group - Client is added to “pending removal” list
- Admins can remove pending members via
remove_members_pending_removal()
Leaving does not immediately remove you. An admin must process pending removals. This prevents users from removing themselves and circumventing group policies.
Message Disappearing
Ephemeral messages that auto-delete:in_ns: Time until message expires (from send time)from_ns: Timestamp when disappearing starts (0 = now)
DisappearingMessagesWorker periodically deletes expired messages.
Advanced Features
Streaming Updates
Recovery and Forking
If group state diverges (fork detected):Pending Removal Management
Process members who have requested to leave:Related Concepts
- MLS Protocol - Underlying encryption
- Identity System - Member inbox management
- Client Lifecycle - Client setup
