Keysmith.Net 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Keysmith.Net --version 0.3.0
                    
NuGet\Install-Package Keysmith.Net -Version 0.3.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="Keysmith.Net" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Keysmith.Net" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Keysmith.Net" />
                    
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 Keysmith.Net --version 0.3.0
                    
#r "nuget: Keysmith.Net, 0.3.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.
#addin nuget:?package=Keysmith.Net&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Keysmith.Net&version=0.3.0
                    
Install as a Cake Tool

Keysmith.Net

Modern .NET9 library implementing common cryptographic standards used by various cryptocurrencies like BIP32, BIP39 and BIP44.

The intention of this library is to provide minimal no boilerplate implemenations of these cryptographic primitives while maintaining the best possible performance using the latest language features.

Features

BIP39

Converts mnemonic words to the seed used for deriving private keys.

Only supports the english wordlist.

Usage
byte[] seed = BIP39.MnemonicToSeed("[mnemonics]");
//Or using spans
Span<byte> seed = stackalloc byte[256];
BIP39.TryMnemonicToSeed(seed, "[mnemonics]")
Performance

<img src="./img/bip39_bench.png" />

BIP32

Takes the seed calculated using BIP39 and derives the master private key and child keys using BIP44 derivation paths.

Currently only supports Secp256k1.

Usage
(byte[] key, byte[] chainCode) = BIP32.DerivePath(
    ECCurves.Secp256k1,
    TestData.Seed_6_Words,
    "m/44'/60'/0'/0/0"
);
//Or using spans
Span<byte> key = stackalloc byte[32];
Span<byte> chainCode = stackalloc byte[32];
Span<uint> path = stackalloc uint[5];
BIP44.Ethereum(path);
BIP32.TryDerivePath(
    ECCurves.Secp256k1,
    seed,
    key,
    chainCode,
    path
);
Performance

<img src="./img/bip32_bench.png" />

BIP44

Defines the format for derivation paths used for Bitcoin and a lot of other chains following the same spec.

This library defines helper methods to construct these paths to be used for BIP32 derivation.

Usage
string path = BIP44.Ethereum(5);
//     ^ "m/44'/60'/0'/0/5"
// Or using spans
Span<uint> path = stackalloc uint[5];
BIP44.Ethereum(path, 5);
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.
  • net9.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Keysmith.Net:

Package Downloads
EtherSharp

Package Description

Keysmith.Net.Secp256k1

Secp256k1 implementation for Keysmith.Net

Keysmith.Net.ED25519

ED25519 implementation for Keysmith.Net

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.1 1,511 3/25/2025
1.3.0 1,315 12/23/2024
1.2.2 136 11/21/2024
1.2.1 117 11/21/2024
1.2.0 122 11/21/2024
1.1.2 115 11/21/2024
1.1.1 112 11/21/2024
1.1.0 117 11/21/2024
1.0.1 122 11/18/2024
1.0.0 117 11/18/2024
0.5.0 119 11/18/2024
0.4.0 113 11/18/2024
0.3.0 118 11/18/2024
0.2.1 115 11/17/2024
0.2.0 106 11/17/2024
0.1.0 104 11/17/2024