IIUC you’re using the newly proposed OP_CCV
as well as OP_CAT
, but otherwise only existing op codes. It seems one particular annoyance you need to work around when emulating a 32 bit system is the 31 bit limitation of CScriptNum
.
Would your code get significantly easier and produce more compact leaves by allowing slightly bigger numbers? IIUC the Great Script Restoration project goe straight to 64 bit, but it seems just a few extra bits would do the trick here? Restoring Bitcoin’s Full Script Power | Rusty Russell’s Quiet Corner of The Internet
Are there other currently disabled op codes that would help?