Merkle branch verification & tail-call semantics for generalized MAST



Summary:

The email thread contains discussions regarding tail-call execution semantics, unclosed stack, SigOp counting, and witness script versioning. The email chain starts with an apology for delay in response due to fighting a cold. A participant at the in-person CoreDev meetup pointed out the issue with unclean stacks. A simple fix would be to allow tail-recursion to occur if the stack is not clean or if there is a single item on the stack, and the alt-stack is not empty. The writer disagrees with the design requirement of SigOp counting as it is flawed and limits the number of CHECKSIGs potentially encountered in script execution, even in an unexecuted branch. Additionally, other resources used by scripts that should be globally limited, such as hash operations, are not accounted for at this time. Instead, the writer suggests having the witness commit to the maximum resources consumed by validation of the spend of the coin, to relay this data with the transaction and include it in the SigHash, and to use the committed maximum for block validation. Witness script versioning is fully compatible with P2SH and BIP173, so existing wallets will have no hurdle to pay to BIP114. The minimal BIP114 could be really simple, like just hiding scripts in a hash. There are also discussions about the complexity of the code, and whether there is a repo containing the latest implementation of BIP 114.


Updated on: 2023-06-12T18:22:25.562814+00:00