Chrysalis.Crypto 1.6.0-alpha

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

<div align="center"> <h1>Chrysalis</h1> <p><strong>A native .NET toolkit for Cardano blockchain development</strong></p>

<a href="https://www.nuget.org/packages/Chrysalis"> <img src="https://img.shields.io/nuget/vpre/Chrysalis.svg?style=flat-square" alt="NuGet"> </a> <a href="https://github.com/SAIB-Inc/Chrysalis/blob/main/LICENSE.md"> <img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" alt="License"> </a> <a href="https://github.com/SAIB-Inc/Chrysalis/stargazers"> <img src="https://img.shields.io/github/stars/SAIB-Inc/Chrysalis.svg?style=flat-square" alt="Stars"> </a> <a href="https://dotnet.microsoft.com/download"> <img src="https://img.shields.io/badge/.NET-10.0-512BD4?style=flat-square" alt=".NET"> </a> <a href="https://cardano.org/"> <img src="https://img.shields.io/badge/Cardano-Compatible-0033AD?style=flat-square" alt="Cardano"> </a> </div>

<br>

CBOR serialization, transaction building, wallet management, Ouroboros mini-protocols, and a pure managed Plutus VM — everything you need to build on Cardano in .NET.

Installation

dotnet add package Chrysalis --prerelease

Or install individual packages:

dotnet add package Chrysalis.Codec   --prerelease   # CBOR serialization + source generation
dotnet add package Chrysalis.Network --prerelease   # Ouroboros mini-protocols (N2C/N2N)
dotnet add package Chrysalis.Tx      --prerelease   # Transaction building + fee calculation
dotnet add package Chrysalis.Wallet  --prerelease   # Key management + address handling
dotnet add package Chrysalis.Plutus  --prerelease   # Pure managed UPLC/CEK machine

Packages

Package Description
Chrysalis.Codec Attribute-driven CBOR serialization with source-generated encoders/decoders
Chrysalis.Codec.CodeGen Source generator for compile-time CBOR dispatch + CIP-0057 blueprint codegen
Chrysalis.Network Ouroboros N2C/N2N mini-protocols with pipelined ChainSync + BlockFetch
Chrysalis.Tx TransactionBuilder, MintBuilder, OutputBuilder, fee/collateral calculation
Chrysalis.Plutus Pure C# UPLC interpreter — 999/999 conformance tests, no native dependencies
Chrysalis.Wallet BIP-39 mnemonic, BIP-32 HD key derivation, Bech32 addresses
Chrysalis.Crypto Ed25519 signatures, Blake2b hashing

Blueprint Codegen

Drop an Aiken-compiled plutus.json into your project and get fully typed, serializable C# types at compile time.


<ItemGroup>
  <PackageReference Include="Chrysalis.Codec" Version="*-*" />
  <PackageReference Include="Chrysalis.Codec.CodeGen" Version="*-*"
                    OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
  <AdditionalFiles Include="plutus.json" />
</ItemGroup>

The source generator reads CIP-0057 blueprint schemas and emits records with full CBOR serialization — types appear in IntelliSense immediately:

using MyProject.Blueprint;

// Construct from values — serializes byte-identical to Aiken's cbor.serialise
var credential = VerificationKeyCredential.Create(PlutusBoundedBytes.Create(keyHash));
var address = Address.Create(credential, None<ICredential>.Create());
var datum = SimpleDatum.Create(address, PlutusInt.Create(1_000_000),
    PlutusBoundedBytes.Create(tag), PlutusTrue.Create());

byte[] cbor = CborSerializer.Serialize(datum);

// Deserialize back into the generated type
SimpleDatum decoded = CborSerializer.Deserialize<SimpleDatum>(cbor);

<details> <summary>Define types manually (without a blueprint)</summary>

[PlutusData(0)]
public partial record MyDatum(
    [CborOrder(0)] byte[] Owner,
    [CborOrder(1)] ulong Amount
) : CborRecord;

[CborSerializable]
[CborUnion]
public abstract partial record MyRedeemer : CborRecord;

[PlutusData(0)]
public partial record Spend([CborOrder(0)] long OutputIndex) : MyRedeemer;

[PlutusData(1)]
public partial record Cancel() : MyRedeemer;

</details>

Transaction Building

TransactionBuilder builder = TransactionBuilder.Create(pparams);

builder.AddInput("a1b2c3d4...#0");

builder.AddOutput("addr_test1qz...", Lovelace.Create(5_000_000))
    .WithInlineDatum(myDatum)
    .WithMinAda(pparams.AdaPerUTxOByte)
    .Add();

// Multi-asset outputs
IValue value = Value.FromLovelace(2_000_000)
    .WithToken(policyHex, assetNameHex, 100);
