Before They Were Cool: Covenants In Production Nn Liquid

By Bitcoin Revista - fa 6 mesos - Temps de lectura: 6 minuts

Before They Were Cool: Covenants In Production Nn Liquid

Des de la Bitcoin community embarked on discussions surrounding the optimization of covenants, there's been a growing interest in learning more about their tradeoffs and the covenants already deployed on the Xarxa de líquids.

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.

Història dels pactes sobre líquids

Covenants on Liquid can be traced back to the deployment of the first Elements sidechain, Alfa. 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, Com ara OP_CAT—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, and a proof-of-concept Möser-Eyal-Sirer vault was developed utilizing CSFS to illustrate the new possibilities.

Un dels aprenentatges de la implementació de CSFS va ser que fa que els pactes siguin més complexos en requerir que les dades de transaccions s'enviïn a la pila quan es realitza una despesa de pactes. També es va observar, a partir de l'experiència dels desenvolupadors, que amb els pactes CSFS, les dades de transacció que componen el hash de la signatura s'han de reconstruir a la pila, cosa que podria obligar els desenvolupadors a enviar dades irrellevants per a les entrades/sortides de la transacció que els interessin.

To simplify covenant construction, more than 30 new opcodes called introspection opcodes were introduced in Liquid’s Taproot millorar 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.

Liderar les propostes de pacte

Actualment, el 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). Senzillesa, 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'll revisit this later).

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 és un codi operatiu que llegeix un hash de la pila i el compara amb un hash d'un subconjunt especificat de les dades de la transacció de despesa. La seva flexibilitat promet permetre un conjunt divers d'aplicacions que inclouen, entre d'altres, el control de la congestió, les voltes i els grups de pagaments rudimentaris.

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. 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.

Aconseguint una funcionalitat similar amb els codis operatius líquids

While Liquid doesn't have the CTV and VAULT opcodes, it does have CSFS and CATALÀ 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 using Liquid covenant opcodes in one discussion with James O’Beirne on X.

Similarly, a way to achieve APO functionality was made possible with CSFS. This Demo utilized various opcodes that would enable layer-2 protocols like eltoo 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 doesn't apply to Taproot transactions, which would introduce its own form of added complexity.

Liquid Opcodes en acció

Many applications have already taken advantage of covenant opcodes on Liquid. Steven Roose, a covenant proponent who recently definit a specification for the previously ideated OP_TXHASH, has developed an aplicació 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’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 combinació of signature verifications and introspection opcodes to accomplish this, and the most important part is it’s all auditable on chain.

Other applications of covenants on Liquid include options contracts and confidential asset-based loans. The Blockstream Research team released a whitepaper last year (see accompanying entrada de bloc) 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.’

Per què no a Liquid First?

A mesura que el 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'll 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 Senzillesa, 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 investigador Sanket Kanjalkar has already done this work for CTV. Using 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 enllaç.

Amb un llarga història 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's worth asking: why not try it on Liquid first?

Aquest és un missatge de convidat de Randy Naar. Les opinions expressades són totalment pròpies i no reflecteixen necessàriament les de BTC Inc o Bitcoin Revista.

Font original: Bitcoin Magazine