Author: Pieter Wuille 2018-01-09 14:21:08
Published on: 2018-01-09T14:21:08+00:00
On Jan 9, 2018, Mark Friedenbach via bitcoin-dev discussed the use of the alt stack as a hack for segwit script version 0 which has the clean stack rule. Anticipated future improvements here are to switch to a witness script version and a new segwit output version which supports native MAST to save an additional 40 or so witness bytes. Either approach would allow getting rid of the alt stack hack. The proposal does not have any benefits over Johnson Lau's MAST idea. Native MAST outputs would need a new witness script version, which the current proposal does not need. Static analyzing the number of opcodes and sigops gets absolutely nothing. Removing them entirely and complicating the future ability to introduce unified costing towards weight of execution cost seems the wrong way to go. One suggestion to reduce the impact of this is limiting the per-script execution to something proportional to the script size. Another idea that has been suggested is to mark pushes of potentially executable code on the stack/witness explicitly. If tail call semantics are adopted, an approach like that is strongly preferred to blindly throwing out all limits and analysis.
Updated on: 2023-05-20T04:45:02.244881+00:00