The interesting part is that you seemed to have also implemented an OP_XOR, OP_OR, OP_AND, OP_MUL, OP_SHIFT and a bunch of other opcodes in the process of making this work.
So do you think there is a case where you can also show that these other disabled opcodes could be enabled back?
Yep, here are polyfills for OP_XOR/OP_AND/OP_OR for 31 bit unsigned script numbers:
OP_XOR:
OP_TOALTSTACK
OP_DUP
<1073741824>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1073741824>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<1073741824>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1073741824>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<1073741824>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<536870912>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<536870912>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<536870912>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<536870912>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<536870912>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<268435456>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<268435456>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<268435456>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<268435456>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<268435456>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<134217728>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<134217728>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<134217728>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<134217728>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<134217728>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<67108864>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<67108864>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<67108864>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<67108864>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<67108864>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<33554432>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<33554432>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<33554432>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<33554432>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<33554432>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<16777216>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<16777216>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<16777216>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<16777216>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<16777216>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<8388608>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<8388608>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<8388608>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<8388608>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<8388608>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<4194304>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<4194304>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<4194304>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<4194304>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<4194304>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<2097152>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<2097152>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<2097152>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<2097152>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<2097152>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<1048576>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1048576>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<1048576>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1048576>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<1048576>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<524288>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<524288>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<524288>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<524288>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<524288>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<262144>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<262144>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<262144>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<262144>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_NUMNOTEQUAL
OP_IF
<262144>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<131072>
OP_LESSTHAN
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OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<536870912>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<268435456>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<268435456>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<268435456>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<268435456>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<268435456>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<134217728>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<134217728>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<134217728>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<134217728>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<134217728>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<67108864>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<67108864>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<67108864>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<67108864>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<67108864>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<33554432>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<33554432>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<33554432>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<33554432>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<33554432>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<16777216>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<16777216>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<16777216>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<16777216>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<16777216>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<8388608>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<8388608>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<8388608>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<8388608>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<8388608>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<4194304>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<4194304>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<4194304>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<4194304>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<4194304>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<2097152>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<2097152>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<2097152>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<2097152>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<2097152>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<1048576>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1048576>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<1048576>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1048576>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<1048576>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<524288>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<524288>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<524288>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<524288>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<524288>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<262144>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<262144>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<262144>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<262144>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<262144>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<131072>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<131072>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<131072>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<131072>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<131072>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<65536>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<65536>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<65536>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<65536>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<65536>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<32768>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<32768>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<32768>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<32768>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLAND
OP_IF
<32768>
OP_FROMALTSTACK
OP_ADD
O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STHAN
OP_IF
OP_0
OP_ELSE
<1073741824>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<1073741824>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1073741824>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<1073741824>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<536870912>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<536870912>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<536870912>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<536870912>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<536870912>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<268435456>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<268435456>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<268435456>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<268435456>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<268435456>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<134217728>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<134217728>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<134217728>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<134217728>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<134217728>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<67108864>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<67108864>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<67108864>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<67108864>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<67108864>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<33554432>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<33554432>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<33554432>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<33554432>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<33554432>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<16777216>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<16777216>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<16777216>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<16777216>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<16777216>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<8388608>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<8388608>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<8388608>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<8388608>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<8388608>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<4194304>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<4194304>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<4194304>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<4194304>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<4194304>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<2097152>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<2097152>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<2097152>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<2097152>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<2097152>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<1048576>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1048576>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<1048576>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<1048576>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<1048576>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<524288>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<524288>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<524288>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<524288>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<524288>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<262144>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<262144>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<262144>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<262144>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<262144>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<131072>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<131072>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
<131072>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<131072>
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
<131072>
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_DUP
<65536>
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
<65536>
OP_SUB
OP_1
OP_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P_TOALTSTACK
OP_ENDIF
OP_DUP
OP_2
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
OP_2
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_DUP
OP_2
OP_LESSTHAN
OP_IF
OP_0
OP_ELSE
OP_2
OP_SUB
OP_1
OP_ENDIF
OP_ROT
OP_BOOLOR
OP_IF
OP_2
OP_FROMALTSTACK
OP_ADD
OP_TOALTSTACK
OP_ENDIF
OP_BOOLOR
OP_IF
OP_FROMALTSTACK
OP_1
OP_ADD
OP_ELSE
OP_FROMALTSTACK
OP_ENDIF
For OP_LSHIFT, you can left shift by 1 by multiplying by two:
OP_ADD
So to left shift by 3, for example, you just do 3 left shifts by 1:
OP_ADD
OP_DUP
OP_ADD
OP_DUP
OP_ADD
If your number is greater than or equal to 2^30, however, you need to first clear the topbit before doing the shift, which can be accomplished by the following:
<1073741824>
OP_2DUP
OP_GREATERTHANOREQUAL
OP_IF
OP_SUB // subtract 2^30
OP_ELSE
OP_DROP // ignore 2^30 and leave the number unmodified
OP_ENDIF
// end clear top bit
OP_DUP
OP_ADD