Bitcoin Covenants Part 6: Functional Encryption Covenants — Using Cryptographically Constrained Keys to Enforce Spending Rules
An examination of how functional encryption covenants could implement Bitcoin spending policies via constrained signing keys without requiring a soft fork, and the reasons why such cryptographic techniques remain impractical today.

This represents Part 6 within the technical article series covering Bitcoin covenants from Cointelegraph Research. For access to the preceding article, click here.
Modifying the consensus rules of Bitcoin extends beyond being a purely technical undertaking. Such changes demand coordination among the network's node operators, mining entities, software developers and participants in the economic ecosystem. Achieving this level of coordination presents considerable challenges, which explains why Bitcoin's foundational layer has progressively hardened over time.
Over recent years, researchers have explored whether it might be possible to implement covenant functionality without modifying consensus rules at all. In May 2024, Jeremy Rubin, who originally authored the OP_CTV proposal (BIP-119), presented a potential solution through a paper entitled FE'd Up Covenants. His architectural approach suggested employing functional encryption (FE) to relocate covenant logic from Bitcoin Script into the signing key itself.
Within conventional public-key cryptography, a private key possesses the capability to sign any arbitrary message. Under the hypothetical framework of FE-based covenants, the signing capability would be constrained to a predetermined collection of valid transactions. Bitcoin nodes would then verify the signature using OP_CHECKSIG in precisely the same manner they currently operate, thereby eliminating any requirement for a soft fork.
Functional encryption: cryptographic keys restricted to signing only rule-compliant messages
Functional encryption (FE) represents a generalization of traditional public-key encryption. Within standard cryptographic frameworks, a private key enables complete decryption of a ciphertext to recover the original plaintext. Under FE, a master secret instead generates subsidiary functional keys, where each such key exposes only a single chosen function applied to the plaintext. Anyone possessing the functional key for a function f along with the ciphertext of a secret x can calculate f(x) but never gains the ability to expose x as plaintext.
Within academic research, FE received its first formal treatment from Dan Boneh, Amit Sahai and Brent Waters in 2011. Constructions capable of handling arbitrary functions emerged starting in 2013, featuring polynomial runtime characteristics but with computational overheads vastly exceeding the capabilities of contemporary computing infrastructure. Additionally, their security foundations depended on novel, inadequately tested components known as multilinear maps. It was not until 2021 that researchers succeeded in developing constructions based on well-established cryptographic assumptions, potentially paving the way toward practical FE implementations.
The function f within an FE scheme can represent any function that is feasibly computable. Within Bitcoin covenant constructions, however, f operates as a signing function. The output it produces is a Bitcoin signature for a transaction tx. Since this signature depends on both a private key and the specific transaction being signed, it requires a minimum of two inputs, explaining why Rubin's design utilizes multi-input FE. For a covenant permitting only a single spending transaction, comparable to OP_CTV, two inputs are sufficient. More general, expressive constructions require additional arguments, as demonstrated in Rubin's f(k, tx, program, proof).
Significantly, f does not perform signing operations directly with the private key k that arrives in encrypted form. Rather, the function derives a fresh key pair by tweaking k with a hash of the covenant's spending policy. The signatures that f produces validate against the tweaked public key, rather than against the base public key P directly.
Establishing FE-based covenants
Enabling FE-based covenants from these fundamental components necessitates a setup authority. This authority generates a Bitcoin key pair (consisting of the private key k and the public key P) along with an FE key pair (comprising the master secret msk and the FE public key mpk). The authority then publishes P, mpk, k encrypted to mpk, and the functional key for f, which derives from msk. Following this, the setup authority must be trusted to destroy both k and msk. Without such destruction, it would retain the ability to sign spends violating the covenant. Once this setup concludes, an unlimited number of new covenants can be established.
Each covenant possesses its own unique key pair, obtained through tweaking (k, P) with the spending policy. The private key of this tweaked key pair exists exclusively within f and never undergoes revelation. Anyone knowing the hash of the desired spending policy can derive the public key from P. Through this mechanism, covenant receiving addresses become generatable. In practical implementation, the receiving address would commit to a 2-of-2 script requiring a signature from a user-controlled key alongside the FE signature. This design prevents unauthorized parties from initiating transactions that the covenant permits.
Creating an FE signature for a covenant spend requires the signer to take a tx that complies with the spending policy and encrypt it to mpk. Utilizing the encrypted tx, in combination with the encrypted k and the functional key published by the authority, they can subsequently evaluate f. The function f signs tx using k tweaked by the hash of the spending policy. Any transaction violating the spending policy of the address holding the coins could at most be signed for some alternative, differently tweaked public key that lacks control over the funds. The function f can additionally be constructed to block such signatures entirely.
The generalized version of FE-based covenants featuring f(k, tx, program, proof) demonstrates strictly greater expressiveness than OP_CTV. The general function that Rubin proposed accepts a program that validates a condition on the transaction at the moment of spending, along with a zero-knowledge proof demonstrating that the program accepts the transaction.
This zero-knowledge proof enables the practical implementation of the FE scheme, though it does not contribute conceptually to its design. A single fixed f operates effectively regardless. Absent the proof, f would need to function as a general interpreter executing any given program on tx directly. Such an f would be large and expensive to evaluate under FE. With the proof included, f merely needs to verify a succinct proof. This arrangement could enable the enforcement of arbitrarily complex covenants without requiring additional complexity in f. The proof also permits a spending policy to depend on data external to the transaction, such as outcomes from off-chain computations.
The reasons FE-based covenants remain unfeasible at present
Goldwasser et al. (2014) presented multi-input FE and constructed it upon indistinguishability obfuscation. Multi-input FE and obfuscation are understood to imply each other. Ananth and Jain (2015) demonstrated that even single-input FE for general circuits produces obfuscation once compactness is achieved. The cryptographic primitive required by this design is therefore at least as difficult to construct as so-called indistinguishability obfuscation itself. Practical implementations of this principle remain confined to toy-scale experiments.
Carmer, Malozemoff and Raykova (2017) required 3.7 hours to obfuscate a 12-bit pseudorandom function, a toy circuit comprising approximately 62,000 gates with a 64-bit key, far smaller than ECDSA signing operations on 256-bit numbers. The resulting obfuscated program consumed 120 GB of disk space, and a single evaluation required 67 minutes with 128 GB of RAM. The implementation cost of such a scheme would burden whoever generates the signature, not Bitcoin nodes. The authors characterized this as "still far from practical."
Moreover, FE schemes that achieve practicality cover only limited function classes, such as the inner products of Abdalla et al. (2015), and the specific type of ECDSA signing necessary for Bitcoin covenants falls outside these classes. Rubin's paper acknowledges this limitation and identifies underdeveloped cryptography and the setup trust assumption among its disadvantages. CTV-style opcodes remain substantially more efficient in terms of bytes and verification, though they necessitate a base-layer modification.
Our next article examines Un-FE'd Covenants, which Rubin proposed to approximate covenant functionality without depending on impractical FE schemes. This approach substitutes FE with oracle signers bonded through BitVM. [alloc]init's Bitcoin PIPEs originated in 2024 as an FE design and transitioned in 2026 to witness encryption. This proposal will receive coverage in a subsequent article.