UChainDB.ChainEngine.Cryptography.EcDsa.Secp256k1 1.0.0

Cryptography library of EcDsa Secp256k1 for UChainDB

Install-Package UChainDB.ChainEngine.Cryptography.EcDsa.Secp256k1 -Version 1.0.0
dotnet add package UChainDB.ChainEngine.Cryptography.EcDsa.Secp256k1 --version 1.0.0
<PackageReference Include="UChainDB.ChainEngine.Cryptography.EcDsa.Secp256k1" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UChainDB.ChainEngine.Cryptography.EcDsa.Secp256k1 --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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)

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)

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 285 7/9/2018