iceland2k14 / secp256k1

Python Library for Secp256k1 Bitcoin curve to do fast ECC calculation
MIT License
105 stars 54 forks source link

Pypy3 issue with hash160 address #16

Open telekall opened 2 years ago

telekall commented 2 years ago

Hi there: Quick question. I am using this library with pypy3 and seems to work fine with compress and uncompress btc address. But when try something like that: mykey = int(key,16) hash160 = ice.privatekey_to_h160(0, True, mykey).hex() print(hash160) I just got only 40 zeros = 0000000000000000000000000000000000000000 Can you spot a solution, thanks!

iceland2k14 commented 2 years ago

Can you tell me what was the key for which it is happening. Or is it a secret ??

telekall commented 2 years ago

hi, The key is just a decimal number like :18446744073709551616. Again, works fine with pure python, but with pypy3 just got a bunch of zeros.

pianist-coder commented 2 years ago

pypy and pypy3 doesn't support ctypes and finite fields operations. And pure python with ctypes is faster, than pypy.

If you want use pypy, use this with pure python scripts or with cffi.

Grayesso commented 1 year ago

Hi there: Quick question. I am using this library with pypy3 and seems to work fine with compress and uncompress btc address. But when try something like that: mykey = int(key,16) hash160 = ice.privatekey_to_h160(0, True, mykey).hex() print(hash160) I just got only 40 zeros = 0000000000000000000000000000000000000000 Can you spot a solution, thanks!

pypy no work with DLL !