diff options
author | ZmnSCPxj <ZmnSCPxj@protonmail.com> | 2022-05-08 02:19:57 +0000 |
---|---|---|
committer | bitcoindev <bitcoindev@gnusha.org> | 2022-05-08 02:20:07 +0000 |
commit | d51fa333010f9a3bcad09eb304aea9edf2f33840 (patch) | |
tree | ad9f35ee5d9f567b31c9f7000f4057b524c1af4f | |
parent | 2bef716f7a3e1836b875f229302bdad13a266541 (diff) | |
download | pi-bitcoindev-d51fa333010f9a3bcad09eb304aea9edf2f33840.tar.gz pi-bitcoindev-d51fa333010f9a3bcad09eb304aea9edf2f33840.zip |
Re: [bitcoin-dev] Speedy covenants (OP_CAT2)
-rw-r--r-- | f6/8123f9a67189dfd6b4bf750926dabe015c2d17 | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/f6/8123f9a67189dfd6b4bf750926dabe015c2d17 b/f6/8123f9a67189dfd6b4bf750926dabe015c2d17 new file mode 100644 index 000000000..dd2d1c03e --- /dev/null +++ b/f6/8123f9a67189dfd6b4bf750926dabe015c2d17 @@ -0,0 +1,115 @@ +Return-Path: <ZmnSCPxj@protonmail.com> +Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) + by lists.linuxfoundation.org (Postfix) with ESMTP id 5891EC002D + for <bitcoin-dev@lists.linuxfoundation.org>; + Sun, 8 May 2022 02:20:07 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by smtp2.osuosl.org (Postfix) with ESMTP id 42CC74026F + for <bitcoin-dev@lists.linuxfoundation.org>; + Sun, 8 May 2022 02:20:07 +0000 (UTC) +X-Virus-Scanned: amavisd-new at osuosl.org +X-Spam-Flag: NO +X-Spam-Score: -1.601 +X-Spam-Level: +X-Spam-Status: No, score=-1.601 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, + FROM_LOCAL_NOVOWEL=0.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] + autolearn=ham autolearn_force=no +Authentication-Results: smtp2.osuosl.org (amavisd-new); + dkim=pass (2048-bit key) header.d=protonmail.com +Received: from smtp2.osuosl.org ([127.0.0.1]) + by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 5iuVdj4YWgEt + for <bitcoin-dev@lists.linuxfoundation.org>; + Sun, 8 May 2022 02:20:06 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 +Received: from mail-40138.protonmail.ch (mail-40138.protonmail.ch + [185.70.40.138]) + by smtp2.osuosl.org (Postfix) with ESMTPS id 78A85401A1 + for <bitcoin-dev@lists.linuxfoundation.org>; + Sun, 8 May 2022 02:20:06 +0000 (UTC) +Date: Sun, 08 May 2022 02:19:57 +0000 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; + s=protonmail2; t=1651976403; + bh=jZFDwqwKVW8g7GOCTPkABhXphCmg9evC7hF8Q9VefDU=; + h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: + References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: + Feedback-ID:Message-ID; + b=APhVUZQc9aXbRxPJq/YZgihyyDHiYu8bM1sadKpPl5ywzXRJL30zfIfQcr6gm1YvM + f/S4j8PMbx26kfUW6ikwTogOIrKO3Hh8qnAkxdSVLEwzDC0WsBdGW6TWlFqZhD4rpg + rfPDnaEv8/DSy/G2XOB4Zkb0Fdu+Qf/OadAt5JIw+CFkSX33QmiHv081zv9Q1PMlXo + LJsmutcVucA5XhLLE345Ljo1z4Cf7tzOf8RwEaHH1kN84TC+RsCznFn2aogOeSZ8te + mRAxJw1owV+je7H2nnTEExZpiycQI/F7pmhaLR/Y0wjSQCrPuRkO188h10Twa48SXp + a0erKfL3PzPjg== +To: Nadav Ivgi <nadav@shesek.info> +From: ZmnSCPxj <ZmnSCPxj@protonmail.com> +Reply-To: ZmnSCPxj <ZmnSCPxj@protonmail.com> +Message-ID: <6pDae6X_tAfMTldPPsad5CSHPF98NVbTf06JxRCs7RqJGyrOqLALsDHHa_3C5DbbfpAVnzLMWCn-7e0FwQO-TOk4XxWYIiaYomuA9NJjkEQ=@protonmail.com> +In-Reply-To: <CAGXD5f2vLaZgEUG7eu6S9YQSSLeJ0LAM+i2o1ngVb=VmxS3Rrg@mail.gmail.com> +References: <CABm2gDoivzQKFr6KqeqW6+Lx7xFVprRCUAn1k3X6P29NPzw+yQ@mail.gmail.com> + <1JO1xrnJ9GwGM4TgLH_rL_LpnZgSb1SyeEOJ9Gzc1VMbKUrmxSh-zUXKwFNvp_5wyiDtRviOf-gRJbrfbhOJl-qym1eEHXpoDAgjE9juucw=@protonmail.com> + <CABm2gDrdwMjLu=i0p2m4SZ_91xpr-RvwSSWOnS9jhaQ3uaCxPA@mail.gmail.com> + <CiNPwh37hW6iDk3mMg6G2QWMPS5ADUvSdySnNp6esOaloiVyoPwHGxOMLyG6mMGQnyf4iGcch12XfmOB2WnFcETwFwvRTSNSeBu27G9Cju8=@protonmail.com> + <CAGXD5f2vLaZgEUG7eu6S9YQSSLeJ0LAM+i2o1ngVb=VmxS3Rrg@mail.gmail.com> +Feedback-ID: 2872618:user:proton +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org> +Subject: Re: [bitcoin-dev] Speedy covenants (OP_CAT2) +X-BeenThere: bitcoin-dev@lists.linuxfoundation.org +X-Mailman-Version: 2.1.15 +Precedence: list +List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org> +List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, + <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe> +List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/> +List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org> +List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help> +List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, + <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe> +X-List-Received-Date: Sun, 08 May 2022 02:20:07 -0000 + +Good morning shesek, + +> On Sat, May 7, 2022 at 5:08 PM ZmnSCPxj via bitcoin-dev <bitcoin-dev@list= +s.linuxfoundation.org> wrote: +> > * Even ***with*** `OP_CAT`, the following will enable non-recursive cov= +enants without enabling recursive covenants: +> >=C2=A0 * `OP_CTV`, ... +> > * With `OP_CAT`, the following would enable recursive covenants: +> >=C2=A0 * `OP_CHECKSIGFROMSTACK`, ... +> +> Why does CTV+CAT not enable recursive covenants while CSFS+CAT does? +> +> CTV+CAT lets you similarly assert against the outputs and verify that the= +y match some dynamically constructed script. +> +> Is it because CTV does not let you have a verified copy of the input's pr= +evout scriptPubKey on the stack [0], while with OP_CSFS you can because the= + signature hash covers it? +> +> But you don't actually need this for recursion. Instead of having the use= +r supply the script in the witness stack and verifying it against the input= + to obtain the quine, the script can simply contain a copy of itself as an = +initial push (minus this push). You can then reconstruct the full script qu= +ine using OP_CAT, as a PUSH(<script>) followed by the literal <script>. + + <OP_PUSH_length-of-script> OP_SWAP OP_DUP OP_CAT OP_CAT <rest of script= +...> + +Ha, yes, looks like you are correct here. + +`OP_CAT` makes *all* covenant opcodes recursive, because you can always qui= +ne using `OP_CAT`. + +By itself it does not make recursive covenants, but with probably any opcod= +e it would. + +Looks like `OP_CAT` is not getting enabled until after we are reasonably su= +re that recursive covenants are not really unsafe. + +Regards, +ZmnSCPxj + |