Return-Path: Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 70A09C002D for ; Fri, 29 Apr 2022 11:40:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 587E541CAF for ; Fri, 29 Apr 2022 11:40:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: 0.278 X-Spam-Level: X-Spam-Status: No, score=0.278 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HTML_MESSAGE=0.001, PDS_OTHER_BAD_TLD=1.975, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=no autolearn_force=no Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=neutral reason="invalid (public key: not available)" header.d=shesek.info Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iT6k8-KGw_HL for ; Fri, 29 Apr 2022 11:40:18 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by smtp4.osuosl.org (Postfix) with ESMTPS id C7F2141C27 for ; Fri, 29 Apr 2022 11:40:17 +0000 (UTC) Received: by mail-io1-xd2d.google.com with SMTP id m6so5266543iob.4 for ; Fri, 29 Apr 2022 04:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shesek.info; s=shesek; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q2T8UY1SnyuLLTTOPxLAxM6JX8pkQfvT6DZxGJdIeuM=; b=pDb1RkydKilphTZGgyQytqymSHZ8Lf0yJ0vRzBOVw0jAOXtLBlZ+boGM2qkuMKvirI r0wbvI0YspnGs9Vqgihe0VWaBWWekBQX52ghXO8Yws6C336r8oW56OBsfHGngET9FbKY uHW3HfQFS4Ii2rrNla9PRQX9cLFxQS+k5k6nc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q2T8UY1SnyuLLTTOPxLAxM6JX8pkQfvT6DZxGJdIeuM=; b=s8g7dEdr48ZblQ/pWyzjft+e+PBHbLIq0vceRTUC4fge+vTHAw7PuklOWDdObOtVgg nOLM+JNdxWBzs2YPcWtzxW5ER3YMTo0C+SITWX5Ag7iIEyG2bNxKXVXLOdrCvvpBrwCM IYyf2+GqrimQFD00rtkC4nAqI7P1WrKmuwOYe3gB0+ioFVOBlxavwOBsz25gAfbFVUPG 6j/OzjpMOttA0agoJsLQlRA6q7PBpBBQtuO6DqxNyK2eXfMp+70oC0uM6XfgM7eV8C/v frJBvHMroeCm/0p1TcCZS3Z9IxzXuA4eZgPFswnhztBT2B+pOrM+hi0XjpkIpDEWAlWK Fp0g== X-Gm-Message-State: AOAM531OJUlXsrfPwJrL+Rvk0i1g3MI+v0YQTpc80iZSopy2U6vm7c/q gm51geSycwCX2AC2JtKJQGCz6EL4Dby18KPKLWLZpw== X-Google-Smtp-Source: ABdhPJyTtMYF5VIXkhDKk9ZLryQVknn9z/V6dlmlI8wtA7DUJjdOqm8pOUu+QeU0rTUqlPg6Od/86tDIrxk6bRuKNhQ= X-Received: by 2002:a05:6602:2a42:b0:652:8e2d:e4b7 with SMTP id k2-20020a0566022a4200b006528e2de4b7mr15134859iov.142.1651232416594; Fri, 29 Apr 2022 04:40:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nadav Ivgi Date: Fri, 29 Apr 2022 14:40:05 +0300 Message-ID: To: darosior Content-Type: multipart/alternative; boundary="000000000000a211fd05ddc98133" X-Mailman-Approved-At: Fri, 29 Apr 2022 11:52:41 +0000 Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] ANYPREVOUT in place of CTV X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2022 11:40:20 -0000 --000000000000a211fd05ddc98133 Content-Type: text/plain; charset="UTF-8" Correction: thinking about this some more, you can't actually expect to have a stable txid if you allow additional inputs at all... So yes, amending BIP 118 to commit to sha_sequences (which indirectly also commits to the number of inputs) as proposed in the OP should be sufficient to get stable txids for single-input transactions. (I initially thought that APO has to cover some additional tx parts for this, but it seems that it's really just the scriptSig which is guarrnated to be empty if you have a single input that is known to be the taproot APO spend.) So in overall, my (1) and (5) points are only applicable to APO-as-currently-spec'd and not to the suggested APO revision. On Fri, Apr 29, 2022 at 1:21 PM Nadav Ivgi wrote: > > This is *literally* what the post you are replying to is proposing to > solve. > > I thought the changes mentioned in the OP (+ committing to the spent input > index) only solves the half-spend problem, but not the stable txids one? > > There can be other inputs with a scriptSig, which doesn't get committed to > in the APO hash. I guess this isn't too common, but there might be some > cases where you would want to spend some (pre-selected) non-segwit inputs > alongside your covenant, maybe for fees. With CTV you would pre-commit to > the scriptSig which makes it non-malleable even if the script itself is. > > > Hmm? You can't have channel factories without Eltoo. (Well, you can in > theory but good luck.) > > Maybe you are refering to non-interactive channel creation? > > I was referring to what BIP 119 calls 'Batched Channel Creation' [0], > which is a sort of a channel factory construction under a broader > definition (and in fact was previously called that in the BIP [1]). > > > The case for stable txids is less strong if we have APO (and therefore > Eltoo). > > There's merit in using these factory constructs for Poon-Dryja channels > even if Eltoo was available. > I don't foresee Eltoo taking over the penalty approach entirely, but > rather the two living side by side. > > (It could theoretically be possible to use APO to open Poon-Dryja > channels on top of unstable funding txids, but having stable txids makes > this much more easily integratable with existing lightning implementations, > without the invasive changes that unstable txids would bring.) > > > This has been addressed over and over and over again. If a QC is able > overnight to spend a large fraction of > > the supply, your coins in your super non-QC-vulnerable-bare-CTV-covenant > (that would eventually become > > vulnerable when trying to use it) are worthless. > > It might be the case that a sufficient fraction of supply does switch over > to QC-protected outputs in time, with only some small minority that didn't > actively switch over *and* with revealed bare pubkeys losing their funds, > which wouldn't make BTC entirely worthless. It makes sense not to want to > be in that minority, ideally without requiring further time-sensitive > active action (esp if considering long-term deep cold storage for > inheritance etc). > > (This of course assumes a safe post-QC mechanism to later spend these > funds; IIUC there are some viable approaches for that using a two-step > spending procedure, where you prove knowledge of the pubkey/script preimage > while commiting to a future tx.) > > > Sorry for being sarcastic, but at this point it's not fair to use > quantum-computer FUD to justify the > > activation of CTV over APO, or encourage the use of legacy transactions > over Taproot ones. > > Sorry if it came off as FUDing. I don't know enough to hold a strong > opinion on whether the fear of QCs is justified or not. I know that many > people on this list don't think so, but I also think that this fear is > prevalent enough to warrant taking it into consideration (at least for > features that target long-term SoV use cases; less so for features > targeted at L2 MoE applications like lightning spacechains paypools etc). > > > you can also use the internal key optimization .. you can't have > NUMS-ness then > > Right, which makes this unsuitable for the vaulting use case. > > > Also, it's not 33 extra vbytes vs CTV-in-segwitv0, but 33 extra * > witness units* (8.25 vbytes). > > Ugh yes sorry about that! I realized after hitting send and meant to > clarify that it should've been s/vbyte/WU/ in my next reply. > > > Are APO signatures more expensive to verify? .. the cost for the > network of validating signatures already exists today > > Not compared to existing signature verifications, but compared to a > CTV/TXHASH-like construction. > > Can anyone quantify how much of a difference this makes in practice? > > > i appreciate your reply and your efforts to explore the tradeoffs > between the two approaches. > > Thank you, I appreciate your efforts on this too :-) > > shesek > > [0] > https://github.com/bitcoin/bips/blob/master/bip-0119.mediawiki#Batched_Channel_Creation > [1] https://github.com/bitcoin/bips/pull/1273 > > On Fri, Apr 29, 2022 at 11:31 AM darosior wrote: > >> Hi Shesek, >> >> 1. The resulting txids are not stable. >> >> >> This is *literally* what the post you are replying to is proposing to >> solve. >> >> >> This property could be important for some of the proposed CTV use-cases, >> like channel factories. >> >> >> Hmm? You can't have channel factories without Eltoo. (Well, you can in >> theory but good luck.) >> Maybe you are refering to non-interactive channel creation? The case for >> stable txids is less strong if we >> have APO (and therefore Eltoo). [0] >> >> >> 2. APO will only be available on Taproot, which some people might prefer >> to avoid for long-term multi-decade vault storage due to QC concerns. (also >> see my previous post on this thread [0]) >> >> >> This has been addressed over and over and over again. If a QC is able >> overnight to spend a large fraction of >> the supply, your coins in your super non-QC-vulnerable-bare-CTV-covenant >> (that would eventually become >> vulnerable when trying to use it) are worthless.[1] >> >> Sorry for being sarcastic, but at this point it's not fair to use >> quantum-computer FUD to justify the >> activation of CTV over APO, or encourage the use of legacy transactions >> over Taproot ones. >> >> >> 3. Higher witness satisfaction cost of roughly 3x vbytes vs >> CTV-in-Taproot (plus 33 extra vbytes vs CTV-in-segwitv0 *in the case of >> a single CTV branch*, for the taproot control block. with more branches >> CTV-in-taproot eventually becomes preferable). >> >> >> Again, this is what my post discusses. Here are the arguments from my >> post about why i don't think it's a big deal: >> >> 1. You can in this case see CTV as an optimization of (tweaked) >> APOAS. A lot of us are doubtful about CTV >> usecases for real people. So much that it was even proposed to >> temporarily activate it to see if it would >> ever have any real traction! [2] >> My point with this post was: what if we do (a slightly tweaked) >> BIP118, that is otherwise useful. And >> if this use of covenants is really getting traction then we can >> roll out an optimization in the form of >> CTV (or better covenants, as we'd have had more research put into >> it by this time). >> 2. CTV is mainly sold for its usage inside vaults. While i'm not >> convinced, a few more vbytes should not >> matter for this usecase. >> >> Also, it's not 33 extra vbytes vs CTV-in-segwitv0, but 33 extra * witness >> units* (8.25 vbytes). >> Aside, you can also use the internal key optimization with APO. But i >> don't think it's desirable just to save >> 32 WU, as you can't have NUMS-ness then. [3] >> >> >> 4. Higher network-wide full-node validation costs (checking a signature >> is quite more expensive than hashing, and the hashing is done in both >> cases). >> >> >> Are APO signatures more expensive to verify? If not i don't think this >> should be a reason to constrain us to a >> much less useful construction, as the cost for the network of validating >> signatures already exists today. Even >> if it didn't, the tradeoff of cost/usefulness needs to be considered. >> >> >> 5. As APO is currently spec'd, it would suffer from the half-spend >> problem: if you have multiple outputs encumbered under an APO covenant that >> requires the same tx sigmsg hash, it becomes possible to spend all of them >> together as multiple inputs in a single transaction and burn the extra to >> mining fees. >> >> If I'm not mistaken, I believe this makes the simple-apo-vault >> implementation [1] vulnerable to spending multiple vaulted outputs of the >> same denomination together and burning all but the first one. I asked the >> author for a more definitive answer on twitter [2]. >> >> Fixing this requires amending BIP 118 with some new sigmsg flags (making >> the ANYONECANPAY behaviour optional, as mentioned in the OP). >> >> >> Yes! And as i mentioned on Twitter also committing to the input index >> which i forgot to add in the OP here. >> >> >> While i don't think the specific points are valid, i appreciate your >> reply and your efforts to explore the >> tradeoffs between the two approaches. >> >> Thanks, >> Antoine >> >> [0] >> https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019813.html >> [1] https://bitcoin.stackexchange.com/a/91050/101498 >> [2] >> https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-April/020242.html >> [3] >> https://twitter.com/darosior/status/1518979155362254849?s=20&t=mGkw7K8mcyQwdLImFvdebw >> >> >> This is definitely possible but also means that APO as-is isn't a >> CTV-replacement candidate, without first going through some more design and >> review iterations. >> >> shesek >> >> >> [0] >> https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-April/020326.html >> [1] https://github.com/darosior/simple-anyprevout-vault >> [2] https://twitter.com/shesek/status/1519874493434544128 >> >> >> >> On Fri, Apr 22, 2022 at 2:23 PM darosior via bitcoin-dev < >> bitcoin-dev@lists.linuxfoundation.org> wrote: >> >>> I would like to know people's sentiment about doing (a very slightly >>> tweaked version of) BIP118 in place of >>> (or before doing) BIP119. >>> >>> SIGHASH_ANYPREVOUT and its precedent iterations have been discussed for >>> over 6 years. It presents proven and >>> implemented usecases, that are demanded and (please someone correct me >>> if i'm wrong) more widely accepted than >>> CTV's. >>> >>> SIGHASH_ANYPREVOUTANYSCRIPT, if its "ANYONECANPAY" behaviour is made >>> optional [0], can emulate CTV just fine. >>> Sure then you can't have bare or Segwit v0 CTV, and it's a bit more >>> expensive to use. But we can consider CTV >>> an optimization of APO-AS covenants. >>> >>> CTV advocates have been presenting vaults as the flagship usecase. >>> Although as someone who've been trying to >>> implement practical vaults for the past 2 years i doubt CTV is necessary >>> nor sufficient for this (but still >>> useful!), using APO-AS covers it. And it's not a couple dozen more >>> virtual bytes that are going to matter for >>> a potential vault user. >>> >>> If after some time all of us who are currently dubious about CTV's >>> stated usecases are proven wrong by onchain >>> usage of a less efficient construction to achieve the same goal, we >>> could roll-out CTV as an optimization. In >>> the meantime others will have been able to deploy new applications >>> leveraging ANYPREVOUT (Eltoo, blind >>> statechains, etc..[1]). >>> >>> >>> Given the interest in, and demand for, both simple covenants and better >>> offchain protocols it seems to me that >>> BIP118 is a soft fork candidate that could benefit more (if not most of) >>> Bitcoin users. >>> Actually i'd also be interested in knowing if people would oppose the >>> APO-AS part of BIP118, since it enables >>> CTV's features, for the same reason they'd oppose BIP119. >>> >>> >>> [0] That is, to not commit to the other inputs of the transaction (via >>> `sha_sequences` and maybe also >>> `sha_amounts`). Cf >>> https://github.com/bitcoin/bips/blob/master/bip-0118.mediawiki#signature-message >>> . >>> >>> [1] https://anyprevout.xyz/ "Use Cases" section >>> _______________________________________________ >>> bitcoin-dev mailing list >>> bitcoin-dev@lists.linuxfoundation.org >>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev >>> >> >> --000000000000a211fd05ddc98133 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Correction: thinking about this some more, you can= 9;t actually expect to have a stable txid if you allow additional inputs at= all...

