Skip to content

[Bug] "Key path value '<0;1>' is not a valid uint32" - exported output descriptor is invalid and not recognized by Bitcoin Core #817

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

Closed
GregTonoski opened this issue Jan 28, 2023 · 5 comments

Comments

@GregTonoski
Copy link

GregTonoski commented Jan 28, 2023

Preconditions:

  1. Sparrow 1.7.1 portable, Windows 11.
  2. Testnet.

Steps:

  1. File -> Export Wallet -> Output Descriptor Export File -> Save.
  2. Copy content of the saved file to Clipboard.
  3. Open Bitcoin Core 24.0.1 (bitcoin-qt.exe -testnet) console.
  4. Run the command: importdescriptors '[{"desc": "wpkh([3f97f7d5/84h/1h/0h]tpubDCo3Gc8f31Hdz2cC8uUbHc1Hz96jpQaKWdkz4PE2ctFSKKQwG5MQ24Mm5nWDALMgRXrMgtStPfwNa4MvpDYXEmF2iWj4dyg1Z4j8gmSvyAr/<0;1>/*)#89q6exj7", "timestamp": "now"}]'

Actual result:

The descriptor is not accepted by Bitcoin Core:
[
{
"success": false,
"error": {
"code": -5,
"message": "wpkh(): Key path value '<0;1>' is not a valid uint32"
}
}
]

Expected result:

Sparrow creates an Output Descriptor that is accepted by Bitcoin Core and import is finished successfully.

Logs (TRACE level)

sparrow.log

@GregTonoski GregTonoski changed the title "Key path value '<0;1>' is not a valid uint32" - exported output descriptor is invalid and not recognized by Bitcoin Core [Bug] "Key path value '<0;1>' is not a valid uint32" - exported output descriptor is invalid and not recognized by Bitcoin Core Jan 28, 2023
@craigraw
Copy link
Collaborator

Multipath descriptors are specified in the proposed BIP 389, and support has already been added to several libraries: bitcoin/bips#1354

Specifying multiple descriptors in a single descriptor string will be supported by Bitcoin Core when bitcoin/bitcoin#22838 is merged. I believe this is an important improvement, as it makes output descriptors much more usable. I find a single, compact descriptor for a wallet is important when copying out as a backup, particularly onto durable media. More so when it is a multisig wallet that ideally requires a backup of all the xpubs.

@GregTonoski
Copy link
Author

I think that there is the misleading message that needs correction in Sparrow:
image

Apparently, the exported "output descriptor" is not compatible with Bitcoin Core.

@craigraw
Copy link
Collaborator

To be fair it's compatible with minor edits. I think it goes too far to say it's misleading, which suggests I am intentionally trying to mislead users.

As application developers, we don't have the luxury of changing anything after release, and many users choose not to upgrade. The PR linked above could be merged tomorrow, which would the message true. If that happened, would you then consider your proposed "not compatible" suggested text misleading?

@GregTonoski
Copy link
Author

GregTonoski commented Jan 29, 2023

Yes, as a user, I would consider the text inaccurate even if Bitcoin Core merges the PR tomorrow. An example of a more accurate statement: "The output (...) description of the wallet will be compatible with Bitcoin Core version 25". Besides, there could "minor edits" communicated.

I don't want to suggest that the message was made in order to mislead users intentionally. I understand that things may be imperfect. As a matter of fact, I want to contribute and give suggestions to improve Sparrow. Also, I appreciate your time, skills and effort.

@craigraw
Copy link
Collaborator

craigraw commented Feb 9, 2023

The output descriptor export has been changed in b15d630 to have both multipath and single descriptors, with comments to guide the user:

# Receive and change descriptor (BIP389):
wpkh([959957d8/84h/0h/0h]xpub...uue/<0;1>/*)#u35nht4r


# Receive descriptor (Bitcoin Core):
wpkh([959957d8/84h/0h/0h]xpub...uue/0/*)#2ez7nqrd

# Change descriptor (Bitcoin Core):
wpkh([959957d8/84h/0h/0h]xpub...uue/1/*)#md8lw4n4

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