You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, the Extended Public Key ypub6ZNNVLvwe6gJsPyNiukiYEgVWvdeP3M5xx1qGzTo67FiEFJvcCB6ApXZTLBiuMiKhvNfmdcssJ3MbLMQfWjgbJ9dHHMrWxx6Vkb93r7Zb3y
generates these address:
I was able to make this work for my purposes but modifying bip32.py, please note that this implementation will return a bad value for bip32_path and will only work for BIP49, I thought this might be helpful to someone. I think the right way to go about this is to add a new network config to network.py. Maybe I'll get the courage and time one day to go about doing that.
bip32.py
line 485 in bip32.py
defto_address(self):
"""Create a public address from this Wallet. Public addresses can accept payments. https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses """key=unhexlify(self.get_public_key_hex())
# First get the hash160 of the keyhash160_bytes=hash160(key)
# Prepend the network address byte# if BIP32 - comment this out for testing#network_hash160_bytes = \#chr_py2(self.network.PUBKEY_ADDRESS) + hash160_bytes# if BIP49script_sig=bytes.fromhex('0014') +hash160_bytesaddress_bytes=hash160(script_sig)
network_hash160_bytes= \
chr_py2(self.network.SCRIPT_ADDRESS) +address_bytes# print(self.network.PUBKEY_ADDRESS)# Return a base58 encoded address with a checksumreturnensure_str(base58.b58encode_check(network_hash160_bytes))
line 567 in bip32.py - comment out the network check for testing
elifpoint_typein [2, 3, 4]:
# Compressed public coordinates# if version_long != network.EXT_PUBLIC_KEY:# raise incompatible_network_exception_factory(# network.NAME, network.EXT_PUBLIC_KEY,# version)pubkey=PublicKey.from_hex_key(key_data, network=network)
# Even though this was generated from a compressed pubkey, we# want to store it as an uncompressed pubkeypubkey.compressed=False
Can you add support for BIP49 segwit addresses?
It uses a new BIP32 Extended Public Key format.
For example, the Extended Public Key
ypub6ZNNVLvwe6gJsPyNiukiYEgVWvdeP3M5xx1qGzTo67FiEFJvcCB6ApXZTLBiuMiKhvNfmdcssJ3MbLMQfWjgbJ9dHHMrWxx6Vkb93r7Zb3y
generates these address:
The text was updated successfully, but these errors were encountered: