Skip to content

Cryptography.EcDsa.Secp256k1 library for blockchain transaction signing and verifying

License

Notifications You must be signed in to change notification settings

SutuLabs/Cryptography.EcDsa.Secp256k1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChainEngine.Cryptography.EcDsa.Secp256k1

This library compiles transaction signing and verifying algorithm secp256k1 and SHA256 which is used in several blockchains like Bitcoin, EOS and Graphene-based Steem, Golos, BitShares and of course in blockchain database UChainDb.

Usage

using UChainDB.BingChain.Engine.Cryptography;

var signAlgo = new Secp256k1();
var pubKey = signAlgo.GetPublicKey(privKey);
var data = Encoding.UTF8.GetBytes(message);

// signing
var sig = signAlgo.Sign(privKey, data);

// verifying
var result = signAlgo.Verify(pubKey, sig, data);

Installation

Install-Package UChainDB.ChainEngine.Cryptography.EcDsa.Secp256k1

API

public byte[] GetPublicKey(byte[] privateKey)
public byte[] Sign(byte[] privateKey, byte[] data)
public byte[] Sign(byte[] privateKey, IEnumerable<byte[]> data)
public bool Verify(byte[] publicKey, byte[] sig, byte[] data)
public bool Verify(byte[] publicKey, byte[] sig, IEnumerable<byte[]> data)
public byte[] GetSharedKey(byte[] privKey, byte[] pubKeyFromOther)

License

MIT

About

Cryptography.EcDsa.Secp256k1 library for blockchain transaction signing and verifying

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages