Deduce – Earlybirds Invest https://earlybirdsinvest.com Latest Crypto News Fri, 18 Jul 2025 01:42:47 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.9 https://i0.wp.com/earlybirdsinvest.com/wp-content/uploads/2024/12/cropped-New-Project-2024-12-17T235703.455.png?fit=32%2C32&ssl=1 Deduce – Earlybirds Invest https://earlybirdsinvest.com 32 32 240146708 Deduce addresses from Electrum Master XPub https://earlybirdsinvest.com/deduce-addresses-from-electrum-master-xpub/ https://earlybirdsinvest.com/deduce-addresses-from-electrum-master-xpub/#respond Fri, 18 Jul 2025 01:42:47 +0000 https://earlybirdsinvest.com/deduce-addresses-from-electrum-master-xpub/

I am developing some code to derive addresses from various master public keys extracted from a series of wallets for some experiments I want to perform. My code can now work with most wallets I’ve tried to use, but Electrum appears to be breaking down as the XPUB that can be extracted from the Electrum App is from m/0h, not from the normal derived path m/84/0/0, so it causes this 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 following exception: “Error”: “Public-only vip object depth () below account level or above address index level.”

At first I thought this issue might be using Zpub instead of Xpub, but other wallets like Trezor Suite and Green also used Zpub and managed to generate addresses successfully with the code above.

I would be very grateful if anyone knows how to avoid this problem, or another way to calculate addresses from Electrum XPUB.

]]>
https://earlybirdsinvest.com/deduce-addresses-from-electrum-master-xpub/feed/ 0 48238