Open
Conversation
3b7ed1f to
ff5c979
Compare
Support sortedmulti_a at the top-level of taproot descriptors, which is mostly identical to multi_a, except that the x-only pubkeys are sorted upon encoding into Bitcoin Script.
ff5c979 to
e62cb50
Compare
trevarj
commented
Mar 22, 2026
| let thresh = Threshold::new(k as usize, keys).map_err(Error::Threshold)?; | ||
| term.push(Miniscript::multi_a(thresh)); | ||
| if thresh.is_sorted() { | ||
| term.push(Miniscript::sortedmulti_a(thresh)); |
Contributor
Author
There was a problem hiding this comment.
Second guessing this...do I need to check if keys.len() == k && thresh.is_sorted() and then that will decode as a sortedmulti_a?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support sortedmulti_a at the top-level of taproot descriptors, which is mostly
identical to multi_a, except that the x-only pubkeys are sorted upon encoding
into Bitcoin Script.
I think the previous attempts at adding sortedmulti_a were prior to the parser
rewrite. With the current parser it seems to me that sortedmulti_a is basically
a copy and paste of multi_a with the key sorting added.
The sorting is done upon
encode()ing of the Miniscript, just as BIP 387 describes.I'm a little suspicious on if the unit and integration tests are effective for
sortedmulti_a, so I'd like to have some extra eyes/feedback on that. It might be
better to add an integration test that can match against what Core produces on a
round trip from Descriptor to Address at least.
Resolves #320