Open zhfnjust opened 11 months ago
@deanmlittle can you merge this , and republish it.
@deanmlittle The current implementation of the interpreter is incomplete and I cannot add tests for rawdata
Hi, @deanmlittle , I think we can check NonScriptData
in the following three situations:
Dynamic, that is, in the script virtual machine, when push NonScriptData
always be error here
Static, when deserializing hex. The algorithm itself has ensured that NonScriptData only appears after OP_RETURN and at the end. here
Static, when new a Script from a passed ScriptBits, we ensured the passed ScriptBits only contains NonScriptData at toplevel and after OP_RETURN here
Since previous ASM could not correctly represent cases containing malformed NonScriptData, such as: "6a4c0300", the following ASM format is now used:
OP_RETURN non-script-data:4c0300
The locking script of the sCrypt contract is somewhat special. After the last opreturn, there may be situations where the data is not stored according to oppushdata. But this is subject to agreement.
For example, under normal circumstances:
But the scrypt contract will have the following situations:
data only has one byte.
We have to deal with this situation. Otherwise, the correct signature cannot be obtained.