$7,505.49 -0.61%
BTC · 28w

Blockstream - Covenants in Elements Alpha

Bitcoin lets users choose rules to control how their funds can be spent and have them automatically enforced by the network. This programmatic facility enables users to set their own policies, from simple ones like multisignature to complex ones like trustless exchange. However, some policies do not currently have an obvious expression in the Bitcoin system. In this post we’ll talk about one such example, covenants, and describe how they can be implemented with a small extension to the Bitcoin script language that already exists in Elements.

A financial covenant is an agreement that restricts how funds (typically loans) may be used. The Bitcoin scripting language can be programmed to allow authorization schemes restricting who is allowed to create transactions spending particular funds. However, any party that is able to satisfy the authorization requirements is allowed to create any transaction with those funds. With covenants, one can create scripts that, not only enforce authorization schemes, but can also restrict the sorts of transactions that the funds can be spend with. For example, we can use the Möser-Eyal-Sirer vault to time lock transactions and detect malicious access to one’s funds.

Like Bitcoin, the Elements Alpha script language does not have direct access to the transaction data. Transaction data is only accessible indirectly through the OP_CHECKSIG and OP_CHECKSIGVERIFY operations. These operations take an elliptic curve public key and digital signature as inputs along with a signature hash type. They compute a double SHA-256 hash of the transaction data, modified in accordance with the specified signature hash type, and then perform a digital signature verification of the doubly hashed message data with the digital signature and public key. If the operation is successful, OP_CHECKSIG returns a value of 1 on the stack, otherwise it returns 0.


Continue on
Recent news
BTC -0.61% · · Now

BTC guide

Hello comrads and thank you for taking the time out to check out my guide this is something I've been working on for a few months now. This is in no way a get rich quick scheme. This is a easy simple ...
BTC -0.61% · · 10h

Exploring the Impossibility of Decentralization

Exploring the Impossibility of DecentralizationThis article is originally published in Albaron Ventures.Grade school might tell you anything is possible. Complete and total decentralization, however, ...
BTC -0.61% · · 12h

Noded 0.64.0 With Dhruv Bansal

Stream Noded 0.64.0 With Dhruv Bansal by Noded Bitcoin Podcast from desktop or your mobile device