BIP 119: Unpacking CTV and How It Would Change Bitcoin

2 years ago

When you nonstop a Bitcoin transaction currently, it goes a small thing similar this: You get an code from your recipient, you prime retired which unspent transaction outputs (or UTXOs, what the chill folks telephone “coins”) you privation to send, and you motion a transaction with your backstage cardinal that proves you authorized the spend.

On-chain transactions much oregon little each enactment this way, but for peculiar transactions that usage Bitcoin’s scripting mechanism. With these transactions, users tin utilize a peculiar tract to encode instructions for what happens to the coins successful that transaction (timelocks are the classical example).

Right now, we tin lone usage Bitcoin scripts to designate erstwhile oregon wherefore a bitcoin is spent. But what if we could usage them to designate however a bitcoin is spent? What if, for instance, we could archer a transaction to lone walk a definite magnitude of bitcoin (BTC), oregon specify that a transaction tin lone nonstop to a circumstantial address?

Enter OP_CHECKTEMPLATEVERIFY (or CTV for short), a projected Bitcoin upgrade which would present caller scripting logic for however a transaction tin walk circumstantial coin(s).

This modularity could, among different things, amended wallet information due to the fact that successful the lawsuit of a hack, the attacker tin lone nonstop the bitcoin to an code that you control.

Beyond information implications, CTV could besides alteration fiscal applications to beryllium much easy deployed connected Bitcoin, specified arsenic on-chain bitcoin options, utilizing astute contracts, similar discreet log contracts (DLCs).

Additionally, CTV could pave the mode for “payment pools” and “channel factories,” Lightning Network applications that could beryllium beneficial to custodians, exchanges and Lightning work providers. These outgo pools are off-chain, truthful they could besides furnish users with amended privacy, arsenic well.

All of these usage cases, though, don’t warrant that it’ll beryllium Bitcoin’s adjacent large upgrade.

Currently, bitcoin transactions spell from constituent A to constituent B – oregon much accurately, they are locked up by idiosyncratic A until this idiosyncratic gives idiosyncratic B the quality to unlock them. Right now, we tin lone acceptable a timelock for these coins.

“What could beryllium utile nether definite circumstances is that you mightiness privation to permission an acquisition [for however your bitcoin is spent],” Jeremy Rubin told CoinDesk.

Rubin is the writer of Bitcoin Improvement Proposal 119 (BIP 119); these BIPs are a mode for Bitcoin contributors (professional and amateur coders alike) to suggest changes to Bitcoin’s codification for reappraisal by the wider community. (Anyone tin presumption these proposals, marque their ain and remark connected BIPs via the Bitcoin Core GitHub.)

In BIP 119, Rubin introduces OP_Check_Template_Verify (CTV), a projected upgrade to Bitcoin which creates caller spending conditions that let the receiver – not the sender – to acceptable conditions for however a coin is spent.

If that doesn’t marque consciousness close now, it volition later. The important happening to enactment is that these caller conditions could fortify acold retention and make much backstage and scalable multiparty transactions and alteration a slew of different applications that are mostly marketed arsenic bringing “smart contract” compatibility to Bitcoin (via discreet log contracts (DLCs), for 1 example).

“In the existent Bitcoin locks, everything is constricted to things similar operation locks … with CTV, you get to bash things with a small spot of statefulness, which allows you to accidental a small spot of what happens next,” said Rubin.

This “statefulness” means that coins with CTV-enabled rules person to person immoderate grounds for however the coins are expected to beryllium spent. This grounds takes the signifier of a template (hence CheckTemplateVerify).

With CTV, users tin make a template that creates circumstantial spending conditions for a coin (UTXO).

Unless a broadcasted transaction meets the specifications for the CTV transaction template, nary 1 tin walk the coins associated with the template. Users embed this template successful the publication of a Bitcoin transaction and enforce it utilizing instructions specified by the OP_CTV acquisition successful the Bitcoin transaction (in Bitcoin, an OP_CODE gives peculiar instructions for publication transactions). Again, erstwhile idiosyncratic creates a transaction to walk the CTV coins, the transaction indispensable lucifer the OP_CTV template to succeed.

“You tin deliberation of OP_CTV similar a person who has a cardinal for you, but volition lone motion the circumstantial transactions you told them to motion for successful advance. However, Bitcoin scripts tin specify aggregate alternatives. So it is imaginable to make an code that says either (signature with key) oregon (transaction matching template 1) oregon (transaction matching template 2), which makes what you tin bash with CTV much flexible than conscionable 1 peculiar transaction,” said Rubin.

Developers often notation to this transaction plan – wherever an OP_CODE restricts however a transaction is spent – arsenic a covenant. Perhaps the clearest usage lawsuit for a covenant: improving acold retention and custody.

Users could make covenants that specify, for example, the coins successful their vault could lone beryllium sent to a circumstantial address, oregon that they tin lone walk 0.0025 BTC astatine a clip (these are conscionable a mates of examples that could assistance successful the lawsuit of an attack).

CTV would springiness the Lightning Network caller functionality arsenic well, giving users the quality to make “payment pools” and “channel factories,” wherever thousands of users tin fastener up funds that are represented by a azygous UTXO successful a azygous on-chain transaction.

Exchanges, custodians and mining pools could usage these transmission factories to wage retired thousands of users (on-chain) with a azygous UTXO (coin), a scaling triumph that reduces the artifact abstraction each of these transactions would different use.

And users tin exit the channels whenever they want, “without requiring signatures from some parties,” Rubin writes successful a post connected 1 of his websites.

Payment pools could besides person affirmative ramifications for idiosyncratic privacy. In summation to outgo pools taking spot off-chain, dozens to hundreds to thousands of users tin person funds locked up successful a transaction that is represented by a azygous coin on-chain, and they tin each adjacent their ain channels astatine their ain whims, making it harder wide to hint the funds.

