Return-Path: Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 44545C002B for ; Fri, 17 Feb 2023 12:49:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1F6764016B for ; Fri, 17 Feb 2023 12:49:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 1F6764016B X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -1.902 X-Spam-Level: X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no 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 L7uSK7Fuyexy for ; Fri, 17 Feb 2023 12:49:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org F1BC04011D Received: from cerulean.erisian.com.au (azure.erisian.com.au [172.104.61.193]) by smtp2.osuosl.org (Postfix) with ESMTPS id F1BC04011D for ; Fri, 17 Feb 2023 12:49:52 +0000 (UTC) Received: from 60.42.96.58.static.exetel.com.au ([58.96.42.60] helo=sapphire.erisian.com.au) by cerulean.erisian.com.au with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pT0BN-0003vL-Bf; Fri, 17 Feb 2023 22:49:47 +1000 Received: by sapphire.erisian.com.au (sSMTP sendmail emulation); Fri, 17 Feb 2023 22:49:41 +1000 Date: Fri, 17 Feb 2023 22:49:41 +1000 From: Anthony Towns To: Russell O'Connor , Bitcoin Protocol Discussion Message-ID: References: <57f780b1-f262-9394-036c-70084320e9cf@peersm.com> <3d00aacb-585d-f875-784d-34352860d725@peersm.com> <230265ee-c3f8-dff3-9192-f0c8dc4d913c@peersm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam_score: -1.0 X-Spam_bar: - Subject: Re: [bitcoin-dev] Debate: 64 bytes in OP_RETURN VS taproot OP_FALSE OP_IF OP_PUSH 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, 17 Feb 2023 12:49:54 -0000 On Sat, Feb 04, 2023 at 07:11:35PM -0500, Russell O'Connor via bitcoin-dev wrote: > Since bytes in the witness are cheaper than bytes in the script pubkey, > there is a crossover point in data size where it will simply be cheaper to > use witness data. Given today's standardness constraints, that's true (because you first need to construct a p2wsh/tapscript output that commits to the data, then you have to spend it), but it needn't stay that way. Allowing a data carrier entry in the annex (as contemplated for eltoo [0]) would allow you to publish the data with a single transaction, with malleability prevented because the annex content is committed to by the signature. [0] https://github.com/bitcoin-inquisition/bitcoin/pull/22 I think the cost for publishing data via the witness today is roughly: 115 vb - for the commitment tx 115 vb + datalen/4 - for the publication tx versus 125 vb + datalen - for a tx with an OP_RETURN output so the crossover point is at a datalen of about 140 bytes. Perhaps slightly more or less depending on how much you can combine these inputs/outputs with other txs you would have made anyway. With a datacarrier in the annex that has similar or higher limits than OP_RETURN, I don't think OP_RETURN would ever be cheaper. The other advantage to using the witness for random data compared to OP_RETURN is that the txid commits to OP_RETURN output, so you must download all OP_RETURN data to validate a block's merkle tree, whereas you can partially validate a block (in particular, you can validate the spendable utxo set) without downloading witness data [1]. [1] https://github.com/bitcoin/bitcoin/pull/27050 Cheers, aj