Closed bjorntimmer closed 3 days ago
Hi @bjorntimmer, I'm not part of the repository's team but will try to help where I can. I might be wrong so, please, consider this as an attempt to help you doing your own research.
When you set STRICT=True
it forces you to work only with the private key, because to get the addresses with hardened derivations, you need the private key.
As you are already using unhardened derivation and you want to use the public key in a watch only mode, I suggest you is to keep STRICT=False
and change the derivation path.
My first shot would be m/0/9
.
Ideally, you should try to get the xpub from the following path: m/84'/0'/0'
I tried something similar but with a bip 44 xpub:
m/44'/0'/0'
m/0/{index}
like you are trying to dohdwallet.clean_derivation()
before moving to the next index on item 2Hi @bjorntimmer, I'm not part of the repository's team but will try to help where I can. I might be wrong so, please, consider this as an attempt to help you doing your own research.
When you set
STRICT=True
it forces you to work only with the private key, because to get the addresses with hardened derivations, you need the private key.As you are already using unhardened derivation and you want to use the public key in a watch only mode, I suggest you is to keep
STRICT=False
and change the derivation path.My first shot would be
m/0/9
.Ideally, you should try to get the xpub from the following path:
m/84'/0'/0'
I tried something similar but with a bip 44 xpub:
- got the xpub for
m/44'/0'/0'
- derived using the
m/0/{index}
like you are trying to do- use
hdwallet.clean_derivation()
before moving to the next index on item 2
something like this:
hdwallet: HDWallet = HDWallet(symbol=SYMBOL)
hdwallet.from_xpublic_key(xpublic_key=XPUBLIC_KEY, strict=False) # try getting the m/84'/0'/0' xpub instead of the root xpub
for i in range(10):
print('Index {}'.format(str(i)))
hdwallet.from_path("m/0/{}".format(str(i)))
print("P2WPKH Address:", hdwallet.p2wpkh_address())
print('')
hdwallet.clean_derivation()
Hi,
I'm trying the example https://github.com/meherett/python-hdwallet/blob/master/examples/from_xpublic_key.py to use with my Ledger Hardware Wallet to get all addresses to watch my balances.
From Ledger Live I go to my Bitcoin account and go to the account settings where I get the following:
And use the following code:
When I set the STRICT variable to True I get the message "Invalid Root Xpublic Key." When I set it to False I'm able to generate addresses, however I don't get addresses that where generated by Ledger Live.
Did get anyone working code for the xpub with Ledger Live?