Delivery-date: Mon, 09 Dec 2024 14:16:34 -0800 Received: from mail-qk1-f187.google.com ([209.85.222.187]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tKm3N-0001lA-OY for bitcoindev@gnusha.org; Mon, 09 Dec 2024 14:16:34 -0800 Received: by mail-qk1-f187.google.com with SMTP id af79cd13be357-7b6c8e4baaasf166180685a.3 for ; Mon, 09 Dec 2024 14:16:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1733782587; cv=pass; d=google.com; s=arc-20240605; b=OnMc/dqL6ELNdl6wacEN26yaHWT7UBG+jQVowGDM4WHLcl3nQi1EPJ0MLvmIVY72eY lZQrOAwNdJbKYNFOxtx5GBwg1sSsggTfi4DGSSgRufUTFvMn0JoMXyrO4CwXKnynLd3F vJdg64sHwwlSCyVQ4d2MVvOClv40RTv7M7OxgyuyofiBBRNuHhx/2q+SfnFrCrkQ5mcP pnNx31JMMPS9q/caa5X9EZjfQWyfEVpDO26fSUNzFpiCo9g7lpYwNJAnQmgLMwT7H/XY zbSzBmflqc3n1WffR1cWb/mcZY+MVF+zjl78oU7fTbra6Knpw79n4IYAZIymQh+I2lpX A79w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :dkim-signature; bh=sBBWjfx/mV1hKenE1JbRMGaltr/jF5jHxRgTQp5f+bM=; fh=RDSQ/C1NdUJpehzfk2OjyxQL5BbuiRcxMlm3PMcknw8=; b=gaUe+5RFWQRauEoiNKmMdagf3cBtx/xkJrCqt6dRP+uLLRmYfoLfo3f8pr+3H+aHAk 2rCzD3NCeiUkJ6UstKE7P4n+wC59nOa8Y3j+Un0u4g4jjsBl38RH5U4UmLIz4/eJT5yJ EmmEXL2wuHU2hrrVNZ7Ozz9HG+S/S4GmD+ItsaPZj8BDNb+oe+JH1w1ItYrSnRnkD29f fs86FEhqY1bkoDdW4YOxZkmA02bjbAbKopMAmOaHpTJ1d5Lvjmw8cs5jJCGvL6wChTec LYGyATRIo6umKHqAQEfWVg4Uix1cgXVYOm4kqkznnkauPY5MWgPlWaPXHR4mRgD7wi3L 4ytg==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@reardencode.com header.s=mail header.b=shrgmaX3; spf=pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) smtp.mailfrom=freedom@reardencode.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=reardencode.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1733782587; x=1734387387; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=sBBWjfx/mV1hKenE1JbRMGaltr/jF5jHxRgTQp5f+bM=; b=S0XCQp31gOK/VGnTuI2gM0Uu5US348IagZWbFOzlYaM1bwZ/0W8JMpuUKsiPYfJpsZ DdtsFhEOmS8E57WBV3GQpZndbd1isfNGp6MftRs/zzL6BQTUoTkT6VXikX+wFGCY0IZw H8MQkSqLIOCcO/4nYz+cLIVZyGbma6kQFPg28xuBlu5Vr6Yfzxm7m4fVeYqiS46+++Z9 9v+cLYb06f31P6s4M1ahyP/4APka39aHqvlAZrhxO7ZTTxWM6oDArtC5MbA4nugSOYxT 1hEPWIt0H6Kt8I25hbcff18BXGuwJQfb0O6y8PvdD4ZiBliGjKL9FmeneFq71V14zlj5 S7RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733782587; x=1734387387; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=sBBWjfx/mV1hKenE1JbRMGaltr/jF5jHxRgTQp5f+bM=; b=CygH+9XV8rzaEJ1nbvOIUzpauMW+/LF6rF2KNcMh80xT3dhscdn6B4Qe8xDcEBiJiM Yg4UzHLEODh5UfPpEnkTkHPtE0yuq9txP85tORcNFxd5/INJTjxlHV7y5643qxPBjarh 1Ziz+UuSNy9anyxAYA0MjgWr5ApsRFw4uO9zJp72+dcJI7E1Bq2L6lJGOkvChZTjx/sC piVuJ/7cGc301/3J+l2QolrjOphaY0dMya0kslHNpEKSScKp+yTjaOuNs5mzRkdMf0bB lf8EoMZUDQKBuUyzsYmJddXiUfzgpJbwQtRS58UGkpdC0R5B+ddkb24nXm53Hc/PU7NG Kjhw== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCW4rHtOrMZv5D0GoQfxh23K80OQW1wjI4tkR186esG12hzzaH4Aou24BOrMwyNX9mdTqJP16VbevylY@gnusha.org X-Gm-Message-State: AOJu0Yyc5TJJM9eAUbRsa6OdU2B45RxT/vgcEwo67nJvGC4W0FZ0XQ2+ ZZIeMjT9oa24PrI012P/cZDuh3Bu1CJdEiGVmiTfM5TG6xvFmPqP X-Google-Smtp-Source: AGHT+IFA7SwUh/sk6nkG8Vm7hIjbsr4iSxO6/oTtZevR9DAkTUPeDl2Cqf3S0CXakbXWjeqUOeopDg== X-Received: by 2002:a05:620a:489b:b0:7b6:d2bb:25c3 with SMTP id af79cd13be357-7b6dce7048dmr385044685a.36.1733782587345; Mon, 09 Dec 2024 14:16:27 -0800 (PST) X-BeenThere: bitcoindev@googlegroups.com Received: by 2002:a05:622a:1a83:b0:466:98fc:1e3f with SMTP id d75a77b69052e-46727cf928bls8396441cf.1.-pod-prod-04-us; Mon, 09 Dec 2024 14:16:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVbd3ClCGVStBchhZxX602Y7bPFIfZnVhQwSAynLw7cjkBIm6u3v7DbDXmlie1C6pI6zdKdeAKpwoUh@googlegroups.com X-Received: by 2002:a05:620a:4720:b0:7b6:d1f6:3e0 with SMTP id af79cd13be357-7b6dce24aeemr346733785a.22.1733782585085; Mon, 09 Dec 2024 14:16:25 -0800 (PST) Received: by 2002:a05:620a:2283:b0:7b6:d314:a4e5 with SMTP id af79cd13be357-7b6df46e1cbms85a; Mon, 9 Dec 2024 14:06:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUvcyVcb6pxs9WquztfLKPdbPOMyijBWMtxP67TjJYrDvPsg3lh88rRYOt4KTCYCAjckyMl0U3MESMD@googlegroups.com X-Received: by 2002:a05:6122:268b:b0:50a:318:b3c2 with SMTP id 71dfb90a1353d-518882ef84fmr3306958e0c.2.1733782002150; Mon, 09 Dec 2024 14:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733782002; cv=none; d=google.com; s=arc-20240605; b=IyJtmcTBdzDihQQwHqw6bF91nt34Q2OAZaxYbonutmsY+6erMy/lSs1T9Ily0fZT1L LyTQi8UFkLI0kCoeSJUk4Xf5L33wUWs6uMfNL5ijTi0QbvFcnGcBnihCvoI6cCi8cJ0L +0suYO2gcRYFPISze5GuzRI0avUItloVqmC5x+PnGCRQxxo71Wsc8n1YLFBTD1teKwp7 O+5+TFCDFrgIDU7ZG2rYs3M9deXxtVcnlfqTP0AYH/XHfjOGXord9G8B1NH/4qZFKP1l uZx9+K2DJjy+CEt+nyECPCcm6KbnRLQnMK3Z8w3pFIeRE0CpRNxpOvfzxL2osAzM1cy2 G5RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:dkim-signature:date; bh=yroNtnMSYkrxtEJWzCdn6RMhuQYnTF8wG3xFM/v5OPw=; fh=WzA7XE6JThZt6XHU34+ovZ4yjpN4+JvtHw9XmbCP2LI=; b=NkCwB7oOZBHHvq2oVxjQBX0iWZKn7TJA4656OZxTAW7QKKzGrzpJ6nnigmsPpr8Hta FYwlKGPKuDa00mDoErRke60+c93jZHAGFOHxr62LqS74egEm9sb7ual4224wDi330J8W OMgkvekbe2J6YNxUPH6OWfkZf2uHKkdEoop1fmr/21fRiGs1aXm8ZdgIDCTWSLdCjxAv 197rZR3yo3yf+gdNRn6xBwjVDV3LzPBWYELPM2rD7WSasq94I7IrqVaNPkms6y/OjEOO KWD+bocwNJMp8XzLGmkfIwLW5lF+2/dgDeWMDjm4EuBlQ8o97o/XBzQv+ajs591O8Q6x XA+Q==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@reardencode.com header.s=mail header.b=shrgmaX3; spf=pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) smtp.mailfrom=freedom@reardencode.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=reardencode.com Received: from mail.reardencode.com ([2607:f2f8:ad40:ea11::1]) by gmr-mx.google.com with ESMTPS id 71dfb90a1353d-5161637e295si287514e0c.5.2024.12.09.14.06.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 14:06:41 -0800 (PST) Received-SPF: pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) client-ip=2607:f2f8:ad40:ea11::1; Date: Mon, 9 Dec 2024 14:06:08 -0800 From: Brandon Black To: Andrew Poelstra Cc: Weikeng Chen , Bitcoin Development Mailing List , Rusty Russell Subject: Re: [bitcoindev] Difficulty in emulating "weaker" OP_SUCCESS and why it should be a real opcode Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: X-Operating-System: Linux 6.6.36 x86_64 X-Original-Sender: freedom@reardencode.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@reardencode.com header.s=mail header.b=shrgmaX3; spf=pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) smtp.mailfrom=freedom@reardencode.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=reardencode.com Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.8 (/) Hey list, On 2024-12-09 (Mon) at 19:08:51 +0000, Andrew Poelstra wrote: > On Mon, Dec 09, 2024 at 05:27:54AM -0800, Weikeng Chen wrote: > > When I am implementing fraud proofs in Bitcoin script, I find it useful to > > have an opcode "OP_SUCCESS" that will mark the execution to be successful > > without running the rest of the script, if this opcode is being executed. > > This is useful for writing code for fraud proofs such as BitVM, where the > > verifier wins if it finds one mismatch, and the verifier does not need to > > show the other mismatches. > > > > This OP_SUCCESS is weaker version of the OP_SUCCESSx in the Taproot > > upgrade, which marks the execution as successful for the mere presence of > > OP_SUCCESSx anywhere in the script. Rusty Russell in a 2023 article, > > "Covenants: Examining ScriptPubkeys in Bitcoin Script", also mentioned > > about the usefulness of such an opcode. > > > > > > In short, for purpose of softforking upgrade mechanism, the existing > SUCCESS codes give us way more freedom of action. > > But it sounds like you want a "weak SUCCESS" opcode in order to use the > success semantics, not as an upgrade mechanism. Maybe it makes sense to > propose that one of the existing OP_SUCCESSx opcodes should be > softforked to become OP_WEAK_SUCCESS? An alternative that Rusty Russel has discussed wanting as part of his script restoration work is "OP_SEGMENT" which would split the script execution for purposes of SUCCESS checking, allowing (for example) a prefix to be required to execute before an arbitrary user provided script that might contain an OP_SUCCESS. It occurred to me today when thinking about Weikeng's post that we can slightly weaken the existing OP_SUCCESS behavior while retaining essentially all of its benefits in practice without introducing OP_SEGMENT by leveraging OP_CODESEPARATOR. Redefine OP_SUCCESS with a soft fork from "make the script unconditionally valid" to "make the script segment unconditionally valid", and define a script segment as "each lexicographic section of the script containing no OP_CODESEPARATOR". The script interpreter can perform SUCCESS checking as it currently does until it encounters an OP_CODESEPARATOR. Each OP_CODESEPARATOR gets a "SUCCESS" flag defaulted to false and SUCCESS checking now sets that flag to true on the most recently encountered OP_CODESEPARATOR. During script execution, whenever an OP_CODESEPARATOR is popped (not executed) its "SUCCESS" flag value is copied to the interpreter state. After this state setting conditional, if the interpreter "SUCCESS" flag is true, and fExec is true, the script immediately succeeds. For Weikeng's scripts, this would require 2 OP_CODESEPARATORS for each OP_SUCCESS (or some really weird logic about what's executed in what SUCCESS state). Thoughts on this approach? --Brandon -- You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/Z1dp0Jtbrkcf7Roi%40console.