shibu130 / bip44-bip39-bip84-wallet-gen-and-query

MIT License
3 stars 3 forks source link

I couldn't get it to work. #1

Open djmuratb opened 3 years ago

djmuratb commented 3 years ago

Hi,

Where am I doing wrong?

C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query>py script.py bip44 Traceback (most recent call last): File "C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query\script.py", line 138, in main(sys.argv[1:]) File "C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query\script.py", line 100, in main bip_obj_acc = bip_obj_mst.Purpose().Coin().Account(ACCOUNT_IDX) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip44.py", line 135, in Purpose return self._PurposeGeneric(self) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip44_base.py", line 364, in _PurposeGeneric return cls(bip_obj.m_bip32.ChildKey(cls._GetPurpose()), bip_obj.m_coin_type) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip32.py", line 236, in ChildKey return self.CkdPriv(index) if not self.m_is_public else self.CkdPub(index) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip32.py", line 421, in __CkdPriv secret = ConvUtils.IntegerToBytes(new_key_int) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\utils\conversion.py", line 57, in IntegerToBytes return data_int.to_bytes((data_int.bit_length() + 7) // 8, endianness) AttributeError: 'mpz' object has no attribute 'to_bytes'

C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query>

shibu130 commented 3 years ago

Hi, what version of bip-utils and ecdsa module are you using?

can u do pip install bip-utils==1.10.0. And pip install ecdsa==0.16.1 and check if you are still getting the same error

djmuratb commented 3 years ago

Name: bip-utils Version: 1.11.1

Name: ecdsa Version: 0.16.1

shibu130 commented 3 years ago

IMG_20210603_224128.jpg

I have this code running in termux and in windows

Can u try pip install bip-utils==1.10

djmuratb commented 3 years ago

C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query>pip show bip_utils Name: bip-utils Version: 1.10.0 Summary: Implementation of BIP39, BIP32, BIP44, BIP49 and BIP84 for wallet seeds, keys and addresses generation. Supported coins: Bitcoin, Bitcoin Cash, BitcoinSV, Litecoin, Dogecoin, Dash, Zcash, Ethereum, Ethereum Classic, VeChain, Ripple, Tron, Cosmos, Band Protocol, Kava, IRIS Network, Terra, Binance Chain, Binance Smart Chain, Avalanche. Home-page: https://github.com/ebellocchia/bip_utils Author: Emanuele Bellocchia Author-email: ebellocchia@gmail.com License: MIT Location: c:\users\User\appdata\local\programs\python\python39\lib\site-packages Requires: ecdsa, pysha3 Required-by:

C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query>py script.py bip44 Traceback (most recent call last): File "C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query\script.py", line 138, in main(sys.argv[1:]) File "C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query\script.py", line 100, in main bip_obj_acc = bip_obj_mst.Purpose().Coin().Account(ACCOUNT_IDX) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip44.py", line 117, in Purpose return self._PurposeGeneric(self) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip44_base.py", line 346, in _PurposeGeneric return cls(bip_obj.m_bip32.ChildKey(cls._GetPurpose()), bip_obj.m_coin_type) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip32.py", line 236, in ChildKey return self.CkdPriv(index) if not self.m_is_public else self.CkdPub(index) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip32.py", line 421, in __CkdPriv secret = ConvUtils.IntegerToBytes(new_key_int) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\utils\conversion.py", line 57, in IntegerToBytes return data_int.to_bytes((data_int.bit_length() + 7) // 8, endianness) AttributeError: 'mpz' object has no attribute 'to_bytes'

C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query>

shibu130 commented 3 years ago

Can u try installing ecdsa version lower than 0.15

shibu130 commented 3 years ago

pip install edsca<0.15

djmuratb commented 3 years ago

C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query>pip show ecdsa Name: ecdsa Version: 0.15 Summary: ECDSA cryptographic signature library (pure python) Home-page: http://github.com/warner/python-ecdsa Author: Brian Warner Author-email: warner@lothar.com License: MIT Location: c:\users\User\appdata\local\programs\python\python39\lib\site-packages Requires: six Required-by: pybitcoin, keylib, hdtools, blocksmith, bitmerchant, bip32utils, bip-utils

C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query>py script.py bip44 Traceback (most recent call last): File "C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query\script.py", line 138, in main(sys.argv[1:]) File "C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query\script.py", line 100, in main bip_obj_acc = bip_obj_mst.Purpose().Coin().Account(ACCOUNT_IDX) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip44.py", line 117, in Purpose return self._PurposeGeneric(self) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip44_base.py", line 346, in _PurposeGeneric return cls(bip_obj.m_bip32.ChildKey(cls._GetPurpose()), bip_obj.m_coin_type) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip32.py", line 236, in ChildKey return self.CkdPriv(index) if not self.m_is_public else self.CkdPub(index) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\bip\bip32.py", line 421, in __CkdPriv secret = ConvUtils.IntegerToBytes(new_key_int) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\bip_utils\utils\conversion.py", line 57, in IntegerToBytes return data_int.to_bytes((data_int.bit_length() + 7) // 8, endianness) AttributeError: 'mpz' object has no attribute 'to_bytes'

C:\Workshop\Python\bip44-bip39-bip84-wallet-gen-and-query>

shibu130 commented 3 years ago

I am not able to replicate the error ur getting

djmuratb commented 3 years ago

Anyway, I'll investigate later. Thank you for your attention.

shibu130 commented 3 years ago

Well i have python 3.8.2 on windows with bip-utils 1.10.0 and ecdsa 0.16.1 had some errors earlier with bip-utils and ecdsa before and it got resolved after i changed ecdsa , i ran this script on termux with python 3.9.5 with same versions of bip-utils and ecdsa there were no errors