public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: "'moonsettler' via Bitcoin Development Mailing List" <bitcoindev@googlegroups.com>
To: Brandon Black <freedom@reardencode•com>
Cc: Weikeng Chen <weikeng.chen@l2iterative•com>,
	Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Subject: Re: [bitcoindev] Multi-byte opcodes
Date: Tue, 19 Nov 2024 16:38:21 +0000	[thread overview]
Message-ID: <E95uz4uyQgikJKtximyueqFTRs7cTJfpcdVvkrYEkfZ__DTpvwlsm0MSsX8BaqKg6KnONx6eQ5VueijeMqWQ8uI4iFKA--irKATjN1K4Fbg=@protonmail.com> (raw)
In-Reply-To: <Zzt2OCE6Aj9H3DiY@console>

Hi All,

I think we should discuss back-porting tapscript instead of coming up with a further divergent set of opcodes.

To sum up earlier discussion with Brandon, we could:

* Use a single upgradeable NOP for OP_TAPSCRIPTVERIFY
* <s1> .. <sn> | <faux-control-block> <tapscript> CTAPV
* Isolated execution environment
* Gets the entire stack below the top 2 elements
* Fails if it fails, does nothing if internal script succeeds.
* Require the last opcode executed by the script interpreter to be a push opcode, fails otherwise

The faux control block can be just a few bytes mainly for tapscript version.

BR,
moonsettler

Sent with Proton Mail secure email.

On Monday, November 18th, 2024 at 6:15 PM, Brandon Black <freedom@reardencode•com> wrote:

> Hi Weikeng, thanks for your thoughts on this!
> 
> > We can, however, solve that by allowing multi-byte opcodes.
> > 
> > Say, for example, we can have:
> > OP_OP { 0x1521 }
> > which will set the current opcode to be the one with the assigned number
> > 0x1521.
> > 
> > Another idea is maybe OP_OP takes a stack element as the opcode.
> > { 0x1521 } OP_OP
> 
> 
> Another option that works for many cases is to have opcode families
> where an argument is augmented with flags to determine the behavior. We
> can consider this to already be the case for OP_CHECKSIG* where the
> signature determines the behavior of the hashing portion of the opcode.
> 
> This is also how OP_CHECKTEMPLATEVERIFY is designed, and how
> OP_CHECKSIGFROMSTACKVERIFY as currently spec'd in the PR is designed.
> CTV and CSFSV only constrain 32-byte first arguments, but not other
> lengths leaving open extensions using any other length, including using
> other lengths of either opcode as OP_OP, or as variants on CTV and CSFSV
> respectively.
> 
> The benefit of this approach is that it doesn't "waste" the length byte
> only to specify the opcode behavior, but enables it to do double duty as
> specifying the total length of the first argument including both flags
> and data.
> 
> Best,
> 
> --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/Zzt2OCE6Aj9H3DiY%40console.

-- 
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/E95uz4uyQgikJKtximyueqFTRs7cTJfpcdVvkrYEkfZ__DTpvwlsm0MSsX8BaqKg6KnONx6eQ5VueijeMqWQ8uI4iFKA--irKATjN1K4Fbg%3D%40protonmail.com.


  parent reply	other threads:[~2024-11-19 17:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16  0:45 Weikeng Chen
2024-11-18 15:10 ` [bitcoindev] " Garlo Nicon
2024-11-18 17:15 ` [bitcoindev] " Brandon Black
2024-11-18 18:54   ` Ethan Heilman
2024-11-19 16:38   ` 'moonsettler' via Bitcoin Development Mailing List [this message]
2024-11-19 19:35     ` 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='E95uz4uyQgikJKtximyueqFTRs7cTJfpcdVvkrYEkfZ__DTpvwlsm0MSsX8BaqKg6KnONx6eQ5VueijeMqWQ8uI4iFKA--irKATjN1K4Fbg=@protonmail.com' \
    --to=bitcoindev@googlegroups.com \
    --cc=freedom@reardencode$(echo .)com \
    --cc=moonsettler@protonmail$(echo .)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