So yes, amending BIP 118 to commit to sha_= sequences (which indirectly also commits to the number of inputs) as propos= ed in the OP should be sufficient to get stable txids for single-input tran= sactions.

(I initially thought that APO has to cov= er some additional tx parts for this, but it seems that it's really jus= t the scriptSig which is guarrnated to be empty if you have a single input = that is known to be the taproot APO spend.)

So in = overall, my (1) and (5) points are only applicable to APO-as-currently-spec= 'd and not to the suggested APO revision.

On Fri, Apr 29, 2022= at 1:21 PM Nadav Ivgi <nadav@shese= k.info> wrote:
> This is *literally* what the p= ost you are replying to is proposing to solve.

<= /span>
I thought the changes mentioned in the OP (+ committing to the spent=20 input index) only solves the half-spend problem, but not the stable=20 txids one?

There can be other inputs with a scriptSig, which doesn't get committed to i= n the APO hash. I guess this isn't too common, but there might be some c= ases=20 where you would want to spend some (pre-selected) non-segwit inputs=20 alongside your covenant, maybe for fees. With CTV you would pre-commit=20 to the scriptSig which makes it non-malleable even if the script itself=20 is.

> Hmm? You = can't have channel factories without Eltoo. (Well, you can in theory bu= t good luck.)
> Maybe you are refering to non-int= eractive channel creation?

<= div>I was referring to what BIP 119 calls 'Batched Channel Creation' [0]= ,=20 which is a sort of a channel factory construction under a broader=20 definition (and in fact was previously called that in the BIP [1]).<= /div>

> The case for stable = txids is less strong if we have APO (and therefore Eltoo).

There's merit in using these = factory constructs for Poon-Dryja channels even if Eltoo was available.
I don't foresee Eltoo taking over the penalty= approach entirely, but rather the two living side by side.

(It could= theoretically be possible to use APO to open Poon-Dryja channels on = top of unstable funding txids, but having stable txids makes this much more easily integratable with=20 existing lightning implementations, without the invasive changes that=20 unstable txids would bring.)

> This has been addressed= over and over and over again. If a QC is able overnight to spend a large f= raction of
> the supply, your coins in yo= ur super non-QC-vulnerable-bare-CTV-covenant (that would eventually become<= /span>
> vulnerable when trying to use it) are worthless= .

It might be the case that a sufficient fraction of supply does switch over to QC-protected outputs in time, with only some small minority that=20 didn't actively switch over and with revealed bare pubkeys losin= g their funds, which wouldn't make BTC entirely worthless. It makes sens= e not to want to be in that minority, ideally without requiring further=20 time-sensitive active action (esp if considering long-term deep cold=20 storage for inheritance etc).

= (This of course assumes a safe post-QC mechanism to later spend these funds; IIUC there are some viable=20 approaches for that using a two-step spending procedure, where you prove knowledge of the pubkey/script preimage while commiting to a future=20 tx.)

> Sorry for being s= arcastic, but at this point it's not fair to use quantum-computer FUD t= o justify the
> activation of CTV over APO, or encoura= ge the use of legacy transactions over Taproot ones.

Sorry if it came off as FUDing. I don&#= 39;t know enough to hold a strong opinion on whether the fear of QCs is justified or not. I know that many people on this list don't think so, but I also think that this fear is=20 prevalent enough to warrant taking it into consideration (at least for=20 features that target long-term SoV use cases; less so for feat= ures targeted at L2 MoE applications like lightning spacechains paypools et= c).

> you can also use the internal key optimization .. you can't ha= ve NUMS-ness then

Right, which = makes this unsuitable for the vaulting use case.

> Also, it's = not 33 extra vbytes vs CTV-in-segwitv0, but 33 extra * witness units* (8.25= vbytes).

Ugh yes= sorry about that! I realized after hitting send and meant to clarify that = it should've been s/vbyte/WU/ in my next reply.

> Are APO signatures more expensive to verify? .. the cost= for the network of validating signatures already exists today

Not= compared to existing signature verifications, but compared to a CTV/TXHASH= -like construction.

<= /div>
Can anyone quantify how much of a difference this mak= es in practice?

> i appreciate your reply and your efforts to explo= re the tradeoffs between the two approaches.

= Thank you, I appreciate your efforts on this too :-)
<= /span>

