rust-bitcoin / rust-bitcoin/rust-miniscript
Descriptor::Bare(PkH) string encoding doesn't roundtrip, parsed as Descriptor::Pkh
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 426
- Forks
- 200
- Avg merge
- 7d 17h
- Merged PRs (30d)
- 8
Description
Since Bare descriptors are encoded as just the inner miniscript with no explicit bare() wrapper, Bare descriptors over a PkH miniscript fragment and Pkh descriptors are both encoded as "pkh(KEY)", which always decodes back to a Pkh descriptor.
This isn't terrible because both are semantically equivalent, refer to the same scriptPubKey and can be satisfied using the same assets, but it is surprising and unexpected if you treat descriptor strings as a stable serialization format.
It seems that this conflict is inherent due to the reuse of pkh() for miniscripts/descriptors and the lack of an explicit bare() wrapper so I don’t really have a concrete suggestion, just thought it was worth bringing up.
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
No file or test is named. Start by tracing descriptor encoding and parsing for Bare(PkH), Pkh, and the shared pkh() representation; determine where the ambiguity is introduced. Done requires an agreed serialization behavior that round-trips without ambiguity, with the resulting behavior documented or covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100