NBip32Fast 2.0.6
dotnet add package NBip32Fast --version 2.0.6
NuGet\Install-Package NBip32Fast -Version 2.0.6
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="NBip32Fast" Version="2.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NBip32Fast" Version="2.0.6" />
<PackageReference Include="NBip32Fast" />
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 NBip32Fast --version 2.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NBip32Fast, 2.0.6"
#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 NBip32Fast@2.0.6
#: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=NBip32Fast&version=2.0.6
#tool nuget:?package=NBip32Fast&version=2.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NBip32Fast
High perfomance and low allocation BIP-32 HD key derivation library for .NET 9+
Usage
Basic
var der = new Bip32Key();
Secp256K1HdKey.Instance.DerivePath("m/44'/0'/0'/0/0", seed, ref der);
NistP256HdKey.Instance.DerivePath("m/44'/0'/0'/0/0", seed, ref der);
Ed25519HdKey.Instance.DerivePath("m/44'/0'/0'/0'/0'", seed, ref der);
Extended (tree-like)
var master = new Bip32Key();
Ed25519HdKey.Instance.DerivePath("m/44'/888'/0'/0'", seed, ref master);
var accounts = new List<byte[]>();
var derResult = new Bip32Key();
for (var i = 0u; i < 5u; i++)
{
Ed25519HdKey.Instance.Derive(ref master, KeyPathElement.Hard(i), ref derResult);
accounts.Add(Ed25519HdKey.Instance.GetPublic(derResult.Key));
}
Benchmarks
AMD Ryzen Threadripper 7980X 64-Cores 2.18GHz, 1 CPU, 128 logical and 64 physical cores (lower values is better)
SecP256K1
| Method | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|
| NBip32FastKey | 36.08 us | 0.042 us | 0.037 us | 1.00 | 0.00 | 104 B | 1.00 |
| NBitcoinKey | 884.07 us | 3.557 us | 3.327 us | 24.50 | 0.09 | 9296 B | 89.38 |
| NetezosKey | 931.24 us | 5.300 us | 4.958 us | 25.81 | 0.14 | 3281497 B | 31,552.86 |
Ed25519
| Method | Mean | Error | StdDev | Ratio | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|
| NBip32FastKey | 7.186 us | 0.0119 us | 0.0106 us | 1.00 | 104 B | 1.00 |
| NetezosKey | 8.738 us | 0.0243 us | 0.0216 us | 1.22 | 5448 B | 52.38 |
| P3HdKey | 9.460 us | 0.0338 us | 0.0300 us | 1.32 | 6112 B | 58.77 |
NistP256
| Method | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|
| NBip32FastKey | 167.2 us | 0.53 us | 0.49 us | 1.00 | 0.00 | 608 B | 1.00 |
| NetezosKey | 1,483.8 us | 11.86 us | 10.51 us | 8.87 | 0.07 | 7029510 B | 11,561.69 |
Parse + .ToString() KeyPath
| Method | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|
| NBip32FastParse | 41.12 ns | 0.071 ns | 0.060 ns | 1.00 | 0.00 | 56 B | 1.00 |
| NBitcoinParse | 292.12 ns | 1.571 ns | 1.469 ns | 7.10 | 0.04 | 1104 B | 19.71 |
| NetezosParse | 317.28 ns | 1.028 ns | 0.962 ns | 7.72 | 0.03 | 992 B | 17.71 |
TODOs
- Ed25519 soft derivation scheme (used in
Cardano) -
KeyPathTreefor efficient computing (for multiple keypath merging and index depth) -
HDKeyrefactoring with public key lazy addition - More testing
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on NBip32Fast:
| Package | Downloads |
|---|---|
|
DotNut
A full C# native implementation of the Cashu protocol |
|
|
NBip32Fast.Ed25519
Blazing fast Ed25519 bip-32 keypath derivation subpackage |
|
|
NBip32Fast.Secp256K1
Blazing fast SecP256k1 bip-32 keypath derivation subpackage |
|
|
NBip32Fast.NistP256
Blazing fast NistP256 (SecP256r1) bip-32 keypath derivation subpackage |
GitHub repositories
This package is not used by any popular GitHub repositories.