builder.AddOutput("addr_test1qz...", value).Add();

// Minting
builder.AddMint(policyHex, assetNameHex, 1_000);

// Sign and submit
ITransaction signed = tx.Sign(paymentKey, stakeKey);
string txHash = await provider.SubmitTransactionAsync(signed);

<details> <summary>Value arithmetic</summary>

IValue total = value1.Merge(value2);
IValue remaining = total.Subtract(spent);
ulong? qty = value.QuantityOf(policyHex, assetNameHex);
Dictionary<string, ulong> assets = value.ToAssetDictionary();

</details>

<details> <summary>Read inline datums</summary>

MyDatum? datum = output.InlineDatum<MyDatum>();
ReadOnlyMemory<byte>? rawCbor = output.InlineDatumRaw();

</details>

Wallet

Mnemonic mnemonic = Mnemonic.Generate(24);

PrivateKey accountKey = mnemonic.GetRootKey().DeriveCardanoAccountKey();
PrivateKey paymentKey = accountKey.DerivePaymentKey();
PublicKey stakingPub = accountKey.DeriveStakeKey().GetPublicKey();

Address address = Address.FromPublicKeys(
    NetworkType.Testnet, AddressType.BasePayment,
    paymentKey.GetPublicKey(), stakingPub);

Node Communication

// N2C: local node via Unix socket
NodeClient node = await NodeClient.ConnectAsync("/ipc/node.socket");
await node.StartAsync(networkMagic);

var tip = await node.LocalStateQuery.GetTipAsync();
var utxos = await node.LocalStateQuery.GetUtxosByAddressAsync([addressBytes]);
await node.LocalTxSubmit.SubmitTxAsync(signedTxBytes);

// N2N: remote node via TCP with pipelined sync
PeerClient peer = await PeerClient.ConnectAsync("relay.cardano.org", 3001);
await peer.StartAsync(networkMagic);
await peer.ChainSync.FindIntersectionAsync([Point.Origin], ct);

Plutus VM

Pure managed UPLC interpreter — no Haskell, no Rust, no FFI. 999/999 conformance tests covering Plutus V1-V3, all 94 builtins, and BLS12-381 cryptographic primitives.

IReadOnlyList<EvaluationResult> results = ScriptContextBuilder.EvaluateTx(
    body, witnessSet, utxos, SlotNetworkConfig.Preview);

foreach (var r in results)
    Console.WriteLine($"[{r.RedeemerTag}:{r.Index}] mem={r.ExUnits.Mem} steps={r.ExUnits.Steps}");

The transaction builder uses the VM automatically — no external evaluator needed.

Performance

Benchmarks against Pallas (Rust) and Gouroboros (Go) on Conway-era blocks.

N2N (TCP) — Pipelined ChainSync from origin:

Headers Only Full Blocks + Deser
Chrysalis (.NET) ~35,000 blk/s ~9,500 blk/s
Gouroboros (Go) ~15,000 blk/s N/A
Pallas (Rust) N/A ~720 blk/s

N2C (Unix Socket) — 10,000 blocks, sequential:

With Deserialization Network Only
Chrysalis (.NET) ~3,050 blk/s ~3,080 blk/s
Pallas (Rust) ~3,040 blk/s ~3,010 blk/s
Gouroboros (Go) ~2,600 blk/s

N2C is bottlenecked by the node — all three converge around the same throughput. Chrysalis and Pallas are neck and neck.

<details> <summary>How it's fast</summary>

  • Batch burst pipelining — send N header requests, drain N responses, BlockFetch the batch
  • Zero-copy deserializationReadOnlyMemory<byte> throughout, no intermediate allocations
  • Source-generated CBOR dispatch — compile-time probe-based union resolution via PeekState/PeekTag
  • System.IO.Pipelines — backpressure-aware async I/O with minimal buffer copies

AMD Ryzen 9 9900X3D, .NET 10. Full results in benchmarks/BENCHMARKS.md. </details>

Era Support

Era Serialization Block Processing Tx Building Script Eval
Byron
Shelley
Allegra
Mary
Alonzo
Babbage
Conway

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m 'feat: add my feature'
  4. Push and open a Pull Request

License

MIT — see LICENSE.md.


<div align="center"> <p>Built by <a href="https://saib.dev">SAIB Inc</a> for the Cardano community</p> </div>

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.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Chrysalis.Crypto:

Package Downloads
Chrysalis.Wallet

Package Description

Chrysalis.Plutus

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.0-alpha 0 3/18/2026
1.5.0-alpha 36 3/14/2026
1.4.0-alpha 36 3/12/2026
1.3.0-alpha 38 3/11/2026
1.2.3-alpha 38 3/9/2026
1.2.2-debug001 41 3/9/2026
1.2.2-alpha 35 3/9/2026