Exploring Covenants on the Liquid Network

Ever since the bitcoin community engaged in discussions about covenant optimization, there has been a significant interest in understanding the tradeoffs and exploring the covenants already implemented on the Liquid Network. In order to facilitate further discussion, let’s take a closer look at the current covenant offerings on Liquid, compare them with leading proposals on bitcoin, and examine their respective use cases.

A Brief History of Covenants on Liquid

Covenants on Liquid can be traced back to the deployment of the first Elements sidechain called Alpha. This introduction brought new opcodes, including OP_CHECKSIGFROMSTACK (CSFS) and OP_DETERMINISTICRANDOM, to Elements. The implementation also enabled fixed versions of opcodes disabled in early bitcoin, such as OP_CAT. These new opcodes enhanced the expressiveness of bitcoin Script in Elements, and the Möser-Eyal-Sirer vault was developed as a proof-of-concept to showcase the possibilities.

One key lesson learned from implementing CSFS was the increased complexity it added to covenants by requiring transaction data to be pushed onto the stack during a covenant spend. Developers also faced the challenge of reconstructing the signature hash on the stack, potentially resulting in the inclusion of irrelevant data. To simplify covenant construction, the Liquid Network introduced over 30 new opcodes known as introspection opcodes in its Taproot upgrade. These introspection opcodes, in combination with CSFS, allow for the inspection of specific transaction components during a spend, reducing the complexity of assembling partial transaction data via the witness and signature hash.

Leading Covenant Proposals

The bitcoin community is currently discussing various covenant proposals, including SIGHASH_ANYPREVOUT (APO), OP_TXHASH, CSFS, OP_CAT, OP_TLUV, OP_CHECKCONTRACTVERIFY (CCV), OP_VAULT, OP_CHECKTEMPLATEVERIFY (CTV), and Simplicity. OP_VAULT, in particular, has garnered significant attention as it offers an easier way to secure bitcoin for users. Other proposals, such as CTV and APO, hold promise for enabling congestion control, vaults, and payment pools.

See also  Samara Asset's $10,000 Donation Empowers Women Through Bitcoin Education in Africa

Achieving Similar Functionality with Liquid Opcodes

Although Liquid does not have the CTV and VAULT opcodes, it utilizes CSFS and CAT for covenant functionalities. Through the use of these opcodes and introspection opcodes, developers have been able to achieve similar functionality to CTV and VAULT on Liquid. For example, a VAULT emulation was demonstrated by a Liquid developer using covenant opcodes during a discussion on X. Similarly, an emulation of APO functionality was made possible using CSFS. However, these emulations introduce added complexity and larger transaction sizes compared to the proposed covenant implementations.

Liquid Opcodes in Action

Several applications have already leveraged covenant opcodes on Liquid. One example is Steven Roose’s fidelity bonds application, which utilizes a covenant that burns funds if evidence of double spend is presented. Fuji Money’s stablecoin, Fuji USD, relies on oracle information and employs signature verifications and introspection opcodes to maintain its peg in a decentralized manner. Other applications include options contracts and confidential asset-based loans. The Blockstream Research team has released a whitepaper outlining the construction of options contracts using introspective opcodes on Liquid.

Why Not on Liquid First?

As the bitcoin ecosystem continues to debate covenant opcodes, Liquid offers its own set of tools with distinct implementations to achieve similar objectives. As the dialogue progresses, it will be interesting to observe the interplay between bitcoin‘s proposals and Liquid’s concrete and live covenant-related features. Additionally, Simplicity, a verifiable programming language for the blockchain, is on the horizon. This language could seamlessly port covenant opcodes from Script, providing greater reliability and fewer unexpected behaviors. Liquid plans to integrate Simplicity in Q2 2024, enabling the construction of more complex applications.

See also  Binance Fully Integrates Bitcoin on Lightning Network

With Liquid’s track record of being an early adopter of ideas later ported to bitcoin, it is suggested that proposals be validated on Liquid first. Numerous covenant-related opcodes have already been emulated on Liquid using existing covenant and introspection opcodes. So, the next time a new covenant is suggested, it may be worth exploring it on Liquid before implementing it elsewhere.

Disclaimer: This is a guest post by Randy Naar. The opinions expressed are entirely their own and do not necessarily reflect those of BTC Inc or bitcoin Magazine.

### News source: bitcoinmagazine.com

By Team