Published on: 2023-06-02T13:25:39+00:00
Bitcoin developer Salvatore Ingala has proposed a new smart contract framework called MATT for Bitcoin, which includes two new opcodes (OP_CHECKINPUTCONTRACTVERIFY and OP_CHECKOUTPUTCONTRACTVERIFY) that enhance Script with capabilities such as deciding the taptree of the output and embedding dynamically computed data within it. These opcodes enable general smart contracts and fraud proofs. The proposal also discusses Simplicity, a proposal to replace Script with a better language, but notes that it is separate from the discussion on what features should be included in the language.Ingala's proposal for new opcodes allows for the creation and verification of covenant-style contracts. The opcodes can be used to embed data into P2TR output scripts and verify that the correct data is present in subsequent transactions. However, the author suggests adding an opcode like OP_SHA256CAT to allow the data embedding to commit to multiple pieces of data. There is also consideration for extending OP_CHECKOUTPUTCONTRACTVERIFY to apply for arbitrary inputs, allowing for more complex cross-input semantics.The post describes a specific example of a vault using the proposed opcodes. A vault is modeled as a simple state machine with two states: the initial vault UTXOs and the utxo produced by the trigger transaction during unvaulting. The post explains how these opcodes could be used in the context of a vault, which controls the behavior of coins. It also discusses preserving amount in covenant-style contracts, including approaches such as direct introspection on output amounts and deferred checks.The structure of the P2TR output scripts for both the vault and unvaulting state are described. The proposed vault implementation differs from OP_VAULT in that it does not support adding an additional output sent back to the same vault. The author argues that separating the ctv-hash from the scripts in the taptree makes it easier to program state machines that control the behavior of coins.Overall, the proposal presents new opcodes that could enable more complex covenant-style contracts on Bitcoin. The required engineering for a soft-fork is relatively straightforward if the desired features are implemented. However, the decision to implement these features should consider potential risks to Bitcoin caused by their effect on miners' incentives. Comments and feedback on the proposal are welcome from the Bitcoin community.Another aspect of Ingala's proposal involves P2TR-based vaults, which provide an added layer of protection for storing Bitcoin securely. These vaults allow users to specify spending conditions that must be met before funds can be withdrawn. The proposal includes parameters for the vault contract and describes the structure of the vault state [V] and unvaulting state [U]. It also discusses how the proposed opcodes can be used to create vaults comparable to those built with OP_VAULT.Ingala's proposal for smart contracts in Bitcoin has two core opcodes that can be used to create vaults comparable to those built with OP_VAULT. These opcodes enhance Script with capabilities such as deciding the taptree of the output and embedding dynamically computed data in the output. However, further implementation is required since the opcodes only operate on scriptPubkey and not on the amounts.In summary, Salvatore Ingala has proposed a new smart contract framework called MATT for Bitcoin, which includes new opcodes to enhance Script and enable more complex covenant-style contracts. The proposal discusses the use of these opcodes in creating vaults and preserving amounts in covenant-style contracts. The structure of the P2TR output scripts for the vault and unvaulting state is described, highlighting the differences from OP_VAULT. The proposal aims to make it easier to program state machines that control the behavior of coins. Feedback from the Bitcoin community is welcomed on the proposal.
Updated on: 2023-08-02T09:20:10.117249+00:00