Skip to content

Commit aae2c02

Browse files
erskingardneryukibtc
authored andcommitted
Add nostr-mls crate
Pull-Request: #843 Reviewed-by: Yuki Kishimoto <[email protected]> Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 9419df0 commit aae2c02

21 files changed

+3212
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* mls-storage: add new crate with traits and types for mls storage implementations ([JeffG] at https://github.com/rust-nostr/nostr/pull/836)
3434
* mls-memory-storage: add an in-memory implementation for MLS ([JeffG] at https://github.com/rust-nostr/nostr/pull/839)
3535
* mls-sqlite-storage: a sqlite implementation for MLS ([JeffG] at https://github.com/rust-nostr/nostr/pull/842)
36+
* mls: add new crate for implementing MLS messaging ([JeffG] at https://github.com/rust-nostr/nostr/pull/843)
3637

3738
## v0.41.0 - 2025/04/15
3839

Cargo.lock

Lines changed: 186 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ nostr-lmdb = { version = "0.41", path = "./crates/nostr-lmdb", default-features
2828
nostr-mls-memory-storage = { version = "0.41", path = "./crates/nostr-mls-memory-storage", default-features = false }
2929
nostr-mls-sqlite-storage = { version = "0.41", path = "./crates/nostr-mls-sqlite-storage", default-features = false }
3030
nostr-mls-storage = { version = "0.41", path = "./crates/nostr-mls-storage", default-features = false }
31+
nostr-mls = { version = "0.41", path = "./crates/nostr-mls", default-features = false }
3132
nostr-ndb = { version = "0.41", path = "./crates/nostr-ndb", default-features = false }
3233
nostr-relay-builder = { version = "0.41", path = "./crates/nostr-relay-builder", default-features = false }
3334
nostr-relay-pool = { version = "0.41", path = "./crates/nostr-relay-pool", default-features = false }

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The project is split up into several crates in the `crates/` directory:
1212
* [**nostr-lmdb**](./crates/nostr-lmdb): LMDB storage backend
1313
* [**nostr-ndb**](./crates/nostr-ndb): [nostrdb](https://github.com/damus-io/nostrdb) storage backend
1414
* [**nostr-indexeddb**](./crates/nostr-indexeddb): IndexedDB storage backend
15+
* [**nostr-mls**](./crates/nostr-mls): A library for implmenting NIP-EE MLS messaging
1516
* [**nostr-mls-storage**](./crates/nostr-mls-storage): Storage traits for using MLS messaging
1617
* [**nostr-mls-memory-storage**](./crates/nostr-mls-memory-storage): In-memory storage for nostr-mls
1718
* [**nostr-mls-sqlite-storage**](./crates/nostr-mls-sqlite-storage): Sqlite storage for nostr-mls

contrib/scripts/check-crates.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ buildargs=(
4444
"-p nostr-mls-storage"
4545
"-p nostr-mls-memory-storage"
4646
"-p nostr-mls-sqlite-storage"
47+
"-p nostr-mls"
4748
"-p nostr-indexeddb --target wasm32-unknown-unknown"
4849
"-p nostr-ndb"
4950
"-p nostr-keyring"
@@ -64,6 +65,7 @@ skip_msrv=(
6465
"-p nostr-mls-storage" # MSRV: 1.74.0
6566
"-p nostr-mls-memory-storage" # MSRV: 1.74.0
6667
"-p nostr-mls-sqlite-storage" # MSRV: 1.74.0
68+
"-p nostr-mls" # MSRV: 1.74.0
6769
"-p nostr-keyring" # MSRV: 1.75.0
6870
"-p nostr-keyring --features async" # MSRV: 1.75.0
6971
"-p nostr-sdk --features tor" # MSRV: 1.77.0

contrib/scripts/release.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ args=(
99
"-p nostr-mls-storage"
1010
"-p nostr-mls-memory-storage"
1111
"-p nostr-mls-sqlite-storage"
12+
"-p nostr-mls"
1213
"-p nostr-ndb"
1314
"-p nostr-indexeddb"
1415
"-p nostr-keyring"

crates/nostr-mls/Cargo.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[package]
2+
name = "nostr-mls"
3+
version = "0.41.0"
4+
edition = "2021"
5+
description = "A simplified interface to build secure messaging apps on nostr with MLS."
6+
authors = ["Jeff Gardner <[email protected]>", "Yuki Kishimoto <[email protected]>", "Rust Nostr Developers"]
7+
homepage.workspace = true
8+
repository.workspace = true
9+
license.workspace = true
10+
readme = "README.md"
11+
rust-version = "1.74.0"
12+
keywords = ["nostr", "mls", "openmls"]
13+
14+
[features]
15+
default = []
16+
test-utils = []
17+
18+
[dependencies]
19+
nostr = { workspace = true, features = ["std", "nip44"] }
20+
nostr-mls-storage.workspace = true
21+
openmls = { git = "https://github.com/openmls/openmls", rev = "4cc0f594b11262083ad9827b3b2033052c6ef99f", default-features = false }
22+
openmls_basic_credential = { git = "https://github.com/openmls/openmls", rev = "4cc0f594b11262083ad9827b3b2033052c6ef99f", default-features = false }
23+
openmls_rust_crypto = { git = "https://github.com/openmls/openmls", rev = "4cc0f594b11262083ad9827b3b2033052c6ef99f", default-features = false }
24+
openmls_traits = { git = "https://github.com/openmls/openmls", rev = "4cc0f594b11262083ad9827b3b2033052c6ef99f", default-features = false }
25+
tls_codec = "0.4"
26+
tracing = { workspace = true, features = ["std"] }
27+
28+
[dev-dependencies]
29+
nostr-mls-memory-storage.workspace = true
30+
nostr-mls-sqlite-storage.workspace = true
31+
tempfile = "3.8"
32+
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread"] }
33+
tracing-subscriber = { workspace = true, features = ["env-filter"] }
34+
35+
[[example]]
36+
name = "mls_memory"
37+
path = "examples/mls_memory.rs"
38+
39+
[[example]]
40+
name = "mls_sqlite"
41+
path = "examples/mls_sqlite.rs"

crates/nostr-mls/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Nostr Messaging Layer Security (MLS)
2+
3+
## Description
4+
5+
A simplified interface to build secure messaging apps on nostr with MLS ([RFC 9420](https://datatracker.ietf.org/doc/html/rfc9420)),
6+
according to [NIP-EE](https://github.com/nostr-protocol/nips/pull/1427).
7+
8+
## State
9+
10+
**This library is in an ALPHA state**, things that are implemented generally work but the API will change in breaking ways.
11+
12+
## Donations
13+
14+
`rust-nostr` is free and open-source. This means we do not earn any revenue by selling it. Instead, we rely on your financial support. If you actively use any of the `rust-nostr` libs/software/services, then please [donate](https://rust-nostr.org/donate).
15+
16+
## License
17+
18+
This project is distributed under the MIT software license - see the [LICENSE](../../LICENSE) file for details

0 commit comments

Comments
 (0)