diff --git a/pycoin/cmds/ku.py b/pycoin/cmds/ku.py index 799f5afb..990bd8c3 100755 --- a/pycoin/cmds/ku.py +++ b/pycoin/cmds/ku.py @@ -13,7 +13,6 @@ from pycoin.networks.default import get_current_netcode from pycoin.networks.registry import network_codes, network_for_netcode - HASH160_RE = re.compile(r"^([0-9a-fA-F]{40})$") @@ -67,6 +66,21 @@ def add_output(json_key, value=None, human_readable_key=None): if subkey_path: add_output("subkey_path", subkey_path) + if isinstance(key, BIP32Node): + if(key._network.parse._bip49_pub_prefix and key._network.parse._bip49_prv_prefix): + if key._secret_exponent: + add_output("p2sh_segwit wallet key", + key._network.bip49_as_string(key.serialize(as_private=True), as_private=True)) + add_output("p2sh_segwit public version", + key._network.bip49_as_string(key.serialize(as_private=False), as_private=False)) + + if(key._network.parse._bip84_pub_prefix and key._network.parse._bip84_prv_prefix): + if key._secret_exponent: + add_output("segwit wallet key", + key._network.bip84_as_string(key.serialize(as_private=True), as_private=True)) + add_output("segwit public version", + key._network.bip84_as_string(key.serialize(as_private=False), as_private=False)) + for k, v, text in key.ku_output(): add_output(k, v, text) diff --git a/pycoin/networks/bitcoinish.py b/pycoin/networks/bitcoinish.py index caa43428..22e72096 100644 --- a/pycoin/networks/bitcoinish.py +++ b/pycoin/networks/bitcoinish.py @@ -235,6 +235,7 @@ def electrum_public(master_public_key): network.bip32_as_string = bip32_as_string network.bip49_as_string = bip49_as_string + network.bip84_as_string = bip84_as_string network.sec_text_for_blob = sec_text_for_blob network.wif_for_blob = wif_for_blob