Bitcoin mining pools could usage these outgo pools to negociate payouts, oregon custodians and users could usage them to make acold retention vaults.

Will CTV beryllium Bitcoin’s adjacent upgrade?

Plenty of Bitcoin developers and stakeholders spot benefits to CTV, but plentifulness of others accidental that the upgrade needs much cautious thought and that determination are alternatives to explore. Some opponents accidental that CTV is unnecessary oregon that proponents person not intelligibly articulated the benefits, portion a much utmost and vocal number has called the connection an “attack connected Bitcoin.”

Perhaps the astir sobering and applicable refutation is the information that Taproot – the upgrade that makes CTV imaginable – conscionable activated past November, and the ecosystem is inactive adopting it.

When a caller diagnostic similar Segwit oregon Taproot is soft forked into Bitcoin, it’s up to manufacture stakeholders, similar wallet providers and exchanges, to follow the code; going further, the services that caller upgrades alteration bash not physique themselves, and it takes clip for developers, entrepreneurs and companies to plan products that trust connected functionality that has ne'er been utilized before.

“Generally, I bash not deliberation Bitcoin is acceptable for immoderate caller soft-forked features astatine each successful the abbreviated term. Taproot conscionable arrived and determination is already truthful overmuch enactment to beryllium done to follow and utilize it,” Synonym CEO John Carvalho wrote successful the Bitcoin Developer mailing database arsenic a effect to 1 of Rubin’s posts.

Others consciousness arsenic if prioritizing CTV makes consciousness close now. For the much cynical, Big Brother is keeping a person oculus connected Bitcoin and its users than ever, and they interest clip is moving retired to instrumentality upgrades which springiness users greater power implicit their coins (and greater privacy).

For Rubin, it’s a substance of giving radical improved tools, peculiarly privateness tools, particularly those who unrecorded nether stringent fiscal surveillance and control.

“Imagine a aboriginal wherever radical are targeted for having bitcoin due to the fact that we did not person capable privacy,” Rubin said. “That worries maine a lot. A batch of the payment of outgo pools is not conscionable successful scalability, but successful privateness too, due to the fact that they support information off-chain.”

For CTV proponents, the codification is much oregon little vetted (there’s been a 5.5 BTC bounty connected CTV for astir six months) and the arguments against it look to beryllium “we request much clip to measure alternatives.”

As for alternatives, immoderate constituent to AnyPrevOutput (APO oregon BIP 118), different brushed fork designed by Blockstream Core Lightning developer Christian Decker. Others, including Rubin and Decker, spot each other’s BIPs arsenic complementary.

“That’s ever been my presumption – they are precise overmuch complementary. They person immoderate overlap, but they are not nonstop ways to execute the aforesaid end, and they were projected successful antithetic contexts. I ne'er had the content that they were competitors,” said Decker.

All of this, of course, assumes the wider Bitcoin assemblage wants these features.

But what is “Bitcoin’s wider community,” anyway? That’s portion of the occupation with these debates.

Bitcoin’s idiosyncratic basal spans each continent but Antarctica, and the forum for statement includes societal media, email lists and messaging groups. As bitcoin’s terms has grown implicit the years, and the numbers of its progressive assemblage swells, statement has go progressively unwieldy – particularly considering your mean person’s capableness to afloat grasp the minutiae of these changes.

It’s a batch easier to drum up enactment for an upgrade if you run and educate, truthful Rubin has been connected societal media attempting to rally enactment for CTV (his Twitter sanction astatine 1 point work “BIP 119 selling department”).

Rubin’s Twitter sanction alteration was done precise overmuch lingua successful feature due to the fact that galore progressive bitcoiners were enactment disconnected by his advocacy. For sure, statement astir the BIP 119 has go acidic. Its decorator doesn’t caput radical scrutinizing his work. What helium doesn’t want, though, is undue interest from those who deficiency the literacy to recognize CTV connected a micro level.

“It’s fantastic that determination are truthful galore radical who attraction truthful profoundly astir Bitcoin and volition spell to the mat to support it,” Rubin said. That is precise good. In this case, a batch of that interest is misplaced, though I recognize wherever a batch of it comes from.”

Avid bitcoiners tin beryllium ornery, highly skeptical, and dogged successful their defence of orange coin. Some of BIP 119’s opponents don’t similar the information that Rubin is advocating for an upgrade helium designed (for his part, Rubin has tweeted to the effect that helium doesn’t attraction what gets activated, but thing needs to hap if privateness and custody solutions are to improve).

While the kernel of the statement whitethorn beryllium popping with treatment astir BIP 119, the information that CTV’s critics are peculiarly worked up implicit Rubin’s advocacy of BIP 119 puts a larger statement into absorption astir Bitcoin’s unsmooth consensus. Who decides upgrades? When is codification “ready” to ship? And what’s the champion mode to activate a brushed fork to marque definite thing funky happens?

With CTV and different promising brushed forks similar APO waiting successful the dugout for their crook (if ever) astatine bat, a caller ballgame for Bitcoin’s unsmooth statement connected protocol improvement is successful the opening inning.

And adjacent though it looks similar those who disagree are connected other teams, yet everyone is moving toward the aforesaid goal. They are conscionable puzzling retired which rules they privation to play by, and that’s OK due to the fact that “this is the work,” Rubin said, that’s required to scope a unsmooth consensus.

“The developers who disagree connected this, we’re each friends. … Bitcoin is simply a family, a large dysfunctional family. Ultimately we truly are trying to execute the aforesaid thing, we conscionable don't hold connected the mode to get there. If 1 of these ways demonstrated that it was the champion mode to get there, past determination would beryllium much cohesion.”

View source