# Before They Were Cool: Covenants in Production on Liquid

Source URL: https://blog.blockstream.com/covenants-in-production-on-liquid
Updated: 2026-11-19T19:24:48.000Z
Author: Randy Naar
Published: Nov 14, 2023
Category: Liquid Network

---

Ever since the Bitcoin community embarked on discussions surrounding the optimization of covenants, there has been a growing interest in learning more about their tradeoffs and the covenants already deployed on the [Liquid Network](https://docs.liquid.net/docs/technical-overview). 

In light of this renewed interest and to encourage further discussion, let's review some of Liquid's current covenant offerings, comparing them with the leading proposals on Bitcoin and examining their respective use cases.

## History of Covenants on Liquid  

Covenants on Liquid can be traced back to the deployment of the first Elements sidechain, [Alpha](https://blog.blockstream.com/en-covenants-in-elements-alpha). This sidechain introduced the opcodes OP\_CHECKSIGFROMSTACK (CSFS) and OP\_DETERMINISTICRANDOM along with a number of others to Elements. Alpha also enabled fixed versions of opcodes disabled in early Bitcoin, such as [OP\_CAT](https://blog.blockstream.com/cat-and-schnorr-tricks-ii)—an opcode many are choosing to revisit in the growing dialogue across social media. These new opcodes further improved the expressivity of the version of Bitcoin Script available in [Elements](https://blockstream.com/elements), and a proof-of-concept [Möser-Eyal-Sirer vault](https://maltemoeser.de/paper/covenants.pdf) was developed utilizing CSFS to illustrate the new possibilities.

One of the learnings from implementing CSFS was that it makes covenants more complex by requiring transaction data to be pushed on the stack when performing a covenant spend. It was also observed from developer experience that with CSFS covenants, the transaction data that make up the signature hash has to be reconstructed on the stack, potentially forcing developers to push data irrelevant to the transaction inputs/outputs they are interested in.

To simplify covenant construction, more than 30 new opcodes called [introspection opcodes](https://glossary.blockstream.com/introspection-opcodes/) were introduced in Liquid’s Taproot [upgrade](https://blog.blockstream.com/tapscript-new-opcodes-reduced-limits-and-covenants) for a more modular approach. Introspection opcodes with CSFS, for example, enable the inspection of more granular parts of the transaction during a spend by placing it on the stack. This alleviates the responsibility of assembling partial transaction data via the witness and, therefore, the signature hash on the stack.

## Leading Covenant Proposals  

Currently, the Bitcoin community is discussing a laundry list of potential covenant proposals, including SIGHASH\_ANYPREVOUT (APO), OP\_TXHASH, CSFS, OP\_CAT, OP\_TLUV, the MATT opcode OP\_CHECKCONTRACTVERIFY (CCV), OP\_VAULT, and OP\_CHECKTEMPLATEVERIFY (CTV). [Simplicity](https://blog.blockstream.com/simplicity-language), a next-generation scripting language that could implement functionality similar to many covenants at a lower level, is also a potential route for Bitcoin (we will revisit this later).

Christian Lewe from the Blockstream Research team discusses Simplicity and how its use of combinators and jets could enable the functionality of popular covenants like CTV and APO with a single soft fork.

There has been a lot of talk about the VAULT opcode, which was created to address the need for easier ways to secure bitcoin for users. This opcode would allow coins to be locked in an address that can only spend to two addresses: a hot wallet after a timelock or immediately to a cold wallet. Several other variant schemes have been proposed, but they depend on adopting CTV first.

CTV is an opcode that reads a hash from the stack and compares it to a hash of a specified subset of the spending transaction’s data. Its flexibility promises to enable a diverse set of applications including but not limited to: congestion control, vaults, and rudimentary payment pools.

Apart from opcodes, there have been proposals for sighashes to enable covenants. The two most popular proposals for this purpose are APO and SIGHASH\_GROUP. APO is an evolution of the SIGHASH\_NOINPUT opcode, which is widely recognized as a prerequisite for implementing [eltoo](https://blockstream.com/eltoo.pdf). One of the many improvements made possible with eltoo is the elimination of the penalty mechanism that forces the other party to forfeit funds when broadcasting an outdated channel state. This allows for a more user-friendly and efficient Lightning Network.  

## Achieving Similar Functionality with Liquid Opcodes  

While Liquid does not have the CTV and VAULT opcodes, it does have CSFS and [CAT](https://blog.blockstream.com/cat-and-schnorr-tricks-i) for covenants. By using these more narrowly defined opcodes with the aforementioned introspection opcodes, developers have opened up new financial possibilities with functionality similar to CTV and VAULT to augment the sidechain.

For example, Burak, a seasoned Liquid developer and creator of the layer-2 protocol Ark, has demonstrated an [emulation of VAULT](https://brqgoo.medium.com/emulating-op-vault-with-elements-opcodes-bdc7d8b0fe71) using Liquid covenant opcodes in one discussion with James O’Beirne on [X](https://twitter.com/brqgoo/status/1636394034511101956?s=20).

Similarly, a way to achieve APO functionality was made possible with CSFS. This [demo](https://bitcoin.stackexchange.com/questions/89537/how-to-emulate-sighash-noinput-using-checksigfromstackverify) utilized various opcodes that would enable layer-2 protocols like [eltoo](https://blog.blockstream.com/en-eltoo-next-lightning) on Liquid today but suffers from added complexity and a larger transaction size compared to the proposed usage of the APO-type covenant. Moreover, the construction does not apply to Taproot transactions, which would introduce its own form of added complexity. 

## Liquid Opcodes in Action  

Many applications have already taken advantage of covenant opcodes on Liquid. Steven Roose, a covenant proponent who recently [defined](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-September/021975.html) a specification for the previously ideated OP\_TXHASH, has developed an [application](https://github.com/stevenroose/doubletake) for fidelity bonds on Liquid. This covenant is placed on funds that would be burned if evidence of a double spend is presented in the witness.

[Fuji Money](https://fuji.money/)’s Fuji USD (FUSD), an algorithmic stablecoin developed by Vulpem Ventures is another notable example. It relies purely on oracle information to maintain its peg and can be issued in a decentralized manner. It uses a [combination](https://vulpem.com/synthetic-asset-smart-contract.pdf) of signature verifications and introspection opcodes to accomplish this, and the most important part is it is all auditable on chain.

Other applications of covenants on Liquid include options contracts and [confidential asset-based loans](https://ruggedbytes.com/articles/ll/). The Blockstream Research team released a [whitepaper](https://blockstream.com/assets/downloads/pdf/options-whitepaper.pdf) last year (see accompanying [blog post](https://blog.blockstream.com/use-smart-contracts-on-liquid-to-deploy-financial-products)) about the former, explaining how such an options contract could be constructed using the new set of introspective opcodes. These new opcodes allow users to trustlessly create tokens representing both sides of a covered call option contract and sell the opposite position they wish to take. Contracts made in this fashion also support partial fills, meaning the user who created the contract can sell positions representing a multiple of a user-specified minimum amount of the collateral asset, called the ‘contract size.’

Learn more about the opcode covenants available on Liquid and how they enable atomic swaps. The video covers the history of atomic swaps, gives examples of some services and products that use them in different capacities, and explores the typescript code needed to make these types of covenants using a library called [LiquidJS](https://github.com/vulpemventures/liquidjs-lib).

## Why Not on Liquid First?  

As the Bitcoin ecosystem continues to have a healthy debate regarding covenant opcodes, Liquid offers its own set of tools, catering to similar objectives but with distinct implementations. As the dialogue evolves, it will be intriguing to witness the interplay between Bitcoin's native proposals and Liquid's already concrete and live covenant-related features and emulation of Bitcoin covenant proposals implemented using Elements Script. 

Another new technology on the horizon is [Simplicity](https://github.com/BlockstreamResearch/simplicity), a verifiable programming language for the blockchain. The Simplicity language is defined by operations with very narrow semantics that can make expressive programs when composed together. The language is also verifiable, which means methods can be established to mathematically prove assertions made on Simplicity programs.

Simplicity's expressive nature allows covenant opcodes from Script to be seamlessly ported, ensuring greater reliability and fewer unexpected behaviors. Bitcoin researcher [Sanket Kanjalkar](https://twitter.com/sanket1729) has already done this work for CTV. Using [s-lang](https://github.com/BlockstreamResearch/s-lang), a more readable Bitcoin-centric programming language that compiles down to Simplicity, he was able to replicate the semantics in a workable proof-of-concept available for anyone to try today.

Bitcoin developers will soon have the opportunity to use s-lang in a real environment thanks to Liquid's integration of Simplicity, targeted for Q2 2024\. s-lang will bring the construction of more complex applications to Liquid, such as vaults and delegation. The draft PR is available for review at the following [link](https://github.com/ElementsProject/elements/pull/1219).

[![](https://storage.googleapis.com/dxp-staging-assets/blog/body/covenants-in-production-on-liquid/Screenshot-2023-11-14-at-00.26.01.png)](https://twitter.com/adam3us/status/1517945477718847489?s=20)

With a long history of Liquid as an early adopter of ideas that have been later ported to Bitcoin, a suggestion for those looking to showcase the viability of their proposals is to try it live on Liquid to validate ideas first—as multiple covenant-related opcodes have been shown to be emulatable using existing Liquid covenant and introspection opcodes.

So, the next time someone suggests a new covenant, it is worth asking: why not try it on Liquid first?

_An earlier version of this article was posted originally on Bitcoin Magazine: <https://bitcoinmagazine.com/technical/before-they-were-cool-covenants-in-production-on-liquid>_

## Blog Categories

- [All Posts](https://blog.blockstream.com/)
- [Blockstream Finance](https://blog.blockstream.com/blockstream-finance)
- [Company](https://blog.blockstream.com/company)
- [Lightning Network](https://blog.blockstream.com/lightning-network)
- [Blockstream Mining](https://blog.blockstream.com/blockstream-mining)
- [Blockstream Explorer](https://blog.blockstream.com/blockstream-explorer)
- [Blockstream Satellite](https://blog.blockstream.com/blockstream-satellite)
- [Liquid Network](https://blog.blockstream.com/liquid-network)
- [Blockstream Jade](https://blog.blockstream.com/blockstream-jade)
- [Blockstream AMP](https://blog.blockstream.com/blockstream-amp)
- [Blockstream App](https://blog.blockstream.com/blockstream-app)
- [Blockstream Research](https://blog.blockstream.com/blockstream-research)
- [Cryptocurrency Data Feed](https://blog.blockstream.com/cryptocurrency-data-feed)
- [Elements](https://blog.blockstream.com/elements)
- [Layer-2 Roundup](https://blog.blockstream.com/layer-2-roundup)
- [Quarterly Report](https://blog.blockstream.com/quarterly-report)
- [Layer-2 Report](https://blog.blockstream.com/layer-2-report)
- [Simplicity Language](https://blog.blockstream.com/simplicity-language)
- [Quarterly Update](https://blog.blockstream.com/quarterly-update)
- [Quantum](https://blog.blockstream.com/quantum)
- [Enterprise](https://blog.blockstream.com/enterprise)
- [Insights](https://blog.blockstream.com/insights)
- [Simplicity](https://blog.blockstream.com/simplicity)
- [Developer](https://blog.blockstream.com/developer)
- [Security](https://blog.blockstream.com/security)
- [Jade](https://blog.blockstream.com/jade)
- [Liquid](https://blog.blockstream.com/liquid)
- [Lightning](https://blog.blockstream.com/lightning)
- [Research](https://blog.blockstream.com/research)
- [Core Lightning](https://blog.blockstream.com/core-lightning)
