From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 06 Mar 2025 09:37:11 -0800 Received: from mail-yw1-f188.google.com ([209.85.128.188]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tqF9h-0004xT-BQ for bitcoindev@gnusha.org; Thu, 06 Mar 2025 09:37:11 -0800 Received: by mail-yw1-f188.google.com with SMTP id 00721157ae682-6feb1097d64sf13430387b3.2 for ; Thu, 06 Mar 2025 09:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1741282623; x=1741887423; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:references:in-reply-to:message-id:to:from:date:sender:from :to:cc:subject:date:message-id:reply-to; bh=8+Gll0ED+LNY1L0uSucktPCRSzo+dnbdvmlAjyr9SHs=; b=mV2zLgQhSbkTHnF45KmMPq6y+xM5dzIWAnJ1Rg/V4QfnGORDOm3KCr6VikQ07GShWH Gh2+IFYTHmvwdGtXjUSF/bM0iXjPYbfZEw2JtENHu0RV51yYJinGAGWvio3twalBVCPs QsmBbUxP4bRJ0apRpCWniKk5Vk9JdjuQD6nfgK7FfD71rSBI+1+oJEDa6Zw1WWT8BrTo jJDa84nLulnd2KSiPZA36RfWZJYLxdG2highIASB8Lhx9ue0d0l/MdMU+tV3oA34a2nq w+YJJ6/4bAnCUQtD3rFwV+AEw1t8e0jiJLHr5Pu7Uns6ayiPWYZgH+f3z8UscM/4KtK1 B86w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741282623; x=1741887423; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:references:in-reply-to:message-id:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=8+Gll0ED+LNY1L0uSucktPCRSzo+dnbdvmlAjyr9SHs=; b=VFYHPUeybtUHvoQcMRcuuwVXlFe/PeegzirTQkOiyfiuHeaa2X4kCROR0MCTWmaa84 qdYSkyaUdYAXm18I7N0XPnxs3w2Tm6xX5MKg6cIvNcUEBi3skC8iIRbX5JNRk93PXw44 4dpBcdEYx5c0BexeHo6KkY6dIOPd/m93Oo1M+ecRBdwrNSTBQzN1vXFENNkq56HD1zuJ WCV8rqOFJ23yBjppwqGh3StXc0Py42y/yP12+mSk9q4OECLJ3RN0zCscXaDtaQPGbZXi Wysv8sU4xU97KWkQw+d5fyxd/Xwogqw3pTm4/Ols0Khvr9aB4lmWYBLVgYSYuvSua9hL zNEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741282623; x=1741887423; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:references:in-reply-to:message-id:to:from:date:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=8+Gll0ED+LNY1L0uSucktPCRSzo+dnbdvmlAjyr9SHs=; b=ha60pc/F7ss+hSnwFbz6E2fUiwTWT2W1vD7OiPQsK5q7su5TDUWYQuKSdog41GSyPi 4zWdv64vsYNy8d5Im5AP0SYtU3D7o2FHqSKjoa64iZz5eri5mdFvRsemIxdBSdw3ROnj bffXryP3svm6k1wLmelFr9C8lC4gHFWq4/mQY8wsL3zhyLw8zKTScsq7+hkW8gbJaIqE iGrb8PPNVILQNNRgf5dKl/9y+c4PKvRObIn7iJGDbQ+rijv6NYB+3ixZJnsO12NMCZN3 likPyw8fFfwhN12HEyRHRxAJ0E551Fjs5etzlpI2h5R1r5ALatuQ641eMcZ1Wy3Z2y6t VtAg== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=1; AJvYcCXp2fr++6cI2m/j9OKURMPqXfnqLvxR/h4z07lcA7o1UI1toTw1szWC1g1JuVoCkL8Gt1UnXyQXVm8S@gnusha.org X-Gm-Message-State: AOJu0Yy8vY81g3VhiF921l+aMsJq/Px8jwu+qe6WwQTsL11ksy+Tjpgv eF+yl27pMiTHuNQ1CHpSnOoXP37jSHGU0y39AiBwaNFIJxPmVQr1 X-Google-Smtp-Source: AGHT+IFotB7D6ByX4uD2vTaaEjTOwMfF+N5d2niQ7u7n/ci4Zj3PzhhquPrJvmP0l1gwV8Y2LJZHDg== X-Received: by 2002:a05:6902:2e05:b0:e5e:1389:cb2f with SMTP id 3f1490d57ef6-e635c1f26b0mr238227276.45.1741282623330; Thu, 06 Mar 2025 09:37:03 -0800 (PST) X-BeenThere: bitcoindev@googlegroups.com; h=Adn5yVHT/zvfv8YXNwiFNuUfErKUiCxIxPgSgzazPDnteQqR+w== Received: by 2002:a25:5882:0:b0:e60:873d:ae8f with SMTP id 3f1490d57ef6-e63489dcd4dls1193402276.2.-pod-prod-09-us; Thu, 06 Mar 2025 09:36:59 -0800 (PST) X-Received: by 2002:a05:690c:6f12:b0:6f9:b189:3ccb with SMTP id 00721157ae682-6febf2dff27mr3772697b3.17.1741282619616; Thu, 06 Mar 2025 09:36:59 -0800 (PST) Received: by 2002:a05:690c:3388:b0:6ef:590d:3213 with SMTP id 00721157ae682-6fda287d365ms7b3; Thu, 6 Mar 2025 09:17:43 -0800 (PST) X-Received: by 2002:a05:690c:6101:b0:6fb:9495:1650 with SMTP id 00721157ae682-6febf2c3b41mr2884117b3.11.1741281461984; Thu, 06 Mar 2025 09:17:41 -0800 (PST) Date: Thu, 6 Mar 2025 09:17:41 -0800 (PST) From: Greg Sanders To: Bitcoin Development Mailing List Message-Id: <17e7eb49-77b7-4f2f-be40-a6649e610ce5n@googlegroups.com> In-Reply-To: <1JkExwyWEPJ9wACzdWqiu5cQ5WVj33ex2XHa1J9Uyew-YF6CLppDrcu3Vogl54JUi1OBExtDnLoQhC6TYDH_73wmoxi1w2CwPoiNn2AcGeo=@protonmail.com> References: <1JkExwyWEPJ9wACzdWqiu5cQ5WVj33ex2XHa1J9Uyew-YF6CLppDrcu3Vogl54JUi1OBExtDnLoQhC6TYDH_73wmoxi1w2CwPoiNn2AcGeo=@protonmail.com> Subject: Re: [bitcoindev] "Recursive covenant" with CTV and CSFS MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1082_1986608000.1741281461451" X-Original-Sender: gsanders87@gmail.com Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.5 (/) ------=_Part_1082_1986608000.1741281461451 Content-Type: multipart/alternative; boundary="----=_Part_1083_651608687.1741281461451" ------=_Part_1083_651608687.1741281461451 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > Of course it depends on the specifics, but rewriting a clean interpreter= =20 that we can actually reason about does not strike me as a necessarily=20 riskier approach than "just changing a few lines of code" in an interpreter= =20 that hardly anyone knows how it really behaves in all cases. It's certainly something to consider when weighing further off Bitcoin=20 Script updates: From here is something like "Great Script Restoration" ever= =20 the right choice vs a from scratch overhaul? I am less persuaded that=20 consensus risk is particularly high for very narrowly scoped changes,=20 ignoring the "fixed" costs of changing consensus, maintenance burden, MEVil= =20 risks, etc. The risk-reward ratio may be suboptimal of course. Greg On Wednesday, March 5, 2025 at 11:39:27=E2=80=AFAM UTC-5 Antoine Poinsot wr= ote: > Hi, > > Just picking on one thing Laolu said: > > The current Overton Window appears to be focused on a small (LoC wise)=20 > package to enable a greater degree of permissionless innovation on Bitcoi= n > > > For what it's worth i'm not sure this is the correct focus. Bitcoin Scrip= t=20 > is so notoriously unpredictable and hard to reason about that most of wha= t=20 > matters is outside of the lines of code changed. Of course it depends on= =20 > the specifics, but rewriting a clean interpreter that we can actually=20 > reason about does not strike me as a necessarily riskier approach than=20 > "just changing a few lines of code" in an interpreter that hardly anyone= =20 > knows how it really behaves in all cases. > > Antoine > On Wednesday, March 5th, 2025 at 1:14 AM, Olaoluwa Osuntokun < > lao...@gmail.com> wrote: > > Hi AJ, > > First a standard disclaimer: the contents of this email shouldn't be > interpreted as an endorsement of one covenants proposal over another. > > > Since BIP 119's motivation is entirely concerned with its concept of > > covenants and avoiding what it calls recursive covenants > > If we look at the motivation section of BIP 119, we find this sentence:= =20 > > > This BIP introduces a simple covenant called a *template* which enables= a > > limited set of highly valuable use cases without significant risk.=20 > BIP-119 > > templates allow for non-recursive fully-enumerated covenants with no > > dynamic state.=20 > > You appear to have latched onto the "non-recursive" aspect, ignoring the > subsequent qualifiers of "fully-enumerated" and "with no dynamic state". > > The example that you've come up with to "directly undermine" the claimed > motivations of BIP 119 is still fully enumerated (the sole state is=20 > declared > up front), and doesn't contain dynamic state (I can't spend the contract = on > chain and do something like swap in another hash H, or signature S). > > > I found it pretty inconvenient, which I don't think is a good indicatio= n > > of ecosystem readiness wrt deployment. (For me, the two components that > > are annoying is doing complicated taproot script path spends, and > > calculating CTV hashes) > > What language/libraries did you use to produce the spend? In my own > development tooling of choice, producing complicated taproot script path > spends is pretty straight forward, so perhaps the inconvenience you ran= =20 > into > says more about your dev tooling than the ecosystem readiness. > > It's also worth pointing out that your example relies on private key > deletion, which if deemed acceptable, can be used to emulate CTV as is=20 > today > (though you can't create a self-referential loop that way afaict). > > > For me, the bllsh/simplicity approach makes more sense as a design > > approach for the long term > > Simplicity certainly has some brilliant devs working on it, but after all > these years it still seems to be struggling to exit research mode with so= me > "killer apps" on Liquid. > > bllsh on the other hand is a very new (and cool!) project that has no > development uptake beyond its creator. Given its nascent state, it seems > rather premature to promote it as a long term solution. > > Both of them are effectively a complete rewrite of Script, so compared to > some of the existing covenant proposals on the table (many of which have = a > small core code footprint in the interpreter), they represent a radically > expanded scope (ecosystem changes, wallets, consensus code) and therefore > additional risks. The current Overton Window appears to be focused on a > small (LoC wise) package to enable a greater degree of permissionless > innovation on Bitcoin, while leaving the research landscape open for more > dramatic overhauls (bllsh/Simplicity) in the future. > > -- Laolu > > > On Tue, Mar 4, 2025 at 5:06=E2=80=AFPM Anthony Towns wrote: > >> Hello world, >> >> Some people on twitter are apparently proposing the near-term activation= =20 >> of >> CTV and CSFS (BIP 119 and BIP 348 respectively), eg: >> >> https://x.com/JeremyRubin/status/1895676912401252588 >> https://x.com/lopp/status/1895837290209161358 >> https://x.com/stevenroose3/status/1895881757288996914 >> https://x.com/reardencode/status/1871343039123452340 >> https://x.com/sethforprivacy/status/1895814836535378055 >> >> Since BIP 119's motivation is entirely concerned with its concept of >> covenants and avoiding what it calls recursive covenants, I think it >> is interesting to note that the combination of CSFS and CTV trivially >> enables the construction of a "recursive covenant" as BIP 119 uses those >> terms. One approach is as follows: >> >> * Make a throwaway BIP340 private key X with 32-bit public key P. >> * Calculate the tapscript "OP_OVER

OP_CSFS OP_VERIFY OP_CTV", and >> its corresponding scriptPubKey K when combined with P as the internal=20 >> public >> key. >> * Calculate the CTV hash corresponding to a payment of some specific=20 >> value V >> to K; call this hash H >> * Calculate the BIP 340 signature for message H with private key X, call= =20 >> it S. >> * Discard the private key X >> * Funds sent to K can only be spent by the witness data " " that= =20 >> forwards >> an amount V straight back to K. >> >> Here's a demonstration on mutinynet: >> >> >> https://mutinynet.com/address/tb1p0p5027shf4gm79c4qx8pmafcsg2lf5jd33tznm= yjejrmqqx525gsk5nr58 >> >> I'd encourage people to try implementing that themselves with their >> preferred tooling; personally, I found it pretty inconvenient, which I >> don't think is a good indication of ecosystem readiness wrt deployment. >> (For me, the two components that are annoying is doing complicated >> taproot script path spends, and calculating CTV hashes) >> >> I don't believe the existence of a construction like this poses any >> problems in practice, however if there is going to be a push to activate >> BIP 119 in parallel with features that directly undermine its claimed >> motivation, then it would presumably be sensible to at least update >> the BIP text to describe a motivation that would actually be achieved by >> deployment. >> >> Personally, I think BIP 119's motivation remains very misguided: >> >> - the things it describes are, in general, not "covenants" [0] >> - the thing it avoids is not "recursion" but unbounded recursion >> - avoiding unbounded recursion is not very interesting when arbitrarily >> large recursion is still possible [1] >> - despite claiming that "covenants have historically been widely >> considering to be unfit for Bitcoin", no evidence for this claim has >> been able to be provided [2,3] >> - the opposition to unbounded recursion seems to me to either mostly >> or entirely be misplaced fear of things that are already possible in >> bitcoin and easily avoided by people who want to avoid it, eg [4] >> >> so, at least personally, I think almost any update to BIP 119's motivati= on >> section would be an improvement... >> >> [0] https://gnusha.org/pi/bitcoindev/20220719044...@erisian.com.au/=20 >> >> [1] https://gnusha.org/pi/bitcoindev/87k0dwr...@rustcorp.com.au/=20 >> >> [2]=20 >> https://gnusha.org/pi/bitcoindev/0100017ee6472e02-037d355d-4c16...@email= .amazonses.com/=20 >> >> [3] https://x.com/Ethan_Heilman/status/1194624166093369345 >> [4] https://gnusha.org/pi/bitcoindev/2022021715...@erisian.com.au/=20 >> >> >> Beyond being a toy example of a conflict with BIP 119's motivation >> section, I think the above script could be useful in the context of the >> "blind-merged-mining" component of spacechains [5]. For example, if >> the commitment was to two outputs, one the recursive step and the other >> being a 0sat ephemeral anchor, then the spend of the ephemeral anchor >> would allow for both providing fees conveniently and for encoding the >> spacechain block's commitment; competing spacechain miners would then >> just be rbf'ing that spend with the parent spacechain update remaining >> unchanged. The "nLockTime" and "sequences_hash" commitment in CTV would >> need to be used to ensure the "one spacechain update per bitcoin block" >> rule. (I believe mutinynet doesn't support ephemeral anchors however, so >> I don't think there's anywhere this can be tested) >> >> [5]=20 >> https://gist.github.com/RubenSomsen/5e4be6d18e5fa526b17d8b34906b16a5#fil= e-bmm-svg >> >> (For a spacechain, miners would want to be confident that the private ke= y >> has been discarded. This confidence could be enhanced by creating X as a >> musig2 key by a federation, in which case provided any of the private ke= ys >> used in generating X were correctly discarded, then everything is fine, >> but that's still a trust assumption. Simple introspection opcodes would >> work far better for this use case, both removing the trust assumption >> and reducing the onchain data required) >> >> If you're providing CTV and CSFS anyway, I don't see why you wouldn't >> provide the same or similar functionality via a SIGHASH flag so that you >> can avoid specifying the hash directly when you're signing it anyway, >> giving an ANYPREVOUT/NOINPUT-like feature directly. >> >> (Likewise, I don't see why you'd want to activate CAT on mainnet without >> also at least re-enabling SUBSTR, and potentially also the redundant >> LEFT and RIGHT operations) >> >> For comparison, bllsh [6,7] takes the approach of providing >> "bip340_verify" (directly equivalent to CSFS), "ecdsa_verify" (same but >> for ECDSA rather than schnorr), "bip342_txmsg" and "tx" opcodes. A CTV >> equivalent would then either involve simplying writing: >> >> (=3D (bip342_txmsg 3) 0x.....) >> >> meaining "calculate the message hash of the current tx for SIGHASH_SINGL= E, >> then evaluate whether the result is exactly equal to this constant" >> providing one of the standard sighashes worked for your use case, or >> replacing the bip342_txmsg opcode with a custom calculation of the tx >> hash, along the lines of the example reimplementation of bip342_txmsg >> for SIGHASH_ALL [8] in the probably more likely case that it didn't. If >> someone wants to write up the BIP 119 hashing formula in bllsh, I'd >> be happy to include that as an example; I think it should be a pretty >> straightforward conversion from the test-tx example. >> >> If bllsh were live today (eg on either signet or mainnet), and it were >> desired to softfork in a more optimised implementation of either CTV or >> ANYPREVOUT to replace people coding their own implementation in bllsh >> directly, both would simply involve replacing calls to "bip342_txmsg" >> with calls to a new hash calculation opcode. For CTV behaviour, usage >> would look like "(=3D (bipXXX_txmsg) 0x...)" as above; for APO behaviour= , >> usage would look like "(bip340_verify KEY (bipXXX_txmsg) SIG)". That >> is, the underlying "I want to hash a message in such-and-such a way" >> looks the same, and how it's used is the wallet author's decision, >> not a matter of how the consensus code is written. >> >> I believe simplicity/simfony can be thought of in much the same way; >> with "jet::bip_0340_verify" taking a tx hash for SIGHASH-like behaviour >> [9], or "jet::eq_256" comparing a tx hash and a constant for CTV-like >> behaviour [10]. >> >> [6] https://github.com/ajtowns/bllsh/ >> [7] https://delvingbitcoin.org/t/debuggable-lisp-scripts/1224 >> [8] https://github.com/ajtowns/bllsh/blob/master/examples/test-tx >> [9]=20 >> https://github.com/BlockstreamResearch/simfony/blob/master/examples/p2pk= .simf >> [10]=20 >> https://github.com/BlockstreamResearch/simfony/blob/master/examples/ctv.= simf >> >> For me, the bllsh/simplicity approach makes more sense as a design >> approach for the long term, and the ongoing lack of examples of killer >> apps demonstrating big wins from limited slices of new functionality >> leaves me completely unexcited about rushing something in the short term= . >> Having a flood of use cases that don't work out when looked into isn't >> a good replacement for a single compelling use case that does. >> >> Cheers, >> aj >> >> --=20 >> You received this message because you are subscribed to the Google Group= s=20 >> "Bitcoin Development Mailing List" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n=20 >> email to bitcoindev+...@googlegroups.com. >> To view this discussion visit=20 >> https://groups.google.com/d/msgid/bitcoindev/Z8eUQCfCWjdivIzn%40erisian.= com.au >> . >> > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "Bitcoin Development Mailing List" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to bitcoindev+...@googlegroups.com. > > To view this discussion visit=20 > https://groups.google.com/d/msgid/bitcoindev/CAO3Pvs-1H2s5Dso0z5CjKcHcPvQ= jG6PMMXvgkzLwXgCHWxNV_Q%40mail.gmail.com > . > > > --=20 You received this message because you are subscribed to the Google Groups "= Bitcoin Development Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitcoindev+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/= 17e7eb49-77b7-4f2f-be40-a6649e610ce5n%40googlegroups.com. ------=_Part_1083_651608687.1741281461451 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

>=C2=A0Of course it depends on the specifics, but rewriting a clean inter= preter that we can actually reason about does not=C2=A0strike me as a necessarily riskier app= roach than "just changing a few lines of code" in an interpreter that hardl= y anyone knows how it really behaves in all cases.

It's certainly something to c= onsider when weighing further off Bitcoin Script updates: From here is some= thing like "Great Script Restoration" ever the right choice vs a from scrat= ch overhaul? I am less persuaded that consensus risk is particularly high f= or very narrowly scoped changes, ignoring the "fixed" costs of changing con= sensus, maintenance burden, MEVil risks, etc. The risk-reward ratio may be = suboptimal of course.

Greg
On Wednesday, March 5, 2025 at= 11:39:27=E2=80=AFAM UTC-5 Antoine Poinsot wrote:
Hi,

Ju= st picking on one thing Laolu said:
The current Overton Window appears to be focused = on a small (LoC wise) package to enable a greater degree of permissionless = innovation on Bitcoin

For what it's worth i'm not sure this is= the correct focus. Bitcoin Script is so notoriously unpredictable and hard= to reason about that most of what matters is outside of the lines of code = changed. Of course it depends on the specifics, but rewriting a clean inter= preter that we can actually reason about does not strike me as a nec= essarily riskier approach than "just changing a few lines of code"= ; in an interpreter that hardly anyone knows how it really behaves in all c= ases.

Antoine
=20
=20
=20
On Wednesday, March 5th, 2025 at 1:14 AM, Olaoluwa Osuntokun <lao...@gmail.com> wrote:
Hi AJ,

First a standard disclaimer= : the contents of this email shouldn't be
interpreted as an endorsem= ent of one covenants proposal over another.

> Since BIP 119's= motivation is entirely concerned with its concept of
> covenants and= avoiding what it calls recursive covenants

If we look at the motiva= tion section of BIP 119, we find this sentence:

> This BIP intro= duces 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
&g= t; dynamic state.

You appear to have latched onto the "non-rec= ursive" aspect, ignoring the
subsequent qualifiers of "fully-e= numerated" and "with no dynamic state".

The example t= hat you've come up with to "directly undermine" the claimedmotivations of BIP 119 is still fully enumerated (the sole state is decla= red
up front), and doesn't contain dynamic state (I can't spend = the contract on
chain and do something like swap in another hash H, or s= ignature S).

