descriptors: check duplicate keys in all multipath Miniscript branches #35742

pull yashbhutwala wants to merge 1 commits into bitcoin:master from yashbhutwala:fix/multipath-miniscript-sanity changing 2 files +38 −2
  1. yashbhutwala commented at 8:36 PM on July 17, 2026: contributor

    Fixes #35629.

    Multipath Miniscript descriptors performed duplicate-key sanity checking while parsing the template, when key comparison used the first multipath branch. As a result, duplicate keys present only in a later branch were accepted.

    Select each expanded multipath branch and rerun the existing duplicate-key check before constructing the final descriptors. If a branch contains a duplicate, report the offending concrete Miniscript expression.

    The regression test covers:

    • a valid two-branch wsh control;
    • a duplicate in the second wsh branch;
    • a duplicate in the third of three tr branches.

    Tested with:

    build/bin/test_bitcoin --run_test=descriptor_tests/multipath_miniscript_duplicate_keys
    build/bin/test_bitcoin --run_test=descriptor_tests
    build/bin/test_bitcoin
    
  2. descriptor: check duplicate keys in all multipath branches 560cfa24a8
  3. DrahtBot added the label Descriptors on Jul 17, 2026
  4. DrahtBot commented at 8:36 PM on July 17, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35742.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34697 (descriptor: fix musig() duplicate key checks and doubled PSBT origin paths by shuv-amp)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-27 23:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me