Skip to content

Tap context: restore d: as unit under MINIMALIF? #894

@landabaso

Description

@landabaso

Hey!

While working on Taproot support for bitcoinerlab and comparing other implementations, I noticed a typing difference.

In tapscript, MINIMALIF is consensus (BIP342), so d: can be unit.

I know you removed the u property from d globally in 2022 as the safe fix. Now that MINIMALIF is consensus in Tap, would you be open to restoring unit only for Tap?

I think this could be a small change: add a minimal_if() flag on ScriptContext (default false, Tap true) and a cast_dupif_minimal_if that sets corr.unit = true, used when minimal_if().

Drafted changes here: master...landabaso:rust-miniscript:tap-dupif-unit

Happy to open a PR if this is the right direction. Don't want to churn if the current behavior is intentional and I don't know your codebase very well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions