rust-bitcoin / rust-bitcoin/rust-miniscript
Top level checks are only used for miniscript APIs and not descriptor APIs.
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 426
- Forks
- 200
- Avg merge
- 7d 17h
- Merged PRs (30d)
- 8
Description
#[test]
fn test_2() {
let desc = Descriptor::<String>::from_str("wsh(thresh(1,pk(A),s:pk(B)))").unwrap();
let desc = Descriptor::<String>::from_str("wsh(thresh(1,pk(A),s:pk(A)))").unwrap(); // This should also ERR because duplicate keys.
// But miniscript APIs are fine.
let ms = Miniscript::<String, Segwitv0>::from_str("thresh(1,pk(A),s:pk(B))").unwrap();
let ms = Miniscript::<String, Segwitv0>::from_str("thresh(1,pk(A),s:pk(A))").expect_err("This is not a valid miniscript");
}
https://github.com/brunoerg/bitcoinfuzz/issues/73#issuecomment-2566020224
We should have those in descriptor APIs too. In the above example, we have duplicate keys being allowed in descriptors.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the descriptor parsing APIs and comparing their top-level checks with the existing Miniscript checks shown in the issue. Add a regression test for the duplicate-key descriptor example, and consider the work done when descriptors reject duplicate keys while the existing Miniscript behavior remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100