Cryptography.ECDSA .NET lib v.2.0-2.1 from @steepshot team
Version 2.0
Increased speed of creating signatures ~ 300 times. The speed increase is achieved due to the use of a different signature generation mechanism based on the library https://github.com/bitcoin-core/secp256k1
Methods supported:
- Sign - an ordinary signature
- SignCompressedCompact - compressed signature
- GetPublicKey - getting the public key
- Base58.GetBytes - translate WIF key into a base58 form (needed to create a signature)
- GetMessageHash - hashes the message using sha256 (required to create a signature)
Version 2.1
Some of the methods for the library https://github.com/bitcoin-core/secp256k1 were translated from C to C#, which allowed to make a standardized, cross-platform assembly (.NET Standard) that can be connected to mobile solutions based on Xamarin.
Methods supported:
- GetMessageHash - hashes the message using sha256 (required to create a signature)
- SignCompressedCompact - a compressed signature in the canonical form. The solution is adapted for Graphene (65 bytes will be returned):
// code for recovery + compression code (compressed) + compact code (compact).
sig[0] = recid + 4 + 27
sig[1] - vector r = 32 bits
sig[33] - vector s = 32 bits
@steepshot great post keep on steeming ahead
This post received a 3.0% upvote from @randowhale thanks to @jimjam1210! For more information, click here!
Good project indeed, thanks for sharing and more success to you. Upvoted and following you in order to stay in touch and send in my support. Success.
good post. continue so.
Can you explain how the speed is increased? i don't quite understand the mechanism... @steepshot.
Hi, there are several popular implementations of secp256k1:
The fastest implementation is https://github.com/bitcoin-core/secp256k1/. This is achieved by the fact that the low-level library written on C using inline Assembly, Boolean logic, with minimum of method calls and memory allocate.
How can we use C code in C#:
Nice, thanks for this work. What are the next step?