Skip to content

Conversation

@odudex
Copy link
Collaborator

@odudex odudex commented Mar 26, 2025

This PR addresses issue #70 by adding a verification step to ensure that a Miniscript fragment wrapped by t is of type V. This addition resolves an inconsistency observed in this very specific case, between Embit vs Bitcoin Core and Rust Miniscript implementations.

Note: While the new code aims to standardize behavior, further input from experienced miniscripters is welcome to confirm its effectiveness and to ensure that no additional inconsistencies are introduced.

Special thanks to @brunoerg and @erickcestari for the implementation work, @qlrd for encouraging the inclusion of Embit in the fuzz setup that caught the issue, @darosior for identifying the inconsistency and pointing a fix, and @jdlcdl for the in-depth review.

@odudex
Copy link
Collaborator Author

odudex commented Mar 26, 2025

Tests and acknowledgements from developers at @cryptoadvance (Specter-DIY) and @SeedSigner are greatly appreciated!

@odudex
Copy link
Collaborator Author

odudex commented Mar 26, 2025

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

@erickcestari
Copy link

Test ACK

I tested this using the following script:

def miniscript_parse(input):
    try:
        ms = Miniscript.from_string(input, taproot=False)
        ms.verify()
        return True
    except Exception as e:
        print(e)
        try:
            ms = Miniscript.from_string(input, taproot=True)
            ms.verify()
            return True
        except Exception as e:
            print(e)
            return False

result = miniscript_parse("ttvtvtvtvtvtvtv:after(2)")
print(result)

Output:

t: X must be of type V
t: X must be of type V
False

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.

2 participants