Mar 21, 2024

Bitcoin Covenants: Can We Scale Beyond +100M Users?

As the Bitcoin ecosystem matures, the need for enhanced functionality and security becomes increasingly evident.

Bitcoin Covenants: Can We Scale Beyond +100M Users?

As the Bitcoin ecosystem matures, the need for enhanced functionality and security becomes increasingly evident. Bitcoin covenants are a transformative concept that could unlock greater scalability and empower its layer 1 as well as the Lightning Network.

Defining Bitcoin Covenants

A general definition of financial covenants is “a promise, agreement, or contract between two parties, whereby two parties agree that certain activities will or will not be carried out”.

Bitcoin covenants are similar, as they represent a set of rules embedded within Bitcoin's scripting language that govern how a specific bitcoin can be spent. These covenants are a way to impose restrictions or conditions on the movement of funds. 

By introducing this programmability feature, covenants can enhance greater functionality, security, and lower fees.

How Bitcoin Covenants Work

Basic Covenants Definition

When a Bitcoin transaction is initiated, the user can specify a covenant that dictates the conditions for spending the involved bitcoin. These conditions can range from simple timelocks to complex multi-signature requirements. Once the covenant is deployed, the bitcoin becomes subject to these predetermined rules, ensuring that it is spent according to the specified conditions.

Bitcoin covenants allow for a diverse range of applications.

Vaults, for example, incorporate a time-lock mechanism, preventing unauthorized spending for a predetermined period, and enhancing security by deterring immediate theft of funds in case of compromised private keys. 

Payment channels are another example of covenants. They could facilitate efficient and faster off-chain transactions by enabling intermediaries to process transactions without requiring on-chain confirmations, reducing transaction fees, and improving scalability.

Some of the concrete use cases are:

  • Escrow Services: Covenants can provide a trustless and transparent environment for secure transactions.
  • Conditional Payments: Covenants empower conditional payments, allowing funds to be released based on pre-agreed conditions or milestones.

Example of CTV-style Covenant Escrow Service

  • Step 1: Alice wants to buy a product from Bob but wants to ensure that Bob delivers the product as promised.
  • Step 2: Alice sends her bitcoin to an escrow address, which is governed by a covenant.
  • Step 3: The covenant stipulates that the bitcoin can only be released to Bob if Alice confirms receipt of the product.
  • Step 4: Upon receiving the product, Alice triggers the covenant, releasing the bitcoin to Bob.

Concerns and Considerations

While Bitcoin covenants hold immense promise, their implementation also presents risks that need to be addressed. Many highly respected Bitcoiners, such as Adam Back and Andreas Antonopoulos, have raised concerns on the matter.

In particular, Antonopoulos has been a vocal opponent of recursive covenants. Those are covenants that restrict not only the native transaction but all the other transactions after that, resulting in a limitless domino effect that could make certain bitcoin unusable.

In summary, the main problems raised by the CTV proposal are the following:

  • Fungibility: Covenants could make some coins de facto different from others, breaking one of the basic characteristics of a commodity, which is homogeneity. Covenants could make certain bitcoin unusable for some, if not all users
  • Complexity: Bitcoin covenants could increase the learning curve for users and potentially hinder adoption or cause unexpected and detrimental behaviors.
  • Security Concerns: Covenants pose the risk of introducing vulnerabilities into the system, compromising the security of bitcoin funds.

Harnessing CTV for Enhanced Lightning Network Scalability and Security - The Enigma Network

What is CTV

CHECKTEMPLATEVERIFY (CTV) is an opcode that belongs to the Bitcoin scripting language, the programming language used to develop the Bitcoin blockchain.

An opcode is a basic, primitive piece of code or instruction that allows developers to program operations within the blockchain.

CTV has been proposed in the BIP-119 as a solution to equip the Bitcoin blockchain with covenant features like vaults, non-interactive payment channel creations and congestion controlled batching, presenting an efficient way to construct discrete log contracts, payment pools, and others.

“This BIP introduces a simple covenant called a template which enables a limited set of highly valuable use cases without significant risk. BIP-119 templates allow for non-recursive fully-enumerated covenants with no dynamic state. CTV serves as a replacement for a pre-signed transaction oracle, which eliminates the trust and interactivity requirements.” - Bitcoin Wiki

Current Obstacles in the Lightning Network

One of the primary limitations of the Lightning Network is its reliance on individual users establishing separate payment channels with each other. This process can become cumbersome and inefficient as the network grows larger.

