Skip to content

liquid p2tr opcodes silently ignored when liquid p2wsh mode is selected #50

@dgpv

Description

@dgpv

When compiling the following script in ScriptWiz app (https://ide.scriptwiz.app/): (edit: in liquid v0_p2wsh mode)

<0x0100000000000000> // timestamp
OP_DUP // copy timestamp
<0x0000008000000000>
OP_GREATERTHANOREQUAL64
OP_IF
// If timestamp does not fit into 4-byte scriptnum, we will just take 5 lower
// bytes of it. This will allow to use locktimes up to year 2106
<0>
<5>
OP_SUBSTR
OP_ELSE
// If timestamp fits into 4-byte scriptnum, just convert it
OP_LE64TOSCRIPTNUM
OP_ENDIF

// timestamp in scriptnum format is now on top of the stack
OP_CHECKLOCKTIMEVERIFY
OP_DROP

I get the following bytes:

0x080100000000000000760800000080000000006300557f6768b175

As you can see, right after the 76080000008000000000, which is OP_DUP, <0x0000008000000000>, follows 63. But this is the code for OP_IF rather than for OP_GREATERTHANOREQUAL64 (which is df)

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