Skip to content

dkackman/chia-dotnet-bls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chia-dotnet-bls

.NET BLS Library

.NET CodeQL Nuget

Introduction

Many thanks to Rigidity who's code this is a direct port of and and helped immensely along the way.

This is a direct port of the chia bls typescript library. Coding style and naming have been converted to C# conventions but otherwise it is very similar in API.

See Also

Example Usage

using chia.dotnet.bls;
using dotnetstandard_bip39; // https://www.nuget.org/packages/dotnetstandard-bip39/

const string MNEMONIC = "abandon abandon abandon";
const string MESSAGE = "hello world";

// create a secret key from a mnemonic
var bip39 = new BIP39();
var seed = bip39.MnemonicToSeedHex(MNEMONIC, "");
var sk = PrivateKey.FromSeed(seed);

// sign the message
var signature = sk.Sign(MESSAGE);

// verify the signature
var pk = sk.GetG1();
var result = pk.Verify(MESSAGE, signature);

Console.WriteLine($"Signature is valid: {result}");

chia and its logo are the registered trademark or trademark of Chia Network, Inc. in the United States and worldwide.