cleanstack alt stack & softfork improvements (Was: Merkle branch verification & tail-call semantics for generalized MAST)



Summary:

During a discussion session, it was suggested that tail-call semantics could still be maintained if the alt stack is used for transferring arguments to the policy script. A question was raised if this was a bug in the cleanstack rule. The participants also discussed the idea of replacing all NOPs and unallocated opcodes with a new OP_RETURNTRUE implementation in future versions of Script. This would immediately exit the program, perhaps performing some semantic checks on the remainder of the script, with a successful outcome. The benefit of this approach is that it allows softforking in any new opcode, not only the -VERIFY opcode variants that have been introduced. Old nodes would always succeed immediately upon encountering an undefined opcode, allowing the new opcode to do anything from that point onward. This approach is similar to CVE-2010-5141, but since signatures are no longer scripts themselves, it shouldn't be exploitable.


Updated on: 2023-05-20T03:57:13.395127+00:00