> I found it pretty inconvenient, which I don't = think is a good indication
> of ecosystem readiness wrt deployment. (= For me, the two components that
> are annoying is doing complicated t= aproot script path spends, and
> calculating CTV hashes)

What = language/libraries did you use to produce the spend? In my own
developme= nt tooling of choice, producing complicated taproot script path
spends i= s pretty straight forward, so perhaps the inconvenience you ran into
say= s more about your dev tooling than the ecosystem readiness.

It's= also worth pointing out that your example relies on private key
deletio= n, which if deemed acceptable, can be used to emulate CTV as is today
(t= hough you can't create a self-referential loop that way afaict).
> For me, the bllsh/simplicity approach makes more sense as a design> approach for the long term

Simplicity certainly has some brill= iant devs working on it, but after all
these years it still seems to be = struggling to exit research mode with some
"killer apps" on Li= quid.

bllsh on the other hand is a very new (and cool!) project that= has no
development uptake beyond its creator. Given its nascent state, = it seems
rather premature to promote it as a long term solution.

= Both of them are effectively a complete rewrite of Script, so compared tosome of the existing covenant proposals on the table (many of which have = a
small core code footprint in the interpreter), they represent a radica= lly
expanded scope (ecosystem changes, wallets, consensus code) and ther= efore
additional risks. The current Overton Window appears to be focused= on a
small (LoC wise) package to enable a greater degree of permissionl= ess
innovation on Bitcoin, while leaving the research landscape open for= more
dramatic overhauls (bllsh/Simplicity) in the future.

-- Lao= lu


On Tue, Mar 4, 2= 025 at 5:06=E2=80=AFPM Anthony Towns <a...@erisian.com.au> wrote:
Hello world,

Some people on twitter are apparently proposing the near-term activation of=
CTV and CSFS (BIP 119 and BIP 348 respectively), eg:

https://x.com/JeremyRubin/status/189567691240125= 2588
https://x.com/lopp/status/1895837290209161358
https://x.com/stevenroose3/status/189588175728= 8996914
https://x.com/reardencode/status/187134303912345= 2340
https://x.com/sethforprivacy/status/189581= 4836535378055

Since BIP 119's motivation is entirely concerned with its concept of covenants and avoiding what it calls recursive covenants, I think it
is interesting to note that the combination of CSFS and CTV trivially
enables the construction of a "recursive covenant" as BIP 119 use= s those
terms. One approach is as follows:

* Make a throwaway BIP340 private key X with 32-bit public key P.
* Calculate the tapscript "OP_OVER <P> OP_CSFS OP_VERIFY OP_CTV= ", and
its corresponding scriptPubKey K when combined with P as the internal pu= blic
key.
* Calculate the CTV hash corresponding to a payment of some specific value= V
to K; call this hash H
* Calculate the BIP 340 signature for message H with private key X, call i= t S.
* Discard the private key X
* Funds sent to K can only be spent by the witness data "<H> &l= t;S>" that forwards
an amount V straight back to K.

Here's a demonstration on mutinynet:

https://mutinynet.com/address/tb1p0p5027sh= f4gm79c4qx8pmafcsg2lf5jd33tznmyjejrmqqx525gsk5nr58

I'd encourage people to try implementing that themselves with their
preferred tooling; personally, I found it pretty inconvenient, which I
don't think is a good indication of ecosystem readiness wrt deployment.=
(For me, the two components that are annoying is doing complicated
taproot script path spends, and calculating CTV hashes)

I don't believe the existence of a construction like this poses any
problems in practice, however if there is going to be a push to activate BIP 119 in parallel with features that directly undermine its claimed
motivation, then it would presumably be sensible to at least update
the BIP text to describe a motivation that would actually be achieved by deployment.

Personally, I think BIP 119's motivation remains very misguided:

- the things it describes are, in general, not "covenants" [0] - the thing it avoids is not "recursion" but unbounded recursion=
- avoiding unbounded recursion is not very interesting when arbitrarily large recursion is still possible [1]
- despite claiming that "covenants have historically been widely
considering to be unfit for Bitcoin", no evidence for this claim ha= s
been able to be provided [2,3]
- the opposition to unbounded recursion seems to me to either mostly
or entirely be misplaced fear of things that are already possible in
bitcoin and easily avoided by people who want to avoid it, eg [4]

so, at least personally, I think almost any update to BIP 119's motivat= ion
section would be an improvement...

[0] https:/= /gnusha.org/pi/bitcoindev/20220719044...@erisian.com.au/
[1] https://gnusha.org/pi= /bitcoindev/87k0dwr...@rustcorp.com.au/
[2] https://gnusha.org/pi/bitcoindev/0100017ee6472e02-037d355d-4c16...@emai= l.amazonses.com/
[3] https://x.com/Ethan_Heilman/status/119462= 4166093369345
[4] https://g= nusha.org/pi/bitcoindev/2022021715...@erisian.com.au/

Beyond being a toy example of a conflict with BIP 119's motivation
section, I think the above script could be useful in the context of the
"blind-merged-mining" component of spacechains [5]. For example, = if
the commitment was to two outputs, one the recursive step and the other
being a 0sat ephemeral anchor, then the spend of the ephemeral anchor
would allow for both providing fees conveniently and for encoding the
spacechain block's commitment; competing spacechain miners would then just be rbf'ing that spend with the parent spacechain update remaining<= br> unchanged. The "nLockTime" and "sequences_hash" commitm= ent in CTV would
need to be used to ensure the "one spacechain update per bitcoin block= "
rule. (I believe mutinynet doesn't support ephemeral anchors however, s= o
I don't think there's anywhere this can be tested)

[5] https://gist.github.com/RubenSomsen/5e4be6d18e5fa526b17d8b34= 906b16a5#file-bmm-svg

(For a spacechain, miners would want to be confident that the private key has been discarded. This confidence could be enhanced by creating X as a musig2 key by a federation, in which case provided any of the private keys<= br> used in generating X were correctly discarded, then everything is fine,
but that's still a trust assumption. Simple introspection opcodes would=
work far better for this use case, both removing the trust assumption
and reducing the onchain data required)

If you're providing CTV and CSFS anyway, I don't see why you wouldn= 't
provide the same or similar functionality via a SIGHASH flag so that you can avoid specifying the hash directly when you're signing it anyway, giving an ANYPREVOUT/NOINPUT-like feature directly.

(Likewise, I don't see why you'd want to activate CAT on mainnet wi= thout
also at least re-enabling SUBSTR, and potentially also the redundant
LEFT and RIGHT operations)

For comparison, bllsh [6,7] takes the approach of providing
"bip340_verify" (directly equivalent to CSFS), "ecdsa_verify= " (same but
for ECDSA rather than schnorr), "bip342_txmsg" and "tx"= opcodes. A CTV
equivalent would then either involve simplying writing:

(=3D (bip342_txmsg 3) 0x.....)

meaining "calculate the message hash of the current tx for SIGHASH_SIN= GLE,
then evaluate whether the result is exactly equal to this constant" providing one of the standard sighashes worked for your use case, or
replacing the bip342_txmsg opcode with a custom calculation of the tx
hash, along the lines of the example reimplementation of bip342_txmsg
for SIGHASH_ALL [8] in the probably more likely case that it didn't. If=
someone wants to write up the BIP 119 hashing formula in bllsh, I'd
be happy to include that as an example; I think it should be a pretty
straightforward conversion from the test-tx example.

If bllsh were live today (eg on either signet or mainnet), and it were
desired to softfork in a more optimised implementation of either CTV or
ANYPREVOUT to replace people coding their own implementation in bllsh
directly, both would simply involve replacing calls to "bip342_txmsg&q= uot;
with calls to a new hash calculation opcode. For CTV behaviour, usage
would look like "(=3D (bipXXX_txmsg) 0x...)" as above; for APO be= haviour,
usage would look like "(bip340_verify KEY (bipXXX_txmsg) SIG)". T= hat
is, the underlying "I want to hash a message in such-and-such a way&qu= ot;
looks the same, and how it's used is the wallet author's decision,<= br> not a matter of how the consensus code is written.

I believe simplicity/simfony can be thought of in much the same way;
with "jet::bip_0340_verify" taking a tx hash for SIGHASH-like beh= aviour
[9], or "jet::eq_256" comparing a tx hash and a constant for CTV-= like
behaviour [10].

[6] https://= github.com/ajtowns/bllsh/
[7] https://delvingbitcoin.org/t/debug= gable-lisp-scripts/1224
[8] https://github.com/ajtowns/= bllsh/blob/master/examples/test-tx
[9] https://github.com/BlockstreamResearch/simfony/blob/master/examples/p2= pk.simf
[10] https://github.com/BlockstreamResearch/simfony/blob/master/examples/ctv= .simf

For me, the bllsh/simplicity approach makes more sense as a design
approach for the long term, and the ongoing lack of examples of killer
apps demonstrating big wins from limited slices of new functionality
leaves me completely unexcited about rushing something in the short term. Having a flood of use cases that don't work out when looked into isn= 9;t
a good replacement for a single compelling use case that does.

Cheers,
aj

--
You received this message because you are subscribed to the Google Groups &= quot;Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitc= oindev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitco= indev/Z8eUQCfCWjdivIzn%40erisian.com.au.

--
You received this message because you are subscribed to the Google Groups &= quot;Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitc= oindev+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitcoind= ev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoind= ev/17e7eb49-77b7-4f2f-be40-a6649e610ce5n%40googlegroups.com.
------=_Part_1083_651608687.1741281461451-- ------=_Part_1082_1986608000.1741281461451--