Skip to content

Bug: bare miniscript containing nested multi(...) is rejected #56

Description

@Nuhiat-Arefin

Summary

tinyminiscript accepts bare miniscript expressions, but rejects a bare miniscript when multi(...) appears nested inside a larger expression.

Minimal repro

or_i(multi(1,0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798),1)

Observed behavior

The parser rejects with:

DescriptorVisitorError(
    InvalidFragmentForDescriptor { position: 6, expected: wsh, found: bare }
)

Control case

This top-level bare miniscript is accepted by the same parser:

multi(1,0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)

Cross-check

The nested form above is parse-accepted by:

  • rust-miniscript
  • bitcoin/bitcoin
  • embit
  • bitcoinerlab/miniscript
  • NBitcoin
  • elements-miniscript

Some of those later reject it as not sane at typecheck time, but they all agree it is syntactically valid bare miniscript.

Why this looks like a real bug

  • current upstream source exposes bare miniscript parsing
  • the top-level bare multi(...) control is accepted
  • the reject only appears when multi(...) is nested inside a larger bare expression
  • the failure comes from descriptor validation leaking into the bare parser surface

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions