I’m creating some code to derive addresses from completely different grasp public keys extracted from a sequence of wallets for some experiments I need to conduct. My code is presently in a position to work with most wallets I’ve tried to make use of, however Electrum appears to fail, because the xpub that may be extracted from Electrum app is just not from the common derivation path m/84/0/0 however from m/0h, inflicting this traces of code:
xpub_str="zpub6restofthekey..."
bip_obj = Bip84.FromExtendedKey(xpub_str, Bip84Coins.BITCOIN)
addr = bip_obj.Change(Bip44Changes.CHAIN_EXT).AddressIndex(index).PublicKey().ToAddress()
To throw the next exception: “error”: “Depth of the public-only Bip object (
At first I assumed the problem may be utilizing zpub as an alternative of xpub, however different wallets akin to Trezor Suite or Inexperienced additionally use zpub and I have been in a position to efficiently generate addresses with the code I confirmed above.
If anybody is aware of how I can workaround this subject, or some different method of computing addresses from the Electrum xpub, I might be very grateful.