1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! # 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.
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────────────┐
//! │ Your Application │
//! └───────────────────────────────┬─────────────────────────────────────┘
//! │
//! ┌────────┴────────┐
//! │ app │
//! │ (reference impl,│
//! │ optional) │
//! └────────┬────────┘
//! │
//! ┌───────────────────────┼───────────────────────┐
//! ▼ ▼ ▼
//! ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
//! │ core │ │ mls_crypto │ │ ds │
//! │ (protocol) │ │ (encryption) │ │ (transport) │
//! └───────────────┘ └───────────────┘ └───────────────┘
//! ```
//!
//! ## Modules
//!
//! - **[`core`]** - Protocol implementation (message processing, consensus integration)
//! - **[`mls_crypto`]** - MLS cryptographic operations (OpenMLS wrapper)
//! - **[`ds`]** - Delivery service abstraction (Waku transport)
//! - **[`app`]** - Reference application layer (multi-conversation management, state machine)
//! - **[`protos`]** - Protobuf message definitions
//!
//! ## Getting Started
//!
//! Most developers should start with the [`core`] module documentation, which explains:
//! - What traits you need to implement (`core::SessionEvent`)
//! - Core operations (start conversation, join, send messages)
//! - The `ProcessResult` matching flow
//!
//! If you want a ready-to-use solution, see [`app::User`] which provides complete
//! conversation management with state machine and epoch handling.
//!
//! ## Quick Example
//!
//! ```ignore
//! use de_mls::app::User;
//!
//! // Build a user from your own `Identity` impl plus the default plug-in
//! // bundle. The library is identity-agnostic — anything implementing
//! // `de_mls::identity::Identity` works (wallet, Ed25519, account id, …).
//! let mut user = User::new_with_plugins(&identity, plugins, transport);
//!
//! // Start a conversation (as steward).
//! user.start_conversation("de-mls-test", true).await?;
//!
//! // Send a message.
//! user.send_app_message("de-mls-test", b"Hello, world!".to_vec()).await?;
//!
//! // Drain lifecycle + per-session events on your polling cycle.
//! for event in user.drain_lifecycle_events() { /* … */ }
//! ```
/// Protocol implementation.
/// Reference application layer.
/// Delivery service: transport-agnostic messaging.
/// Enable the **`waku`** feature for the Waku relay implementation.
/// MLS cryptographic operations: OpenMLS wrapper for encryption/decryption.
/// User-level identity, decoupled from MLS state.
/// 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.
pub
/// Protobuf message definitions.