Skip to content

c0mm4nd/dart-secp256k1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dart-secp256k1

Pure secp256k1 implement for dart language.

secp256k1 refers to the parameters of the elliptic curve used in Bitcoin's public-key cryptography, and is defined in Standards for Efficient Cryptography (SEC) (Certicom Research, http://www.secg.org/sec2-v2.pdf). Currently Bitcoin uses secp256k1 with the ECDSA algorithm, though the same curve with the same public/private keys can be used in some other algorithms such as Schnorr.

Usage

A simple usage example:

var pk = PrivateKey.fromHex('c37c299bb7f5ffd8d9329d052983342a8c3234ff3b3fa32a292187341f7146d7');
var pub = pk.publicKey;
print(pub.toHex());
print(pub.toCompressedHex());

var messageHash = 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9';
var sig = pk.signature(messageHash);
print(sig.verify(pub, messageHash)); // true

Features and bugs

WARN: This lib does not not provide deterministic ECDSA signature!

Please file feature requests and bugs at the issue tracker.

About

Fucking dart!!! Force me to write all deps!!!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages