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

Error: "Unexpected child number" trying to import public key from electrum #201

Open
532910 opened this issue May 7, 2024 · 1 comment

Comments

@532910
Copy link

532910 commented May 7, 2024

Unable to add watch only wallet due to the error: "Unexpected child number". The xpub string is got from electrum wallet. The same string (public key) imports successfully in unstoppable wallet.

@LeoComandini
Copy link
Contributor

Hi @532910 ,

The Green apps use GDK, a common library to handle most of their operations.

GDK exposes a interface where most calls have a mandatory parameter "subaccount",
e.g. https://gdk.readthedocs.io/en/release_0.71.0/gdk-json.html#unspent-outputs-request-json.

When importing a xpub, we need to deduce the subaccount number from the xpub, this is done here.

We expect the subaccount number to be the child number of your xpub, in hardened format.
If that is not the case we return an error.

We can relax that constraint, but it takes a bit of time, and we need some evidence that is a common case.

Do you have the descriptor string for that xpub?
That can be used as well, you might want to try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants