Basic vault prototype using OP_CAT

Basic vault prototype using OP_CAT

Original Postby rijndael

Posted on: February 22, 2024 13:42 UTC

The innovative approach discussed involves leveraging CAT within scripts to enhance the construction of covenants in Bitcoin transactions, particularly focusing on the utilization of BIP341 SigMsg elements.

The method entails assembling various elements of SigMsg and selectively pre-committing to specific elements to be fixed within the script, while the remaining elements are included in the transaction witness. This process facilitates the dynamic composition of SigMsg within the script itself. Subsequently, a tagged hash is constructed using the assembled SigMsg, which is further enriched by concatenating additional tag values along with duplicates of the secp generator point. This complex assembly is then hashed to derive the s value of a Schnorr signature, which crucially validates the transaction.

An interesting aspect of this methodology is the exploration of efficiency through the strategic pre-concatenation of "free" SigMsg values outside of the script, rather than stacking them directly within it. This tactic, although not initially implemented to maintain code flexibility for experimental purposes, presents a potential for optimizing byte usage within the script. The mention of BSST (Bitcoin Script Simulation Test) as a tool sheds light on its capability to quantify the overhead incurred by not pre-concatenating these values, indicating a valuable avenue for further experimentation and refinement of the script construction process. This highlights an area of technical depth where significant optimizations can be achieved, pointing toward a broader landscape of innovation within Bitcoin scripting and covenant creation.