Bitcoin covenants behave in a similar way to covenants in the physical world. They are script programs that put restrictions on how users can spend funds. Another way to look at Bitcoin covenants is as a category of proposed changes to consensus rules. Since Bitcoin is also in the private property realm, covenants appear to be a good fit for placing restrictions on transactions. In other words, a user could hold Bitcoin but have limitations on what they can do with it because of covenants.
This article will explore Bitcoin covenants, their uses, as well as some of their advantages and disadvantages. Covenants can be controversial. And their implementation could have long-term consequences for the anti-censorship properties initially built into the world’s largest cryptocurrency.
But, first things first. To get a solid understanding of Bitcoin, you need to learn how it works. Moralis Academy has the most comprehensive list of courses on the blockchain available anywhere. An excellent place to start is the Blockchain & Bitcoin Fundamentals course.
Improving Bitcoin – BIPs
What’s the point of creating Bitcoin covenants if they’re not going to improve Bitcoin? After all, there’s always room for improvement, and that is the purpose behind BIPs or Bitcoin Improvement Proposals. BIPs are the improvement process Bitcoin undergoes, and covenants are part of this process.
However, one of the first mentions of Bitcoin covenants in 2013 called them “an amusingly bad idea.” But later, developers started to take covenants more seriously. An IRC chat from 2014 records some prominent developers discussing the feasibility of covenants. Later in 2016, a paper titled “Bitcoin Covenants” was presented at “Scaling Bitcoin.” Such efforts got developers looking more seriously at how covenants could improve Bitcoin.
More recently, one Bitcoin developer named Jeremy Rubin described some covenant use cases in his controversial BIP119. This BIP introduces a new operation code, OP_CHECKTEMPLATEVERIFY. It is a CTV-style covenant that enables a limited set of use cases without incurring too much risk.
CTV could help Bitcoin scale by implementing Congestion Controlled Transactions. Typically when transaction traffic is high, fees increase also. But with this CTV, large payment processors can place their payments in a single transaction for confirmation purposes. This action saves block space and results in quicker and less expensive execution.
Why Use Covenants?
Bitcoin covenants have many proposed applications, from scaling Bitcoin’s transaction capacity to developing trust-minimized loans, controlling congestion, and more. They describe how to improve Bitcoin via information in code that executes under certain conditions. The goal is to advance Bitcoin’s security, scalability, and usability.
One use case for Bitcoin covenants is to restrict spending to a whitelisted set of addresses. So after buying Bitcoin, covenant proposals could limit how a user can spend that Bitcoin and where they could transfer it. Or it could allow further spending of that Bitcoin to any random address. But only after a specified period of time passes, similar to how a timelock operates. Such limits are comparable to how a bank might place restrictions on merchants suspected of illicit business practices.
We’ll look more at these types of restrictions a bit later. For now, let’s see why covenants are necessary in the first place.
Standard Bitcoin Transactions
In a standard Bitcoin transaction, a locking script protects a user’s Bitcoin. It does this by requiring conditions to be met to spend the coins. For example, a locking condition could be a denial of expenditure without a signature to prove the user has the private key to match the public key. There are also timelocks. These are similar to covenants but require a number of blocks to pass before the coins are free to spend.
So in a typical Bitcoin script, specific conditions have to be met to unlock a particular requirement. These conditions include things like signing a transaction with a private key. A covenant, however, goes further by restricting what a user can do with that specific Bitcoin.
Since we’re presently living through a crippling bear market, now is an excellent time to read our article on how to invest during a crypto bear market. In addition, understanding crypto crashes is crucial if you want to prepare for the next one. With crypto’s natural volatility, booms and busts are part of the cycle.
Script, Predicates, and Covenants
Bitcoin uses a scripting system to lock and unlock transactions called Script. It is a stack-based language that is deliberately limited in scope and not Turing complete like Ethereum’s Solidity language.
Script programs define “predicates.” Furthermore, to spend Bitcoin, users have to provide an input that satisfies a predicate associated with the funds. A standard predicate requires a digital signature for a public key, but more complex predicates are possible.
Additionally, predicates can restrict “when” transactions get authorized, but they cannot restrict “what” transactions get approved. So, once a user receives authorization to spend funds, they can send them anywhere. Therefore, covenants provide a solution for those desiring to limit what transactions get paid and which addresses get approved.
How Do Bitcoin Covenants Work?
The simplest way to understand Bitcoin covenants is to think of them as a restriction tool. For example, a user can place a covenant on the Bitcoin his wallet holds and only whitelist a few other addresses. When this wallet broadcasts a transaction to another wallet, it can only send that Bitcoin to the allowed addresses.
Since it’s believed that introducing covenants in Bitcoin as Script is impossible, some developers propose to extend the Script language to support covenants that directly interact with the transaction data. Hence covenants would extend the Script language.
Advantages and Disadvantages of Bitcoin Covenants
Developers are constantly striving to improve Bitcoin’s security and scalability, and covenants can help with this goal. Besides improving scalability, covenants can help improve security, especially against the $5 wrench attack. These $5 wrench attacks target individuals known to hold a lot of cryptocurrencies either by physically assaulting them or extorting them to hand over their private keys. After all, it’s easier for mindless thugs to carry out physical attacks than trying to hack someone’s crypto wallet.
Bitcoin uses Script, Ethereum uses Solidity, and Solana uses Rust. The Solana blockchain competes directly with Ethereum. To learn more about Rust & Solana, please follow the link. To create an NFT on Solana, check out our article on the Moralis.io blog, How to Mint a Solana NFT with Metaplex.
Like Solana, NEAR is also looking to compete with Ethereum with hopes of overcoming some of Ethereum’s shortcomings. Please find out more in our blog article about Solana vs. NEAR.
The good news is Bitcoin covenants make it harder for attackers to steal. Even if a thug forced a crypto holder to hand over his private keys, with only a select group of whitelisted addresses available, the criminal still couldn’t transfer the crypto to his wallet. That’s because a user can deploy a covenant mechanism to prevent attackers from getting control over their funds even after stealing their private keys.
Lastly, covenants can also employ a restrictive mechanism that prevents double-spending attacks.
Disadvantages – Recursive Covenants
Bitcoin covenants have various use cases, but since their implementation can be complicated, there is some controversy surrounding them, particularly in the areas of censorship and fungibility.
On the Bitcoin developer mailing list, some sub-discussions kicked off about the cons of Bitcoin covenants with prominent Bitcoin experts, including Andreas Antonopoulos, voicing concerns regarding implementing restrictive covenants (particularly with BIP119).
Antonopoulos worries that the new update and the recursive covenants could deteriorate the network. A recursive covenant happens when a programmer puts a restriction on a transaction that restricts another one down the line. This restriction starts a domino effect with limitless recursive covenants to follow. With the creation of recursive covenants, every transaction re-spending the Bitcoins would require fulfilled conditions in perpetuity. This concern brings us to some of the disadvantages of Bitcoin covenants.
Disadvantages – Censorship
Once a Bitcoin transaction is complete, coins end up in a receiving wallet. However, this wallet can place a covenant on these coins. Or, in other words, put a restriction on them. The covenant achieves this by creating a whitelist of addresses where the funds can go and a blacklist of addresses that can never receive the coin.
As mentioned with the $5 wrench attacks, whether a hacker steals a user’s private key or a physical attacker shakes him down for it, whitelisted and blacklisted addresses can prevent the thieves from sending the stolen funds to their wallets.
However, while restricting wallet addresses as to where a user can spend Bitcoin has its security advantages, it also paves the way for censorship and government control. This possibility is egregiously antithetical to Bitcoin’s philosophy from its inception.
With such a mechanism in place, authorities have the potential to force exchanges to only withdraw to covenants with control over the coin. Thus covenants can introduce the problem of gradual loss of censorship resistance.
Disadvantages – Blacklisting and Confiscation
One disadvantage of recursive covenants is they give powerful third parties control over any subsequent spending of coins that the entity currently controls. For example, a government could pass a law forcing everyone only to accept coins that the government could later seize.
This risk is already present in one form since governments can request exchanges only to send coins to addresses with a taproot spend path or multi-sig controlled by them. But the more significant concern is that implementing covenants would make it easier for state actors to enforce a sort of on-chain Know Your Customer (KYC) requirement before users could transfer their Bitcoin. In other words, goodbye to freedom and so long to the original blockchain ethos of anti-censorship.
Disadvantages – Excess Computation
Another concern is unnecessary computation with scripts compiling more than the minimum number of operations necessary for a user authorized to spend their Bitcoin.
Bitcoin already allows more complex scripts to enable contract creation, but malicious actors can abuse this capability. The cryptocurrency has been at risk of denial-of-service (DOS) attacks from transactions requiring too much CPU or memory. So, it’s not surprising that some developers worry that increased expressiveness could result in new DoS vectors with unoptimized scripts using more node resources than necessary.
Blockchain gaming and NFTs are poised to make a comeback, so now is a great time to study NFT coding before the market gets hot again.
Disadvantages – Fungibility Threats
Covenants could also interfere with Bitcoin’s fungibility, which is the ability for each Bitcoin to maintain identical function and quality. As for operation code that allows for creating deliberate recursive covenants, it could open the door for potential accidents. If a user accidentally paid into recursive covenants, those coins could never again be entirely fungible with ordinary Bitcoins.
So, covenants are helpful for scalability and security. Still, they would change the properties of specific Bitcoin units and create distinct types of digital currency with restrictions on them.
Hence, those opposing this change contend that limiting how users can spend their Bitcoin ultimately limits Bitcoin’s use as a digital currency and will have adverse effects on its fungibility and, ultimately, its value.
To the uninitiated, covenants can feel like an abstract or unnecessary topics. But, they have a long and rich history of research and can offer benefits when correctly implemented. Like everything else, however, there are risks to consider.
The Bitcoin community has firm opinions on the advantages and disadvantages of covenants. But, heated debates can be a healthy way to flush out threats to Bitcoin’s decentralized and leaderless network. Ultimately, the users will decide what’s best, and the node operators will download the software that reflects their values and point of view.