Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 82264C000B for ; Wed, 16 Mar 2022 15:39:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DCE50813AD for ; Wed, 16 Mar 2022 15:39:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -1.599 X-Spam-Level: X-Spam-Status: No, score=-1.599 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=protonmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZfWPLZKw7ydi for ; Wed, 16 Mar 2022 15:39:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3EAAB80C32 for ; Wed, 16 Mar 2022 15:39:08 +0000 (UTC) Date: Wed, 16 Mar 2022 15:38:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1647445146; bh=TfoG0Ii72AuPooGYAZ2gw7DVlbIzwMOOM3s8Vpw5iFQ=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=CHJ5NQ+h/vUfAdYk6vvAYjN6yuOb/xQXdiWmzOfgP7wMGNJePyME4oy+5Vk0BFod4 uwa7ihj1c7+D3KKEpTJQOBXL8oG3uy5/yPF4FrKiHqtKEbaEfrCpgQMBMPp0qKo4Ht DhESIKcze1QHmu5j8D3Oq0/ODc4jklJqz15t2aFZBq2u+Mnbx5Xuli/qxM5vvm82pd TPGoX2eIdnwflUHjonTIcg1Z3fWaztqYr2VDpV/+Pl+bNjUnpe/uCgd75P387CFKRO grYqnsMc8Vebp/tiBHP2Pz9lCgKtlV8MNXKgN53XHsiQjuYHaCRlrFHwCjZUkZxNJW Yq31bugksVQQw== To: Billy Tetrud From: ZmnSCPxj Reply-To: ZmnSCPxj Message-ID: In-Reply-To: References: <8R8D_XAaz7xYHmgWXR-pc3_GVFRzBCNdRT6s3PdKblrnnZPirB0orzLpEUvynBZHNBTiqOM_EteDdUjdqXQ5ZmrGbdlgnnfjIihgFZIXpUM=@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] Jets (Was: `OP_FOLD`: A Looping Construct For 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: Wed, 16 Mar 2022 15:39:11 -0000 Good morning Billy, > > I think we would want to have a cleanstack rule at some point > > Ah is this a rule where a script shouldn't validate if more than just a t= rue is left on the stack? I can see how that would prevent the non-soft-for= k version of what I'm proposing.=C2=A0 Yes. There was also an even stronger cleanstack rule where the stack and alt sta= ck are totally empty. This is because a SCRIPT really just returns "valid" or "invalid", and `OP_= VERIFY` can be trivially appended to a SCRIPT that leaves a single stack it= em to convert to a SCRIPT that leaves no stack items and retains the same b= ehavior. > > > How large is the critical mass needed? > > Well it seems we've agreed that were we going to do this, we would want t= o at least do a soft-fork to make known jet scripts lighter weight (and unk= nown jet scripts not-heavier) than their=C2=A0non-jet counterparts. So give= n a situation where this soft fork happens, and someone wants to implement = a new jet, how much critical mass would be needed for the network to get so= me benefit from the jet? Well, the absolute minimum for some benefit to hap= pen is that two nodes that support that jet are connected. In such a case, = one node can send that jet scripted transaction along without sending the d= ata of what the jet stands for. The jet itself is pretty small, like 2 or s= o bytes. So that does impose a small additional cost on nodes that don't su= pport a jet. For 100,000 nodes, that means 200,000 bytes of transmission wo= uld need to be saved for a jet to break even. So if the jet stands for a 22= byte script, it would break even when 10% of the network supported it. If = the jet stood for a 102 byte script, it would break even when 2% of the net= work supported it. So how much critical mass is necessary for it to be wort= h it depends on what the script is.=C2=A0 The math seems reasonable. > The question I have is: where would the constants table come from? Would = it reference the original positions of items on the witness stack?=C2=A0 The constants table would be part of the SCRIPT puzzle, and thus not in the= witness solution. I imagine the SCRIPT would be divided into two parts: (1) a table of consta= nts and (2) the actual opcodes to execute. Regards, ZmnSCPxj