Meshline.Sdk
1.2.0
dotnet add package Meshline.Sdk --version 1.2.0
NuGet\Install-Package Meshline.Sdk -Version 1.2.0
<PackageReference Include="Meshline.Sdk" Version="1.2.0" />
<PackageVersion Include="Meshline.Sdk" Version="1.2.0" />
<PackageReference Include="Meshline.Sdk" />
paket add Meshline.Sdk --version 1.2.0
#r "nuget: Meshline.Sdk, 1.2.0"
#:package Meshline.Sdk@1.2.0
#addin nuget:?package=Meshline.Sdk&version=1.2.0
#tool nuget:?package=Meshline.Sdk&version=1.2.0
Meshline .NET SDK
.NET 10 · Assembly: Meshline.Sdk · Root namespace: Meshline
NuGet package · Release notes · Source
Developer guide · Complete API reference · Compilable examples
Meshline is a decentralized messaging and social protocol built around self-sovereign identity. Its .NET SDK provides the client workflows and protocol primitives for building applications on a Meshline network:
- Account routes, home-relay migration, device authorization, and profiles.
- Contacts, encrypted direct messages, channels, and encrypted groups.
- HTTP and WebSocket relay access, authentication, session renewal, and notification recovery.
- SQLite persistence, pending-operation recovery, local conversations, and snapshot queries.
- Protocol models, Canonical JSON, signature verification, and message encryption.
Use MeshlineClient to coordinate the client components, or compose the components independently. Construction performs no I/O. Applications supply account signing, relay registry access, and platform-specific secret protection.
The optional RpcRelayRegistry and Nep6AccountSigner adapters provide RPC registry access and NEP-6 wallet signing. Applications choose and register the adapters explicitly; platform-specific secret protection remains application-provided. See the integration guide.
Installation
Target net10.0 and install the package:
dotnet add package Meshline.Sdk
SQLite and its EF Core provider are included. Each local account/device needs a writable database directory and persistent secret-protection keys. For source builds and project references, see Maintenance.
Quick start
This example establishes a new account. Supply a trusted registry, matching account signer, persistent secret protector, a database path dedicated to this network/account/device, and your application loop. See application integrations for their contracts.
using Meshline;
using Meshline.Interactions;
using Meshline.Models.Client;
using Meshline.Storage;
using Meshline.Transport;
public static class MeshlineExample
{
public static async Task RunNewAccountAsync(
IRelayRegistry registry,
IAccountSigner signer,
ISecretProtector protector,
string databasePath,
Func<MeshlineClient, CancellationToken, Task> runApplication,
CancellationToken cancellationToken = default)
{
var options = new ClientOptions
{
Context = registry.Context,
AccountId = signer.AccountId
};
var database = new DatabaseOptions { Path = Path.GetFullPath(databasePath) };
Directory.CreateDirectory(Path.GetDirectoryName(database.Path)!);
await MeshlineDatabase.MigrateAsync(database, cancellationToken);
await using var pool = new RelayClientPool(options, registry);
await using var client = new MeshlineClient(options, database, pool, protector, signer);
client.BackgroundError += (_, error) =>
Console.Error.WriteLine($"{error.Operation}: {error.Error}");
await client.InitializeAsync(cancellationToken);
await client.EstablishAccountAsync(cancellationToken: cancellationToken);
try
{
await client.StartAsync(cancellationToken);
await runApplication(client, cancellationToken);
}
finally
{
await client.StopAsync();
}
}
}
The compiled source is in Sessions.cs.
Establishment selects an eligible relay; pass AccountEstablishmentOptions.RelayId
to choose one. On an ordinary restart, initialize with the existing database and
protector, then start without establishing again. Choose account recovery explicitly
when authorization must be restored.
Build your application
| Task | Guide |
|---|---|
| Open, stop, and reopen a session | Quick start and lifecycle |
| Exchange contacts and messages | Contacts and sending, waiting, and outbox status |
| Refresh data and build message lists | Synchronization, pagination, and read positions |
| Add channels, groups, recovery, or custom transport | All guides |
| Diagnose a failure | Events and errors and troubleshooting |
Version and validation scope
Guides and the generated API reference follow the source checkout. Use the matching
release tag for an installed package; APIs on main may not yet be published.
Packages embed their README at release time and include XML documentation for IntelliSense.
Offline tests cover protocol, transport, persistence, and component workflows against scripted peers. Live-relay interoperability and cross-platform release validation, including mobile, browser, and NativeAOT, remain pending. These tests do not validate relay-server or DHT behavior. Applications own secret protection, content retrieval, and rendering. The protocol remains a Protocol 1.0 draft.
| 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
- BouncyCastle.Cryptography (>= 2.7.0)
- Microsoft.EntityFrameworkCore.Sqlite (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Nethermind.Multiformats.Address (>= 1.1.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.