SolSharp 3.0.0
Prefix ReservedSee the version list below for details.
dotnet add package SolSharp --version 3.0.0
NuGet\Install-Package SolSharp -Version 3.0.0
<PackageReference Include="SolSharp" Version="3.0.0" />
<PackageVersion Include="SolSharp" Version="3.0.0" />
<PackageReference Include="SolSharp" />
paket add SolSharp --version 3.0.0
#r "nuget: SolSharp, 3.0.0"
#:package SolSharp@3.0.0
#addin nuget:?package=SolSharp&version=3.0.0
#tool nuget:?package=SolSharp&version=3.0.0
SolSharp
A modern, contract-driven, Native AOT-ready .NET SDK for Solana — keys and signatures, program instructions, transaction wire formats, RPC, and WebSocket streaming. SolSharp is independently implemented in C# from pinned Anza Solana SDK, Agave, and SPL source contracts. No reflection is used by the library: JSON is source-generated, all four functional assemblies declare Native AOT compatibility, and CI native-publishes and runs a consumer of the packed package.
SolSharp is built for low latency with focused dependencies and a dependency-light Core. If you are writing bots, indexers, or backend services that talk to Solana from .NET and care about speed and control, this is aimed at you.
Why SolSharp
- Native AOT ready. Source-generated JSON (no reflection), trimmable, AOT-clean — ship a
self-contained native binary with instant startup. CI runs a native-compiled smoke test on every push
and pull request targeting
main. - Full pinned RPC coverage. The complete applicable non-admin JSON-RPC HTTP surface from the pinned Agave revision, including reads, send/simulate, airdrop,
batching, and multiplexed WebSocket subscriptions with automatic reconnect. Explicit account/program
subscription options preserve the effective legacy binary, base58, base64,
jsonParsedfallback, andbase64+zstdresponse union without publishing no-op Agave fields. - Wire-level control. Spec-accurate legacy, v0, and feature-gated SIMD-0385 V1 transaction building, signing, and decoding — money-critical encodings are checked against exact vectors from pinned Rust contracts, not only against C# round trips.
- Complete signing workflows. Typed Ed25519 and BLS12-381 values, local/external/null signers, partial signing, Rust-compatible key import/export, vote-account-bound BLS proofs of possession, PoP-gated same-message BLS aggregation, and domain-separated Solana off-chain messages.
- Traceable parity. Exact upstream commit pins, coverage boundaries, and exclusions are published in the Rust parity matrix; SolSharp is independently written and is not an official Anza/Solana product.
- Purposeful dependencies. A dependency-light Core, allocation-free hot paths and span-based APIs; the RPC resilience pipeline and vetted Ed25519/BLS backends are included deliberately.
- Measured quality. Across the four functional assemblies, the reproducible .NET 10 Linux unit-coverage baseline covers 93.7% of hand-written production lines. CI merges overlapping reports, excludes generated sources, publishes line and branch details, enforces a 90% repository-wide line floor, and rejects documentation that overstates the current result.
- Automated security gates. Pull requests run direct/transitive NuGet auditing, dependency review, and CodeQL's extended C# queries; scheduled scans rerun the audit and CodeQL and report OpenSSF supply-chain posture. Ordinary CI/release restores are locked to committed dependency graphs, 5,000 deterministic property-based hostile-input cases exercise transaction decoding per CI run, and the release workflow attaches the verified package, SHA-256 digest, and Sigstore/SLSA build provenance.
Compared with Solnet and the official Rust contracts
Solnet is an established, ecosystem-oriented .NET SDK. This compact comparison uses its published 8.7.0 release; SolSharp is release 3.0.0; the reference column is the pinned official Rust parity matrix.
| Capability | Official Rust SDK / Agave | SolSharp 3.0 | Solnet published 8.7.0 |
|---|---|---|---|
| Transactions | Legacy, V0, feature-gated SIMD-0385 V1 | Legacy/V0/V1 exact wire build, parse, signing, validation, and decompilation | Legacy/V0; the published decoder rejects versions above 0 |
| RPC / PubSub | 53 applicable request variants; nine subscription families and their effective config unions | 53/53 RPC; 9/9 PubSub, including exact HTTP/WS account-encoding unions, effective SubscribeAccountWithOptionsAsync / SubscribeProgramWithOptionsAsync configs, early signature events, and explicit V1 opt-ins |
50/53 RPC; 6/9 PubSub families |
| Programs | Canonical native and SPL crates | Deep native/SPL coverage, extensive Token-2022 interfaces, typed state/instruction decoders | Broader ecosystem program set; published package predates repository-head Token-2022 additions |
| Offline signing | Fixed slots, signer/presigner/null-signer, partial signing and verification | Typed fixed slots, partial/all signing, verified external signatures, Presigner / NullSigner |
Partial signing and externally supplied signatures |
| Deployment | Native Rust crates | One package, generated JSON metadata, declared AOT compatibility, native-publish CI | Five modular packages; no published solution-wide AOT/trimming contract |
| Provenance | Authoritative source | Seven immutable upstream pins and byte-level KATs | No immutable upstream revision matrix in published documentation |
Solnet repository head contains newer unreleased work; in particular, its current class named V1 does not yet use the pinned SIMD-0385 message body and message-first signature envelope. The full evidence-linked comparison is in the repository README.
Quick start
using SolSharp.Rpc;
using SolSharp.Wallet;
using SolSharp.Programs;
// DI with a built-in resilience pipeline (or: new SolanaRpcClient(httpClient))
services.AddSolanaRpc("https://your-rpc-endpoint");
var lamports = await rpc.GetBalanceAsync(account);
// Build, sign, and send a transfer
using var payer = Keypair.Parse(secret);
var blockhash = (await rpc.GetLatestBlockhashAsync()).Blockhash;
var tx = new TransactionBuilder()
.SetRecentBlockhash(blockhash)
.AddInstruction(SystemProgram.Transfer(payer.PublicKey, recipient, 1_000_000))
.Build(payer);
var signature = await rpc.SendAndConfirmTransactionAsync(tx.Serialize());
// WebSocket streaming
using SolSharp.Rpc;
using SolSharp.Rpc.Streaming;
await using var ws = new SolanaWsClient();
await ws.ConnectAsync(new Uri("wss://your-rpc-endpoint"));
await foreach (var slot in ws.SubscribeSlotsAsync())
Console.WriteLine(slot.Slot);
var accountChanges = await ws.SubscribeAccountWithOptionsAsync(
account,
new AccountSubscriptionOptions { Encoding = RpcAccountEncoding.JsonParsed });
Learn more
- Usage guide — a task-oriented cookbook: keys, export, mnemonics, signed off-chain messages, reads, SPL token state, priority fees, v0 + address lookup tables, SIMD-0385 V1, durable nonces, decoding transactions, subscriptions, batching, and confirmation.
- GitHub repository
- Changelog
- Upstream parity and provenance
- Third-party notices
Security
SolSharp handles private keys and builds transactions that move funds. It has not been audited —
use at your own risk. Never export a raw private key to an RPC provider, hosted service, or third-party
transaction builder: keep signing behind ISigner, inspect and simulate, then send only signed bytes.
A green security badge means the automated checks found no known issue at the tested revision. It is not a guarantee that the package is vulnerability-free and does not replace an independent security audit.
BLS operations use the packaged native blst backend on linux-x64, linux-arm64, osx-x64,
osx-arm64, and win-x64. Other RIDs can use the rest of SolSharp, but cannot call its BLS API.
To report a vulnerability, use the security policy — private reporting, not a public issue.
| 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.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Http.Resilience (>= 10.8.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Nethermind.Crypto.Bls (>= 1.1.0)
- SimpleBase (>= 5.6.4)
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 |
|---|---|---|
| 3.1.0 | 93 | 8/11/2026 |
| 3.0.0 | 180 | 8/10/2026 |
| 2.0.0 | 146 | 8/9/2026 |
| 1.3.0 | 288 | 7/30/2026 |
| 1.2.0 | 143 | 7/13/2026 |
| 1.1.0 | 130 | 7/3/2026 |
| 1.0.1 | 131 | 7/3/2026 |
| 1.0.0 | 123 | 7/2/2026 |
| 0.6.0 | 111 | 7/2/2026 |
| 0.5.0 | 115 | 7/1/2026 |
| 0.4.1 | 120 | 6/29/2026 |
| 0.4.0 | 130 | 6/28/2026 |
| 0.3.0 | 116 | 6/28/2026 |
| 0.2.0 | 139 | 6/26/2026 |
| 0.1.0 | 123 | 6/19/2026 |
| 0.1.0-alpha | 123 | 6/17/2026 |
3.0.0 — the .NET 10 and C# 14 toolchain release. The SolSharp package now targets net10.0; all library, test, benchmark, and Native AOT projects, dependency locks, CI/security/release jobs, and packed-package validation use the same stable .NET 10 SDK line. Contributor tooling now build-gates deterministic StyleCop member ordering and aligns Rider/ReSharper with Roslyn's target-typed object-creation style. BREAKING: 3.0.0 no longer provides net8.0 assets; consumers must target net10.0 (or a later compatible .NET target) and recompile. Full details: https://github.com/jecacs/SolSharp/blob/v3.0.0/CHANGELOG.md