Skip to content

Taproot descriptor parsing fails on uppercase hex characters #1278

@erickcestari

Description

@erickcestari

After differential fuzzing using bitcoinfuzz with NBitcoin, rust-miniscript and Bitcoin Core, I discovered that NBitcoin fails to parse valid Taproot descriptors containing uppercase hex characters in the internal key, breaking compatibility with Bitcoin Core and rust-miniscript.

Reproduction

This valid Taproot descriptor fails:

tr(01b2b2472Dbbbbbbbbbcbbbbbcbbbbbbcbbbbbbbbbbbbbcbbbbbbbbbbbbcbbbb)

Root Cause

The hex parser in Parse.cs line 8 only accepts lowercase hex:

private const string ValidHex = "0123456789abcdef";  // Missing A-F

When parsing the Taproot internal key (x-only pubkey), PPubkeyXOnly() uses Parse.Hex.Repeat(64) which rejects uppercase hex characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions