ANYPREVOUT in place of CTV



Summary:

The discussion on the proposed use case for ANYSCRIPT part of APOAS in Bitcoin-dev mailing list is centered around the commitment to amount and its implications. Nadav Ivgi notes that APOAS|SINGLE, with the ANYONECANPAY behavior, is useful in cases where the covenant needs to restrict a single output, such as vaults or spacechains. This allows fee-bumping the unvault tx by adding more inputs and a change output, as well as unvaulting multiple outputs in a single transaction. For spacechains, it makes it possible to add the spaceblock hash OP_RETURN and pay fees directly in the tx chain instead of using an additional tx to prepare an output that gets spent in the tx chain. CTV does not commit to input amounts, which has practical implications. If it committed, sending an incorrect amount will make the covenant-encumbered spend path unusable. With CTV, sending a slightly lower amount results in slightly lower fees, while any extra gets spent/burned on fees. The covenant spend path only becomes unusable if the amount is too low to cover for the outputs. The ability to allow for additional inputs with unknown amounts makes it possible to fee-bump the covenant spending transaction with whole utxos and no change. This also makes it possible to resolve the under-payment issue described above by adding an input that covers the original intended amount.Darosior suggests doing a tweaked version of BIP118 in place of (or before doing) BIP119. SIGHASH_ANYPREVOUTANYSCRIPT can emulate CTV just fine if its "ANYONECANPAY" behavior is made optional. Although CTV advocates have been presenting vaults as the flagship usecase, Darosior believes that using APO-AS covers it and is not a couple dozen more virtual bytes that are going to matter for a potential vault user. Given the interest in simple covenants and better off-chain protocols, Darosior thinks that BIP118 is a soft fork candidate that could benefit more (if not most of) Bitcoin users. Overall, the discussion revolves around the commitment to amount and its implications on the proposed use case for ANYSCRIPT part of APOAS. The suggestions put forward include doing a tweaked version of BIP118 in place of (or before doing) BIP119 and making the commitment to amount optional behind a flag.


Updated on: 2023-06-15T19:24:14.400664+00:00