Skip to content

Bug: multi(...) descriptor rejects xpub keys #61

Description

@Nuhiat-Arefin

Summary

tinyminiscript rejects a valid wsh(multi(...)) descriptor when the keys are extended public keys instead of raw compressed pubkeys.

Minimal repro

wsh(multi(2,xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB,xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH))

Observed behavior

The parser rejects with:

InvalidKey { ... inner: "Invalid bitcoin::PublicKey key" }

Control case

A closely related raw-pubkey form is accepted:

wsh(multi(2,03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd,03e7d285b4817f83f724cd29394da75dfc84fe639ed147a944e7e6064703b14130))

Cross-check

The xpub-key repro is accepted and compiled by:

  • rust-miniscript
  • bitcoin/bitcoin
  • embit
  • NBitcoin

Why this looks like a real bug

This is distinct from the generic multipath-xpub gap. The multi(...) parser branch reads each key with bitcoin::PublicKey::from_str(...) directly, so xpub-based key expressions never reach the extended-key parser used elsewhere in the crate.

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