Skip to content

Missing CheckMinimalPush check in MatchMultisig: largest IsStandard multisig n-of-3 is 12 bytes too large? #23285

@practicalswift

Description

@practicalswift

The following four equivalent scripts all pass standardness check (IsStandard):

  • 1 0x21 0x020000000000000000000000000000000000000000000000000000000000000000 1 CHECKMULTISIG
  • 1 0x4c21 0x020000000000000000000000000000000000000000000000000000000000000000 1 CHECKMULTISIG
  • 1 0x4d2100 0x020000000000000000000000000000000000000000000000000000000000000000 1 CHECKMULTISIG
  • 1 0x4e21000000 0x020000000000000000000000000000000000000000000000000000000000000000 1 CHECKMULTISIG

Where 0x4c == OP_PUSHDATA1, 0x4d == OP_PUSHDATA2 and 0x4e == OP_PUSHDATA4.

Only the first one would pass the standardness check if minimal representation was enforced.

AFAICT we check for minimal representation in all other IsStandard standardness checks. Is there any particular reason we're not doing it for CHECKMULTISIG in MatchMultisig? :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions