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 B16E8C0032 for ; Fri, 20 Oct 2023 03:51:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7ABA54DC33 for ; Fri, 20 Oct 2023 03:51:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7ABA54DC33 Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=rustcorp.com.au header.i=@rustcorp.com.au header.a=rsa-sha256 header.s=202305 header.b=R1RdJ29D X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -4.053 X-Spam-Level: X-Spam-Status: No, score=-4.053 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-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 pcXmJQXT5ZOs for ; Fri, 20 Oct 2023 03:51:00 +0000 (UTC) X-Greylist: delayed 603 seconds by postgrey-1.37 at util1.osuosl.org; Fri, 20 Oct 2023 03:51:00 UTC DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 45576485C2 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by smtp4.osuosl.org (Postfix) with ESMTPS id 45576485C2 for ; Fri, 20 Oct 2023 03:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rustcorp.com.au; s=202305; t=1697773248; bh=GyvIRl7JF457RmWu80svqK+3huvqYMFrSvwdpbQp1jE=; h=From:To:Subject:Date:From; b=R1RdJ29Du8ZSXab5AD6BKgCrsUiFNpXAQ/p32R1dYBCcNMlTzrJWf0TfdZzmB+j99 cjfed3RZYoKHGGD/wqQVA1P3QUrUExxGyypefDnuqoOqJBKEvH0PXUFsq17pUN5wNj kXlVnH7xcSTARAv4mdclHCWXuAGGvZuj5ixGwj0tJbeOSOCeDGyyW83WRYleRIX7fR Cm2omEQo6T8mSWgD5Jy2xV9Ev8RwOBcPQE1+C5UsRn5kIlRUhNcF/ySkxA8MBiALPb nzekVqNUE/GidgXkK0ma5nMWREtE1Dlb3kyHwkkR/I0R+ihuMy+eu4/sodALQiXo3k iPFmRobnYXElA== Received: by gandalf.ozlabs.org (Postfix, from userid 1011) id 4SBVjX6Lgdz4xWY; Fri, 20 Oct 2023 14:40:48 +1100 (AEDT) From: Rusty Russell To: "Bitcoin Protocol Discussion" Date: Fri, 20 Oct 2023 14:10:37 +1030 Message-ID: <87v8b2vu4q.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Subject: [bitcoin-dev] Examining ScriptPubkeys in Bitcoin Script 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, 20 Oct 2023 03:51:01 -0000 Hi all, I've done an exploration of what would be required (given OP_TX/OP_TXHASH or equivalent way of pushing a scriptPubkey on the stack) to usefully validate Taproot outputs in Bitcoin Script. Such functionality is required for usable vaults, at least. https://rusty.ozlabs.org/2023/10/20/examining-scriptpubkey-in-script.html (If anyone wants to collaborate to produce a prototype, and debug my surely-wrong script examples, please ping me!) TL;DR: if we have OP_TXHASH/OP_TX, and add OP_MULTISHA256 (or OP_CAT), OP_KEYADDTWEAK and OP_LESS (or OP_CONDSWAP), and soft-fork weaken the OP_SUCCESSx rule (or pop-script-from-stack), we can prove a two-leaf tapscript tree in about 110 bytes of Script. This allows useful spending constraints based on a template approach. Thanks! Rusty.