Skip to content

Bug: descriptor with origin-prefixed raw compressed pubkey is rejected #59

Description

@Nuhiat-Arefin

Summary

tinyminiscript rejects a valid descriptor when a raw compressed pubkey is prefixed with a BIP32 key origin.

Minimal repro

pkh([deadbeef/1/2'/3/4']03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd)

Observed behavior

The parser rejects with:

InvalidKey { key: "[deadbeef/1/2'/3/4']03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd", position: 5, inner: "Invalid bitcoin::PublicKey key" }

Cross-check

The same descriptor is accepted by:

  • rust-miniscript
  • bitcoin/bitcoin
  • embit
  • bitcoinerlab/descriptors

Why this looks like a parser gap

The generic key parser only treats a token as an extended-key expression when the token contains "pub". An origin-prefixed raw compressed pubkey such as [fingerprint/path]02... therefore falls through to the plain pubkey path instead of being parsed as origin + raw pubkey.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions