Skip to content

fix(descriptor): clarify descriptor key expression errors - #351

Open
Chibey-max wants to merge 1 commit into
bitcoindevkit:masterfrom
Chibey-max:fix/303-descriptor-key-expression-error
Open

Chibey-max wants to merge 1 commit into
bitcoindevkit:masterfrom
Chibey-max:fix/303-descriptor-key-expression-error

Conversation

@Chibey-max

Copy link
Copy Markdown

Description

The descriptor command treated descriptor key expressions returned by
key derive as raw extended keys. As a result, users received a confusing
Base58 parsing error when passing the output from key derive to
descriptor.

This change detects descriptor key expressions before raw key parsing and
returns a clear error explaining the accepted input format and where full
descriptors can be used.

Fixes #303

Notes to the reviewers

  • Existing raw xpub, xprv, and mnemonic handling is unchanged.
  • The implementation uses the clearer-error solution described in the issue.
  • Directly accepting descriptor key expressions would require deciding how an
    already-derived key expression maps to the command's external and internal
    descriptor pair.
  • Added an integration test covering the complete
    key generate -> key derive -> descriptor workflow.
  • Added a changelog entry under [Unreleased].

Checklists

All Submissions:

  • I've signed my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy

New Features:

  • I've added tests for the new behavior
  • I've added documentation for the new behavior

Bugfixes:

  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Improve error message / accept descriptor key expressions in descriptor command

1 participant