On Fri, Apr 29, 2022 at 11:31 AM darosior <darosior@protonmai= l.com> wrote:
Hi Shesek,

1. The resulting txids are not stable.

This is *literally* what the post= you are replying to is proposing to solve.


This property could be = important for some of the proposed CTV use-cases, like channel factories.

Hmm? You can't h= ave channel factories without Eltoo. (Well, you can in theory but good luck= .)
Maybe you are refering to non-interactive channel creat= ion? The case for stable txids is less strong if we
have = APO (and therefore Eltoo). [0]


2. APO will only be avail= able on Taproot, which some people might prefer to avoid for long-term multi-decade vault storage due to QC concerns. (als= o see my previous post on this thread [0])

This has been addresse= d over and over and over again. If a QC is able overnight to spend a large = fraction of
the supply, your coins in your super non-QC-vu= lnerable-bare-CTV-covenant (that would eventually become
<= span>vulnerable when trying to use it) are worthless.[1]
<= br>
Sorry for being sarcastic, but at this point it's n= ot fair to use quantum-computer FUD to justify the
activa= tion of CTV over APO, or encourage the use of legacy transactions over Tapr= oot ones.


3. Higher witness sati= sfaction cost of roughly 3x vbytes vs CTV-in-Taproot (plus 33 extra vbytes = vs CTV-in-segwitv0 in the case of a single CTV branch, for the tapro= ot control block. with more branches CTV-in-taproot eventually becomes pref= erable).