“It actually came from the original lightning paper. They did the math on if people wanna do one or two channel management operations per year, the Bitcoin network throughput, which is about seven transactions per second, can only handle about 10 to 100 million people using Bitcoin with one to two channel management operations per year. So it’s actually quite.

That’s 100 million people with one to two per year. So, it’s really, like I said, a 10 to 100 million is really the practical limit if people do more than two channel net actions per year.” - Brandon Black

The Lightning Network presents scalability and security problems that are still subject to ongoing research and development. The introduction of CTV holds interesting potential to address these challenges and unlock new possibilities for the Lightning Network.

One of the most interesting proposals is the Enigma Network, a settlement layer designed to operate in the middle between Bitcoin layer 1 and all the other Layer 2 solutions, like Lightning. This would effectively make the Lightning Network a layer 3.

Core Elements of the Enigma Network: Shared UTXOs, or Transaction Aggregation

In the traditional Bitcoin system, each transaction represents a discretionary exchange of funds between two parties. CTV introduces the possibility of enacting Transaction Aggregation.

This method breaks away from the traditional paradigm, allowing multiple transactions to be bundled together into a single, cohesive unit. 

The main advantage of the CTV-based Enigma Network for Lightning would be the possibility to create non-interactive lightning channels. These channels wouldn’t need to be mutually established, and could remain “dormant” until needed. This feature enhances privacy and efficiency by eliminating the need for fresh transactions when re-establishing channels.

Schematic Representation of a Payment Pool

A description of how payment pools could work — Source

This aggregation process offers several distinct advantages.

  • Enhanced Network Efficiency: By consolidating multiple transactions into a single bundle, Transaction Aggregation reduces the overall transaction volume on the blockchain. This translates to lower transaction fees, faster processing times, and improved network scalability.
  • Enhanced User Privacy: By grouping multiple transactions together, it makes tracing individual transactions more challenging, enhancing user privacy and anonymity.

Redefining UTXO Ownership and Introducing New UTXO Types

In order to comprehend Transaction Aggregation it’s useful to adopt an alternative classification for UTXOs, or Unspent Transaction Input. UTXOs are the building blocks of the Bitcoin blockchain, and in order to comprehend the new framework that CTV enables, we need to define some "subcategories" of UTXO.

  • Anchor UTXOs (ATXOs): ATXOs serves literally as an “anchor” between the on-chain activity and the off-chain activity (layer 2). They are the only type of UTXO that goes on-chain, ensuring that the bundle's validity is verifiable by the entire network.
  • Lightweight UTXOs (LTXOs): LTXOs represent the bitcoin held within Lightning Network channels.
  • Settlement UTXOs (STXOs): STXOs are the actual transactions occurring within an aggregated bundle. They are not directly stored on-chain, but rather exist within the ATXO's hash, providing a secure and private record of transactions.

Navigating the Transaction Graph

Transaction Aggregation transforms the way transactions can be interpreted on the blockchain. Instead of a linear sequence of individual transactions, the blockchain becomes a network, with ATXOs acting as nodes and STXOs and VTXOs connecting them. This interconnected net allows users to easily track their funds and transactions, while maintaining privacy and scalability.

Scheme of a UTXO set that could potentially represent multiple transactions — Source

Here is an allegorical explanation of how CTV and the Enigma Network work:


“Covenants of the basic sort, the CTV sort, won’t immediately enable many-party lightning channels. But they might enable something like John Law has a post, which is very, very technical, but gets into this concept called timeout trees. And it might enable something like that, which timeout trees enable you to kind of have a shared UTXO which spawns many one-to-one lightning channels, which is almost the same as a many-party lightning channel, but not actually the same.

And it does enable many more people to use Lightning because you can have a single UTXO and from that one UTXO you can spawn many channels to many different pairs of people.” - Brandon Black

Bitcoin covenants could represent a significant step forward in the evolution of Bitcoin, offering a powerful tool for enhanced security, functionality, and programmability. While challenges remain, CTV is a proposed implementation designed to have a minimal impact on the functioning of the Bitcoin Blockchain. 

As the Bitcoin community continues to explore and develop these capabilities, we can expect to see covenants revolutionize the way we use Bitcoin, once a reasonable level of consensus is achieved.

Bitcoin could function well for everybody for another 10 years, meanwhile Bitcoiners from all over the world are already working on solutions to enable greater properties and make Bitcoin accessible to everybody in the world.

About the author.