AriaBsv.Core 0.5.1

dotnet add package AriaBsv.Core --version 0.5.1
                    
NuGet\Install-Package AriaBsv.Core -Version 0.5.1
                    
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="AriaBsv.Core" Version="0.5.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AriaBsv.Core" Version="0.5.1" />
                    
Directory.Packages.props
<PackageReference Include="AriaBsv.Core" />
                    
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 AriaBsv.Core --version 0.5.1
                    
#r "nuget: AriaBsv.Core, 0.5.1"
                    
#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 AriaBsv.Core@0.5.1
                    
#: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=AriaBsv.Core&version=0.5.1
                    
Install as a Cake Addin
#tool nuget:?package=AriaBsv.Core&version=0.5.1
                    
Install as a Cake Tool

aria-bsv — .NET SDK

C# / .NET 8 SDK for ARIA (Auditable Real-time Inference Architecture) — cryptographic accountability for AI systems, anchored on BSV blockchain via BRC-121.

NuGet License: MIT

Install

dotnet add package AriaBsv.Core

Quick start

using AriaBsv.Core;

var config = new AuditorConfig
{
    SystemId = "my-ai-system",
    ModelHashes = new Dictionary<string, string>
    {
        ["gpt-4o"] = "sha256:abc123..."
    }
};

var auditor = new InferenceAuditor(config);
await auditor.OpenEpochAsync();

await auditor.RecordAsync(new AuditRecord
{
    ModelId    = "gpt-4o",
    Input      = "What is 2+2?",
    Output     = "4",
    Confidence = 0.99
});

var summary = await auditor.CloseEpochAsync();
Console.WriteLine($"Epoch: {summary.EpochId}");
Console.WriteLine($"Merkle root: {summary.MerkleRoot}");

Classes

Hasher

Deterministic canonical JSON hashing (SHA-256), compatible with BRC-121.

using AriaBsv.Core;

// Hash any object (keys sorted, canonical JSON)
string hash = Hasher.HashObject(new { model = "gpt-4o", input = "hello" });
Console.WriteLine(hash); // sha256:abc123...

// Hash raw bytes
string raw = Hasher.HashBytes(Encoding.UTF8.GetBytes("hello world"));

// Get canonical JSON string
string json = Hasher.CanonicalJson(new { b = 2, a = 1 });
// {"a":1,"b":2}

MerkleTree

BRC-121 Merkle tree with second-preimage attack protection (leaf prefix 0x00, internal node prefix 0x01).

using AriaBsv.Core;

var tree = new MerkleTree();
tree.AddLeaf("record-hash-1");
tree.AddLeaf("record-hash-2");
tree.AddLeaf("record-hash-3");

string root = tree.Root();
bool valid = MerkleTree.Verify("record-hash-1", tree.Proof(0), root);

InferenceAuditor

High-level auditor that manages epoch lifecycle and Merkle accumulation.

using AriaBsv.Core;

var auditor = new InferenceAuditor(new AuditorConfig
{
    SystemId     = "production",
    ModelHashes  = new() { ["llama3"] = "sha256:..." }
});

await auditor.OpenEpochAsync();

await auditor.RecordAsync(new AuditRecord
{
    ModelId    = "llama3",
    Input      = "Summarize this document.",
    Output     = "This document covers...",
    Confidence = 0.95
});

var summary = await auditor.CloseEpochAsync();

AuditRecord

var record = new AuditRecord
{
    RecordId   = Guid.NewGuid().ToString(),  // auto-generated if omitted
    ModelId    = "gpt-4o",
    Input      = "user prompt",
    Output     = "model response",
    Confidence = 0.98,
    Timestamp  = DateTimeOffset.UtcNow
};

Running tests

dotnet test

Requirements

  • .NET 8+
  • System.Text.Json (included)

Compatibility

Hash and Merkle outputs are fully interoperable with the Python, Go, TypeScript, and Rust ARIA SDKs.

License

MIT — Juan Manuel Palencia Osorio

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
0.5.1 120 3/30/2026