Meshline.Sdk 1.2.0

dotnet add package Meshline.Sdk --version 1.2.0
                    
NuGet\Install-Package Meshline.Sdk -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meshline.Sdk" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meshline.Sdk" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Meshline.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Meshline.Sdk --version 1.2.0
                    
#r "nuget: Meshline.Sdk, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Meshline.Sdk@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Meshline.Sdk&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Meshline.Sdk&version=1.2.0
                    
Install as a Cake Tool

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.

Maintenance and contributing · MIT license

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.2.0 36 10/5/2026
1.1.0 47 10/3/2026
1.0.0 86 9/27/2026