NostrNet.Marmot.Mls.Native
0.1.0-preview8
dotnet add package NostrNet.Marmot.Mls.Native --version 0.1.0-preview8
NuGet\Install-Package NostrNet.Marmot.Mls.Native -Version 0.1.0-preview8
<PackageReference Include="NostrNet.Marmot.Mls.Native" Version="0.1.0-preview8" />
<PackageVersion Include="NostrNet.Marmot.Mls.Native" Version="0.1.0-preview8" />
<PackageReference Include="NostrNet.Marmot.Mls.Native" />
paket add NostrNet.Marmot.Mls.Native --version 0.1.0-preview8
#r "nuget: NostrNet.Marmot.Mls.Native, 0.1.0-preview8"
#:package NostrNet.Marmot.Mls.Native@0.1.0-preview8
#addin nuget:?package=NostrNet.Marmot.Mls.Native&version=0.1.0-preview8&prerelease
#tool nuget:?package=NostrNet.Marmot.Mls.Native&version=0.1.0-preview8&prerelease
<p align="center"> <img src="https://raw.githubusercontent.com/Galaxoid-Labs/NostrNet/main/logo.png" alt="NostrNet" width="320" /> </p>
NostrNet.Marmot.Mls.Native
OpenMLS-backed IMarmotMlsProvider implementation for
NostrNet.Marmot. Wire
bytes are RFC 9420 compliant by construction — the package wraps
OpenMLS (Rust) via an in-tree FFI
bridge.
Install
dotnet add package NostrNet.Marmot.Mls.Native --prerelease
--prerelease is required while the current releases are tagged
-previewN; drop it once a stable v0.1.0 ships.
The package ships pre-built native binaries for the supported runtime identifiers. No Rust toolchain required at consume time.
Supported RIDs:
linux-x64,linux-arm64osx-x64,osx-arm64win-x64,win-arm64
(Mobile RIDs ios-arm64 / android-arm64 aren't shipped yet — iOS
needs static linking + .NET workload integration; Android needs NDK
packaging. Tracking separately.)
Quickstart
using NostrNet.Marmot;
using NostrNet.Marmot.Mls.Native;
// In-memory state (lost on dispose):
using var provider = new OpenMlsProvider();
// — or — persisted across process restarts:
// using var provider = OpenMlsProvider.OpenAtPath("/var/app/marmot.sqlite");
// Use the MarmotChat helpers exactly as documented in NostrNet.Marmot:
var ev = await MarmotChat.BuildKeyPackageEventAsync(provider, myKey, "default", relays);
// ... StartConversationAsync, StartGroupAsync, AddPeerAsync, RemovePeerAsync,
// RotateKeysAsync, EncryptMessageAsync, TryDecryptMessageAsync, ...
See NostrNet.Marmot's README
for the full API walkthrough including group operations.
What's inside the box
| Subsystem | Provided by |
|---|---|
| MLS protocol (RFC 9420) | OpenMLS 0.8 + RustCrypto |
| Storage backend | SQLite via openmls_sqlite_storage (rusqlite, bundled — no system SQLite required) |
| Crypto primitives | RustCrypto (X25519, Ed25519, AES-GCM, HKDF-SHA-256) |
| Wire format | OpenMLS-native (Welcomes, KeyPackages, Commits, PrivateMessages all in MLSMessage envelopes) |
Building from source
The Rust crate lives at nostrnet-marmot-native/.
A source build of this package requires cargo on PATH plus a C
compiler (used by the cc crate to build rusqlite's bundled SQLite).
See the main README's Development setup
for per-platform prerequisites.
The NostrNet.Marmot.Mls.Native.csproj invokes cargo build before
the .NET build via an MSBuild target, so a normal dotnet build from
the repo root is all you need locally.
Testing the pack pipeline locally
The prebuilt/ directory inside this project is gitignored — CI
populates it during release builds, and you can populate it yourself
to dry-run the pack:
# Build the host's release artifact.
cd nostrnet-marmot-native
cargo build --release
# Stage it under the host's RID slot.
# (Substitute the path/name for your platform: .so on Linux, .dll on Windows.)
mkdir -p ../src/NostrNet.Marmot.Mls.Native/prebuilt/osx-arm64
cp target/release/libnostrnet_marmot_native.dylib \
../src/NostrNet.Marmot.Mls.Native/prebuilt/osx-arm64/
# Pack.
cd ..
dotnet pack NostrNet.slnx -c Release -o ./local-nupkgs
# Inspect.
unzip -l local-nupkgs/NostrNet.Marmot.Mls.Native.*.nupkg
The resulting .nupkg will ship only the RID you populated. The full
multi-RID release happens through .github/workflows/release.yml.
Status
Pre-1.0 preview. Wire format is RFC 9420 (= what other MLS
implementations produce). Cross-implementation interop is verified
against White Noise
and the upstream mdk-core
reference — bidirectional 1:1 chat (KeyPackage publish + Welcome +
send/receive of MIP-03 kind-9 chat rumors) works end-to-end. API may
still change before 1.0; bump the ABI version in
nostrnet-marmot-native/src/lib.rs and the matching test whenever
the FFI surface changes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- NBitcoin.Secp256k1 (>= 4.0.0)
- NostrNet.Core (>= 0.1.0-preview8)
- NostrNet.Crypto (>= 0.1.0-preview8)
- NostrNet.Marmot (>= 0.1.0-preview8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview8 | 89 | 5/16/2026 |
| 0.1.0-preview7 | 60 | 5/15/2026 |
| 0.1.0-preview6 | 73 | 5/15/2026 |
| 0.1.0-preview5 | 64 | 5/15/2026 |
| 0.1.0-preview4 | 60 | 5/15/2026 |
| 0.1.0-preview3 | 68 | 5/15/2026 |
| 0.1.0-preview2 | 73 | 5/15/2026 |
| 0.1.0-preview19 | 190 | 5/18/2026 |
| 0.1.0-preview18 | 79 | 5/18/2026 |
| 0.1.0-preview17 | 69 | 5/18/2026 |
| 0.1.0-preview16 | 65 | 5/17/2026 |
| 0.1.0-preview15 | 68 | 5/17/2026 |
| 0.1.0-preview14 | 66 | 5/17/2026 |
| 0.1.0-preview13 | 70 | 5/17/2026 |
| 0.1.0-preview12 | 59 | 5/17/2026 |
| 0.1.0-preview11 | 78 | 5/17/2026 |
| 0.1.0-preview10 | 65 | 5/16/2026 |