Merkle branch verification & tail-call semantics for generalized MAST



Summary:

Mark Friedenbach has proposed two new features to be added to the bitcoin protocol via soft-fork activation. These features are Tail-call execution semantics and MERKLE-BRANCH-VERIFY (MBV). MBV allows script authors to force redemption to use values selected from a pre-determined set committed to in the scriptPubKey, without requiring revelation of unused elements in the set for both enhanced privacy and smaller script sizes. Tail-call execution semantics allow a single level of recursion into a subscript, providing properties similar to P2SH while at the same time more flexible. The implementation of these features is simple enough, and the use cases compelling enough that BIP 8/9 rollout of these features could happen quickly. There were some changes made to the hashing function fast-SHA256 so that an internal node cannot be interpreted simultaneously as a leaf. MERKLEBRANCHVERIFY was changed to verify a configurable number of elements from the tree, instead of just one. Tail-call eval was restricted to segwit scripts only, so that checking sigop and opcode limits of the policy script would not be necessary.Friedenbach believes that these two features together are enough to enable a range of applications such as tree signatures and a generalized MAST useful for constructing private smart contracts. It also brings privacy and fungibility improvements to users of counter-signing wallet/vault services as unique redemption policies need only be revealed if/when exceptional circumstances demand it, leaving most transactions looking the same as any other MAST-enabled multi-sig script.


Updated on: 2023-06-12T18:20:20.534562+00:00