Skip to main content

Crate de_mls

Crate de_mls 

Source
Expand description

§DE-MLS: Decentralized MLS Chat Protocol

A library for building decentralized, end-to-end encrypted chat applications using the MLS (Messaging Layer Security) protocol with consensus-based membership management.

§Modules

The library carries no transport. The reference delivery service (the DeliveryService trait + Waku implementation) lives in the de-mls-ds crate, and the reference integrator (User) in de-mls-gateway.

§Getting Started

The library exposes the per-conversation Conversation handle. It carries no transport: it buffers outbound and consumes inbound payloads, and the integrator owns routing. A ready-to-use reference integrator (the multi-conversation User with registry + routing + lifecycle over a transport) lives in the de-mls-gateway crate.

Integrators drain ConversationEvent from each conversation (for transport and UI delivery), feed inbound packets to the conversation, and dispatch the returned outcomes.

§Quick Example

use de_mls::Conversation;

// Build a conversation from direct arguments: the OpenMLS provider,
// credential + ciphersuite, the plug-in instances, and a consensus service.
let mut conversation = Conversation::create(
    "de-mls-test", provider, credential, ciphersuite, &signer,
    scoring, steward, consensus, app_id, config, member_id,
)?;

// Send a chat message — buffered, never auto-sent.
conversation.send_message(b"Hello, world!".to_vec(), &signer)?;

// Drain outbound and publish it on your own transport.
for out in conversation.drain_outbound() { /* publish */ }

Re-exports§

pub use consensus::ConsensusApplyResult;
pub use consensus::ConsensusPlugin;
pub use consensus::ConsensusServiceFor;
pub use consensus::CreatorVote;
pub use consensus::SyncConsensusReceiver;
pub use consensus::apply_consensus_result;
pub use conversation::*;
pub use error::*;
pub use events::*;
pub use freeze::*;
pub use peer_scoring::*;
pub use process_result::*;
pub use proposal_kind::*;
pub use steward_list::*;

Modules§

consensus
Consensus plug-in contract, outcome application, and voting. Consensus integration: the plug-in contract, outcome application, and the conversation-side opening/voting/bridge machinery.
conversation
The Conversation handle, per-conversation state, state machine, and inbound dispatch. Per-conversation state and the Conversation handle.
defaults
Reference implementations of the library’s plug-in traits — in-memory MLS / peer-score storage, default consensus + per-conversation plug-in bundles, and a reference key-package provider. Production integrators swap one or more for their own implementations. Default implementations of the library’s non-MLS plug-in traits.
error
Library error types. Library error type: ConversationError, raised by conversation operations.
events
Conversation-event types produced for the integrator. I/O contract between the protocol layer and an integrator.
freeze
Freeze round candidate processing, selection, and commit application. Freeze round candidate processing, selection, and commit application.
mls_crypto
MLS cryptographic operations: OpenMLS wrapper for encryption/decryption. MLS cryptographic operations for DE-MLS.
peer_scoring
Peer-scoring plug-in: vocabulary, traits, and reference service. Peer-scoring vocabulary, traits, reference PeerScoringService, and score-derivation helpers.
phase_timer
Wall-clock anchor combined with the conversation state machine. App-side phase timer.
process_result
ProcessResult returned by inbound processing. ProcessResult returned by decode_inbound_payload plus protobuf ↔ message-envelope From impls.
proposal_kind
Proposal classification. Classification of ConversationUpdateRequests by protocol role.
protos
Protobuf message definitions, plus constructors for the common request shapes.
steward_list
Steward-list plug-in: deterministic roster and rotation queries. Steward list plug-in: deterministic roster and rotation queries.