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
//! # DE-MLS: Decentralized MLS Chat Protocol
//!
//! A library for building decentralized, end-to-end encrypted group chat applications
//! using the MLS (Messaging Layer Security) protocol with consensus-based membership management.
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────────────┐
//! │ Your Application │
//! └───────────────────────────────┬─────────────────────────────────────┘
//! │
//! ┌───────────────────────┼───────────────────────┐
//! ▼ ▼ ▼
//! ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
//! │ core │ │ mls_crypto │ │ ds │
//! │ (protocol) │ │ (encryption) │ │ (transport) │
//! └───────────────┘ └───────────────┘ └───────────────┘
//! │ │ │
//! └───────────────────────┼───────────────────────┘
//! ▼
//! ┌───────────────┐
//! │ app │
//! │ (reference) │
//! └───────────────┘
//! ```
//!
//! ## 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-group 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::GroupEventHandler`])
//! - Core operations (create group, join, send messages)
//! - The ProcessResult → DispatchAction flow
//!
//! If you want a ready-to-use solution, see [`app::User`] which provides complete
//! group management with state machine and epoch handling.
//!
//! ## Quick Example
//!
//! ```ignore
//! use de_mls::core::{DefaultProvider, GroupEventHandler};
//! use de_mls::app::User;
//!
//! // Create a user with an Ethereum private key
//! let user: User<DefaultProvider> = User::with_private_key(
//! "0xac0974...", // Private key
//! consensus, // Consensus service
//! handler, // Your GroupEventHandler implementation
//! )?;
//!
//! // Create a group (as steward)
//! user.create_group("my-group", true).await?;
//!
//! // Send a message
//! user.send_message("my-group", b"Hello, world!").await?;
//! ```
/// Protocol implementation: message processing, consensus, and group operations.
/// Reference application layer: multi-group management and state machine.
/// Delivery service: transport-agnostic messaging.
/// Enable the **`waku`** feature for the Waku relay implementation.
/// MLS cryptographic operations: OpenMLS wrapper for encryption/decryption.
/// Protobuf message definitions.