GithubHelp home page GithubHelp logo

stacks-network / keylib-py Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 21.0 24 KB

Library for elliptic curve (ECDSA) private keys, public keys, and bitcoin addresses.

License: MIT License

Python 100.00%

keylib-py's People

Contributors

jcnelson avatar shea256 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keylib-py's Issues

A bug in pubkey_format

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

Move to fastecdsa package

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.