Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xpub key generated by Electrum doesn't work #148

Open
bingobongo231 opened this issue Aug 7, 2023 · 2 comments
Open

xpub key generated by Electrum doesn't work #148

bingobongo231 opened this issue Aug 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@bingobongo231
Copy link

I am using Electrum 4.4.5 and 287d30d

I am trying to use the master public key from the wallet I created in Electrum as "xpub" in the config, but I get this error:

[INFO] Initialised Flask with secret key: ...
[INFO] Deriving addresses for first time from xpub: zpub...
[WARNING] YOU MUST CHECK THIS MATCHES THE FIRST ADDRESS IN YOUR WALLET:
Traceback (most recent call last):
  File "satsale.py", line 415, in <module>
    bitcoin_node = xpub.xpub(method)
  File "node\xpub.py", line 42, in __init__
    logging.warn(self.get_address_at_index(next_n))
  File "node\xpub.py", line 108, in get_address_at_index
    bip84_acc = Bip84.FromExtendedKey(self.config["xpub"],
  File "venv\lib\site-packages\bip_utils\bip\bip84\bip84.py", line 99, in FromExtendedKey
    return cls._FromExtendedKey(ex_key_str, Bip84ConfGetter.GetConfig(coin_type))
  File "venv\lib\site-packages\bip_utils\bip\bip44_base\bip44_base.py", line 114, in _FromExtendedKey
    return cls(bip32_cls.FromExtendedKey(ex_key_str, coin_conf.KeyNetVersions()),
  File "venv\lib\site-packages\bip_utils\bip\bip44_base\bip44_base.py", line 194, in __init__
    raise Bip44DepthError(
bip_utils.bip.bip44_base.bip44_base_ex.Bip44DepthError: Depth of the public-only Bip object (<bip_utils.bip.bip32.bip32_key_data.Bip32Depth object at 0x000001FDC270B850>) is below account level or beyond address index level
@kristapsk
Copy link
Member

Was able to reproduce with freshly generated Electrum wallet, will look into it.

@kristapsk kristapsk added the bug Something isn't working label Aug 13, 2023
@kristapsk
Copy link
Member

kristapsk commented Aug 13, 2023

Ohh, that's because Electrum uses custom key derivation path, not BIP84.

It looks there is some Electrum support in used bip-utils package for handling xpubs (ElectrumV2Segwit), but that needs to be implemented in SatSale side too.

@kristapsk kristapsk added enhancement New feature or request and removed bug Something isn't working labels Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants