From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 46570C0032 for ; Wed, 9 Aug 2023 08:39:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 28BD0416F2 for ; Wed, 9 Aug 2023 08:39:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 28BD0416F2 Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=J5VGdUvP X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.098 X-Spam-Level: X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no 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 MZz7ItS_f-vB for ; Wed, 9 Aug 2023 08:39:01 +0000 (UTC) Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by smtp4.osuosl.org (Postfix) with ESMTPS id EA5C441602 for ; Wed, 9 Aug 2023 08:39:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org EA5C441602 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-348db491d0eso29193065ab.3 for ; Wed, 09 Aug 2023 01:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691570340; x=1692175140; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lj5na6c9F2Zhjjp9bhn9Sib9egD26RadLy7vFHltc8k=; b=J5VGdUvPY3Kn7XX3tJ6B+eWXFqZFcyQk9j73H5qHxVh0cvTqHGFHsdQ/iQFm8W/PgP mR5xAbwAaf3N+Kh/feBN1EZWJ/CmzZRaoKanpimGDQ5JMPARpjgtpvcOm3fMvqiRDdv0 2Czs40SwnOHtTnPoEd/bGhBLVkmAtXKQCf5XBIR7zdkDVIxaAc7WqT+yguD2lgRW1+AS /HJuxlQ55OECjTQ0nrV55Wnr+XuaELshU797wJDsO+LGhVlRfmr/bh6GpY0rbhsNBPIx /0t4spN7SVp3x59qJUhFlLfYL6R60+/nQ6lV+vLD5xoYLHYMpzbTHYPhuDQN/drj3Y5y 8h0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691570340; x=1692175140; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lj5na6c9F2Zhjjp9bhn9Sib9egD26RadLy7vFHltc8k=; b=i17ND4Mh9JrOJZ1dWQct3syErSnldD+Or4HhJXEuMopiFqQ0uPucWCzT5m+fXdLXFy Wmg84lExlU1IPjqIbwj67Bp/0ILFbGd+DyTToLUcZP9CxaWCACYjf3e7H6m22c/1PZcz eXCzE9/NY/+5wbmJCLX+RcksLyEKriUAGVobHOdpllQqQ7cuc3sF3ntnldyqSYtlJAz+ FQ+qJ0lGIuAp7RgnijKLah1x5Fh9Bodn6r4tC9ZkrOINLC5Ra4PCi7uBSVocfc/dhdn4 CGV4NhikB+dHuraec6RxkhEHJGn6MXMyhQyOuHvWUEeJqz7IlG8MdVw8Yau3pFJjACPK lEKQ== X-Gm-Message-State: AOJu0YzpzEJ1C2c9r4AFTOowAu6insS8+OLMCzFe4Bo8BMq7NBwNwsOk HhqrAmfVN2US4RLWw1xq/zL4npwnvrxjdo/MF18= X-Google-Smtp-Source: AGHT+IEV3Y5dfZRdSXKmC5wieE3TAqO2nOOR7ogBHHP8uz2Lm+3TbagjoeVu1x/aTS17r7XqOSYtqqoHA0gy+bFpSlQ= X-Received: by 2002:a05:6e02:1bc6:b0:349:779e:895d with SMTP id x6-20020a056e021bc600b00349779e895dmr2961325ilv.29.1691570339895; Wed, 09 Aug 2023 01:38:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Salvatore Ingala Date: Wed, 9 Aug 2023 10:38:48 +0200 Message-ID: To: =?UTF-8?Q?Johan_Tor=C3=A5s_Halseth?= Content-Type: multipart/alternative; boundary="00000000000038de960602796918" X-Mailman-Approved-At: Wed, 09 Aug 2023 10:56:24 +0000 Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] Concrete MATT opcodes 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: Wed, 09 Aug 2023 08:39:02 -0000 --00000000000038de960602796918 Content-Type: text/plain; charset="UTF-8" Hi Johan, Thanks a lot for the comments, and the independent implementation! > - For the opcode parameter ordering, it feels unnatural for the two > tweaks (data, taptree) to be separated by the internal key. A more > natural ordering of parameters IMO would be (of course this is all > subjective): > OP_CCV. > > If you disagree, I would love some rationale for the ordering you > chose! (looks like you also changed it again after your last post?). The main concern for the reordering was to put at the bottom, as that's typically passed via the witness stack. I put the right next, as I suspect there are use cases for specifying via the witness what is the input index where a certain (CCV-encumbered) UTXO is to be found, or which output should funds be sent to, instead of hard-coding this in the script. This might help in designing contracts that are more flexible in the way they are spent, for example by allowing batching their transactions. Instead, I expect the other parameters to almost always be hardcoded, or propagated from the current input with the <-1> special values. I agree that your ordering is more aesthetically pleasing, though. > I'm wondering what other use cases you had in mind for the deferred > output amount check? Maybe I have missed something, but if not it > would perhaps be better to leave out the amount preservation check, or > go the extra mile and propose a more powerful amount introspection > machinery. Yes, the deferred output amount check is not enough for coinpools; however, it comes at no cost if we have a parameter anyway, as OP_2 (value for CCV_IGNORE_OUTPUT_AMOUNT) is a single byte opcode. The intent of preserving amounts for many-to-one contracts (vaults), or the one-to-one cases (channels, any 2-party contract, etc.) seems common enough to deserve 1 bit in the flags, IMHO. Efforts to define and add explicit introspection to cover your (exciting!) use cases can proceed independently, but I don't think they would nullify the advantages of this (optional) feature of CCV. Best, Salvatore --00000000000038de960602796918 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Johan,

Thanks a lot for the com= ments, and the independent=C2=A0implementation!

> - For the opcod= e parameter ordering, it feels unnatural for the two
> tweaks (data, = taptree) to be separated by the internal key. A more
> natural orderi= ng of parameters IMO would be (of course this is all
> subjective):> <data> <taptree> <internalkey> <index> <f= lags> OP_CCV.
>
> If you disagree, I would love some rationa= le for the ordering you
> chose! (looks like you also changed it agai= n after your last post?).

The main concern for the reordering was to= put <data> at the bottom,
as that's typically passed via the = witness stack.

I put the <index> right next, as I suspect ther= e are use cases for
specifying via the witness what is the input index w= here a certain
(CCV-encumbered) UTXO is to be found, or which output sho= uld funds
be sent to, instead of hard-coding this in the script. This mi= ght
help in designing contracts that are more flexible in the way theyare spent, for example by allowing batching their transactions.

In= stead, I expect the other parameters to almost always be hardcoded,
or p= ropagated from the current input with the <-1> special values.
I agree that your ordering is more aesthetically pleasing, though.

= > I'm wondering what other use cases you had in mind for the deferre= d
> output amount check? Maybe I have missed something, but if not it=
> would perhaps be better to leave out the amount preservation check= , or
> go the extra mile and propose a more powerful amount introspec= tion
> machinery.

Yes, the deferred output amount check is not= enough for coinpools;
however, it comes at no cost if we have a <fla= gs> parameter anyway,
as OP_2 (value for CCV_IGNORE_OUTPUT_AMOUNT) is= a single byte opcode.

The intent of preserving amounts for many-to-= one contracts (vaults),
or the one-to-one cases (channels, any 2-party c= ontract, etc.) seems
common enough to deserve 1 bit in the flags, IMHO.<= br>Efforts to define and add explicit introspection to cover your
(excit= ing!) use cases can proceed independently, but I don't think
they wo= uld nullify the advantages of this (optional) feature of CCV.

Best,
Salvatore
--00000000000038de960602796918--