Again, this is what my post discusses. Here are the argument= s from my post about why i don't think it's a big deal:
=
=C2=A0 =C2=A0 1. You can in this case see CTV as an op= timization of (tweaked) APOAS. A lot of us are doubtful about CTV
=C2=A0 =C2=A0 =C2=A0 =C2=A0usecases for real people. So much = that it was even proposed to temporarily activate it to see if it would
=C2=A0 =C2=A0 =C2=A0 =C2=A0ever have any real traction!= [2]
=C2=A0 =C2=A0 =C2=A0 =C2=A0My point with this p= ost was: what if we do (a slightly tweaked) BIP118, that is otherwise usefu= l. And
=C2=A0 =C2=A0 =C2=A0 =C2=A0if this use of cov= enants is really getting traction then we can roll out an optimization in t= he form of
=C2=A0 =C2=A0 =C2=A0 =C2=A0CTV (or better= covenants, as we'd have had more research put into it by this time).
=C2=A0 =C2=A0 2. CTV is mainly sold for its usage ins= ide vaults. While i'm not convinced, a few more vbytes should not
=C2=A0 =C2=A0 =C2=A0 =C2=A0matter for this usecase.

Also, it's not 33 extra vbytes vs CTV-= in-segwitv0, but 33 extra * witness units* (8.25 vbytes).
= Aside, you can also use the internal key optimization with APO. But i= don't think it's desirable just to save
32 WU, a= s you can't have NUMS-ness then. [3]


4. Higher netwo= rk-wide full-node validation costs (checking a signature is quite more expe= nsive than hashing, and the hashing is done in both cases).

Are APO signatures more expe= nsive to verify? If not i don't think this should be a reason to constr= ain us to a
much less useful construction, as the cost for= the network of validating signatures already exists today. Evenif it didn't, the tradeoff of cost/usefulness needs to be consi= dered.


5. As APO is currently spec'd, it would = suffer from the half-spend problem: if you have multiple outputs encumbered under an APO covenant that requires the same tx sigmsg hash, it becomes possible to spend all of them together as multiple inputs in a single transaction and burn the extra to mining fees.

If I'm not mistaken, I believe this makes the simple-apo-vault implementation [1] vulnerable to spending multiple vaulted outputs of the same denomination together and burning all but the first one. I asked the author for a more definitive answer on twitter [2].

Fixing this= requires amending BIP 118 with some new sigmsg flags (making the ANYONECAN= PAY behaviour optional, as mentioned in the OP).

Yes! And as i mentioned on Twitter also commi= tting to the input index which i forgot to add in the OP here.

While i don't think the s= pecific points are valid, i appreciate your reply and your efforts to explo= re the
tradeoffs between the two approaches.

Thanks,
Antoine

This is d= efinitely possible but also means that APO as-is isn't a CTV-replacemen= t candidate, without first going through some more design and review iterat= ions.

shesek

=
[1] https://github.com/darosior/simple-anyprevout-vault



On Fri, Apr 22, 2022 at 2:23 PM darosior via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> wrote= :
I would like t= o know people's sentiment about doing (a very slightly tweaked version = of) BIP118 in place of
(or before doing) BIP119.

SIGHASH_ANYPREVOUT and its precedent iterations have been discussed for ove= r 6 years. It presents proven and
implemented usecases, that are demanded and (please someone correct me if i= 'm wrong) more widely accepted than
CTV's.

SIGHASH_ANYPREVOUTANYSCRIPT, if its "ANYONECANPAY" behaviour is m= ade optional [0], can emulate CTV just fine.
Sure then you can't have bare or Segwit v0 CTV, and it's a bit more= expensive to use. But we can consider CTV
an optimization of APO-AS covenants.

CTV advocates have been presenting vaults as the flagship usecase. Although= as someone who've been trying to
implement practical vaults for the past 2 years i doubt CTV is necessary no= r sufficient for this (but still
useful!), using APO-AS covers it. And it's not a couple dozen more virt= ual bytes that are going to matter for
a potential vault user.

If after some time all of us who are currently dubious about CTV's stat= ed usecases are proven wrong by onchain
usage of a less efficient construction to achieve the same goal, we could r= oll-out CTV as an optimization. In
the meantime others will have been able to deploy new applications leveragi= ng ANYPREVOUT (Eltoo, blind
statechains, etc..[1]).


Given the interest in, and demand for, both simple covenants and better off= chain protocols it seems to me that
BIP118 is a soft fork candidate that could benefit more (if not most of) Bi= tcoin users.
Actually i'd also be interested in knowing if people would oppose the A= PO-AS part of BIP118, since it enables
CTV's features, for the same reason they'd oppose BIP119.


[0] That is, to not commit to the other inputs of the transaction (via `sha= _sequences` and maybe also
`sha_amounts`). Cf https://github.com/bitcoin/bips/blob/master/bip-0118.media= wiki#signature-message.

[1] https://anyprevout.xyz/ "Use Cases" secti= on
_______________________________________________
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org<= /a>
https://lists.linuxf= oundation.org/mailman/listinfo/bitcoin-dev

--000000000000a211fd05ddc98133--