Skip to content

Conversation

@odudex
Copy link
Collaborator

@odudex odudex commented Mar 29, 2025

In another finding from the Bitcoinfuzz project by @brunoerg, we learned that, unlike Core and Rust Miniscript, Embit won't parse booleans, 0 and 1, as arguments for logical operators like and_v. Currently, a miniscript like "wsh(and_v(v:0,and_v(v:0,0)))" raises an error: Unknown operator '0,and_v'.

This PR aims to enable Embit to properly load and compile boolean literals by implementing the JustZero and JustOne miniscript objects and refactoring the parsing algorithm.
Although booleans have little or no use in practical miniscripts, being able to parse them is important for standardizing behavior across different miniscript implementations.

Kudos to @brunoerg and @erickcestari for pointing the issue.
Thanks @jdlcdl for the guidance through all the process, from understanding the issue, the code, and for the multiple reviews.

Note: A second issue involving the recursive depth limit in the Fuzz test case remains, even after resolving the boolean support, and will not be covered by this PR.

@odudex
Copy link
Collaborator Author

odudex commented Apr 2, 2025

The commits from this pull request have now been merged into Embit's develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant