<0x0100008000000000> // 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 error at OP_CHECKLOCKTIMEVERIFY: Error: Invalid input: this operation requires a valid Script Number
The number on the stack at this time is 0x0100008000 - a 5-byte scriptnum.
CLTV, as a special case, accepts scriptnums of 5-byte length, to avoid y2038 problem. It seems that ScriptWiz interpreter does not account for this special case.
when entering the following script in ScriptWiz app (https://ide.scriptwiz.app/):
I get the following error at
OP_CHECKLOCKTIMEVERIFY
:Error: Invalid input: this operation requires a valid Script Number
The number on the stack at this time is
0x0100008000
- a 5-byte scriptnum.CLTV, as a special case, accepts scriptnums of 5-byte length, to avoid y2038 problem. It seems that ScriptWiz interpreter does not account for this special case.