public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Andrew Poelstra <apoelstra@wpsoftware•net>
To: Weikeng Chen <weikeng.chen@l2iterative•com>
Cc: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Subject: Re: [bitcoindev] Difficulty in emulating "weaker" OP_SUCCESS and why it should be a real opcode
Date: Mon, 9 Dec 2024 19:08:51 +0000	[thread overview]
Message-ID: <Z1dAQ8pSIqn8XA56@camus> (raw)
In-Reply-To: <ebd77d82-96ab-4530-909a-d085378b9868n@googlegroups.com>

[-- Attachment #1: Type: text/plain, Size: 2223 bytes --]

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. 
> 
> Of course, this opcode can be emulated, and one can rewrite the existing 
> script in a way to realize the same functionality without adding a new 
> opcode to Bitcoin.
> 
> The problem is that such rewriting is indeed fairly complicated. For 
> example, say that we have the following program.
>
> <snip>

I raised the question on IRC about why the existing SUCCESSx codes work
the way they do, and got several good anwsers that you can read here

https://gnusha.org/bitcoin-wizards/2024-12-09.log

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?

-- 
Andrew Poelstra
Director, Blockstream Research
Email: apoelstra at wpsoftware.net
Web:   https://www.wpsoftware.net/andrew

The sun is always shining in space
    -Justin Lewis-Webster

-- 
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/Z1dAQ8pSIqn8XA56%40camus.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-12-09 19:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 13:27 Weikeng Chen
2024-12-09 19:08 ` Andrew Poelstra [this message]
2024-12-09 22:06   ` Brandon Black
     [not found]     ` <87ttbccrql.fsf@rustcorp.com.au>
2024-12-12  3:17       ` Weikeng Chen
2024-12-12  5:49       ` Brandon Black

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1dAQ8pSIqn8XA56@camus \
    --to=apoelstra@wpsoftware$(echo .)net \
    --cc=bitcoindev@googlegroups.com \
    --cc=weikeng.chen@l2iterative$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox