ADocumentation 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.
ParentNode represents an internal node in the MLS ratchet tree. Parent nodes are located at odd indices and contain the shared encryption key for a subtree of members, along with metadata for tree synchronization.
Overview
Parent nodes:- Are located at odd indices in the tree array
- Contain HPKE public keys for path encryption
- Track parent hash for tree validation
- Maintain lists of unmerged leaves
- Do not have signatures (unlike leaf nodes)
Structure
HPKE public key for this parent node
Hash of the parent node’s parent for validation
Sorted list of leaf indices that haven’t been merged into this node’s path
Creating Parent Nodes
Parent nodes are typically created internally during path derivation:- The given encryption key
- Empty parent hash
- Empty unmerged leaves list
Accessing Parent Node Data
public_key()
Returns the HPKE public key:Reference to the public key bytes
encryption_key()
Returns the encryption key structure:Reference to the encryption key
parent_hash()
Returns the parent hash:Parent hash bytes
unmerged_leaves()
Returns the list of unmerged leaf indices:Sorted slice of unmerged leaf indices
Path Derivation
Parent nodes are created as part of update path derivation:Crypto provider for key derivation
Ciphersuite to use
Initial path secret for derivation
Indices of parent nodes in the path
Tuple of (parent nodes with indices, plain update nodes, keypairs, commit secret)
Parent Hash Operations
Computing Parent Hash
Compute the parent hash for this node:Crypto provider
Ciphersuite for hashing
Serialized original child resolution
Computed parent hash
Setting Parent Hash
New parent hash value
Unmerged Leaves Management
Unmerged leaves track which members don’t have the private key for this parent node.Adding Unmerged Leaf
Leaf index to add to unmerged list
Setting Unmerged Leaves
Complete list of unmerged leaves (must be sorted)
UpdatePathNode (Encrypted)
When sending updates, parent nodes are encrypted intoUpdatePathNode structures:
PlainUpdatePathNode:
Crypto provider
Ciphersuite to use
Public keys to encrypt to (resolution of the copath)
Serialized group context for AEAD
Encrypted update path node
Example: Inspecting Parent Node
Example: Processing Update Path
UnmergedLeaves Structure
The unmerged leaves list is maintained as a sorted vector:Properties
- Always kept in sorted order
- Binary search used for insertion
- Duplicate prevention during insertion
Creating UnmergedLeaves
Blank Parent Nodes
Blank parent nodes represent empty positions:- Have no encryption key
- Have no parent hash
- Have empty unmerged leaves
- Are represented as
Nonein exported trees
Wire Format
Parent nodes are serialized as:Tree Navigation
Parent nodes are accessed by index:Security Considerations
- Parent Hash Validation: Always validate parent hashes when importing trees
- Unmerged Leaves: Track carefully to ensure proper key distribution
- Path Secrets: Never expose path secrets; only use through secure derivation
- Blank Nodes: Handle blank nodes correctly in path operations
See Also
- LeafNode - Leaf node structure
- RatchetTree - Complete tree structure
- TreeSync - RFC 9420 TreeSync
- Update Paths - Path encryption