Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'generator_secp256k1' #52

Open
susil-mohanty opened this issue Oct 27, 2021 · 6 comments
Open

ImportError: cannot import name 'generator_secp256k1' #52

susil-mohanty opened this issue Oct 27, 2021 · 6 comments

Comments

@susil-mohanty
Copy link

from pycoin.ecdsa import generator_secp256k1, sign, verify
import hashlib, secrets


ImportError Traceback (most recent call last)
in
----> 1 from pycoin.ecdsa import generator_secp256k1, sign, verify
2 import hashlib, secrets
3
4 def sha3_256Hash(msg):
5 hashBytes = hashlib.sha3_256(msg.encode("utf8")).digest()

ImportError: cannot import name 'generator_secp256k1'

@khaile
Copy link

khaile commented Nov 22, 2021

@susil-mohanty Seems the example code is outdated w/ the pycoin lib.
Let's try this instead

from pycoin.ecdsa.secp256k1 import secp256k1_generator

def sign_ecdsa_secp256k1(msg, priv_key):
    return secp256k1_generator.sign(priv_key, sha3_256(msg))


def verify_ecdsa_secp256k1(msg, sig, pub_key):
    return secp256k1_generator.verify(pub_key, sha3_256(msg), sig)

@vikas00074
Copy link

ImportError Traceback (most recent call last)
in
----> 1 from pycoin.ecdsa import sign, verify
2 import hashlib, secrets
3
4 def sha3_256Hash(msg):
5 hashBytes = hashlib.sha3_256(msg.encode("utf8")).digest()

ImportError: cannot import name 'sign', 'verify'

Same error is coming for sign and verify...

@MilanObrenovic
Copy link

ImportError Traceback (most recent call last) in ----> 1 from pycoin.ecdsa import sign, verify 2 import hashlib, secrets 3 4 def sha3_256Hash(msg): 5 hashBytes = hashlib.sha3_256(msg.encode("utf8")).digest()

ImportError: cannot import name 'sign', 'verify'

Same error is coming for sign and verify...

Im getting the same error...

@hcheng826
Copy link

I got the similar error as well 😢

@etherx-dev
Copy link

Just install https://github.com/richardkiss/pycoin/releases/tag/0.70 it should work fine.

@wsw109
Copy link

wsw109 commented Jan 31, 2024

You can try install the below version, it works for me.

pip install pycoin==0.70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants