Published on: 2022-02-02T01:43:38+00:00
Anthony Towns shared a script template on the Bitcoin-dev mailing list that can be used to simulate CTV (Covenants) on the Liquid blockchain using new element opcodes. Although this approach is less efficient than having a dedicated opcode, it can be effective for many useful applications. The script template involves several INSPECT and SHA256 opcodes, which are used to determine the spending transaction's txid.If the NUMINPUTS is greater than one, there is a need to limit the usage of other inputs, which would be specific to the application being developed. Anthony believes that this emulation might be compatible with confidential assets/values but is uncertain. He also suggests that a similar approach using CHECKSIGFROMSTACK instead of "EQUAL" could be used to construct APO-style signatures on elements/liquid. However, he advises wrapping the output inspection blocks with "INSPECTNUMOUTPUTS GREATERTHAN IF .. ENDIF" and starting with "PUSH[FakeAPOSig] SHA256 DUP SHA256INITIALIZE SHA256UPDATE" to avoid potential misuse in a different context.Anthony notes that the Liquid network, which currently has approximately $120M worth of BTC and $36M worth of USDT, is not congested and does not have many lightning channels built on top of it. As a result, the vaulting application appears to be the most interesting one to build on top of Liquid at present. This suggests that there may be a justification for exploring vault-related work on the Liquid blockchain. Real experience with CTV-like constructs is expected to provide valuable insights.On January 5th, Jeremy via bitcoin-dev proposed CTV as a simple covenant type with minimal validation burdens. It is designed to offer simplicity, flexibility, and power for building various useful applications. The new element opcodes make it possible to simulate CTV on the Liquid blockchain or liquid-testnet if fake money is preferred. While the script template provided in the context is not as efficient as a dedicated opcode, it can still be used when NUMINPUTS is one. In this case, the txid of the spending transaction is fixed due to taproot-only opcodes and the absence of scriptSig malleability.
Updated on: 2023-08-02T05:33:36.243747+00:00