stacks-network / keylib-py Goto Github PK
View Code? Open in Web Editor NEWLibrary for elliptic curve (ECDSA) private keys, public keys, and bitcoin addresses.
License: MIT License
Library for elliptic curve (ECDSA) private keys, public keys, and bitcoin addresses.
License: MIT License
Thank for your work on Keylib, but I meet some trouble when I want to generate PubKey from PrivateKey which is generated successfully.
I traced the bug and found it was about the length of pubkey, but I dont know which step is wrong, could you please help me? I really appreciate it.
the bug information is as followed:
private_key = ECPrivateKey()
private_key.to_hex()
'87afe6f0592829b21ad1a1571c4da84046cf6633356c609221ba2ee2d1c4211901'
private_key.to_wif()
'L1mU9f3yFPeVfNYrrzZs8tGxGiqUEnF3VxwUKLYLTgH6RtFBsfaf'
public_key = private_key.public_key()
Traceback (most recent call last):
File "", line 1, in
File "//keylib/private_key.py", line 92, in public_key
bin_public_key_string = compress(bin_public_key_string)
File "//keylib/key_formatting.py", line 337, in compress
f = get_pubkey_format(pubkey)
File "/*/keylib/key_formatting.py", line 266, in get_pubkey_format
raise Exception("Pubkey not in recognized format")
Exception: Pubkey not in recognized format
In developing the performance-sensitive parts of Blockstack CLI, I noticed that the ecdsa
package is very, very slow. For example, it takes ~200 milliseconds to convert a private key from WIF format to hexadecimal. This isn't a problem with keylib
, but it affects every keylib
method that uses ecdsa
to do the heavy lifting.
I've already moved the storage signing/verifying logic in Blockstack CLI over to fastecdsa
to relive this, with excellent results (~30x speed improvement). However, it would be good to simply drop ecdsa
whenever possible from our packages. For example, the storage logic can't rely many parts of keylib
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.