From: Garlo Nicon <garlonicon@gmail•com>
To: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Subject: [bitcoindev] Re: Multi-byte opcodes
Date: Mon, 18 Nov 2024 07:10:16 -0800 (PST) [thread overview]
Message-ID: <3b2707fe-0ddd-4c1a-8167-fccef47a9d2en@googlegroups.com> (raw)
In-Reply-To: <4235f7d2-8e09-428a-813d-9034cb21f48an@googlegroups.com>
[-- Attachment #1.1: Type: text/plain, Size: 2872 bytes --]
> I think we need a way to allow more opcodes without taking up the rest of
the NOPs.
It is already possible since Taproot. For example: OP_CHECKSIGADD was
added, without replacing any OP_NOP.
> I feel that someone must have brought this up before (but it is a little
bit hard to find the history in this mailing list at this moment).
Satoshi added OP_SINGLEBYTE_END, set to 0xf0, and OP_DOUBLEBYTE_BEGIN, set
to 0xf000. It was removed later, but it can be reintroduced in a similar
way, if needed. See source code for version 0.1.0 for more details.
sobota, 16 listopada 2024 o 03:00:53 UTC+1 Weikeng Chen napisał(a):
> I think we need a way to allow more opcodes without taking up the rest of
> the NOPs.
>
> This is related to a point from Murch (
> https://groups.google.com/g/bitcoindev/c/usHmnXDuJQc/m/hhtvAjSdCgAJ) that
> the reasoning of "its' compatible, why not" for adding
> CHECKSIGFROMSTACK(VERIFY/ADD) is not solid because when we add a new
> opcode, we usually have to give up a NOP. We do not have many NOPs left.
>
> 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
>
> We can enforce some sort of minimal rule, or not do so, to allow more
> flexible use of existing opcodes.
>
> This, of course, runs at a cost as this opcode needs three bytes in total
> to represent, but since the existing opcodes already take care of most of
> the basic functionalities that we expect users to use very frequently, the
> new opcodes that we want to add are likely those that complete something
> important and are going to be used only a few times in a script.
>
> Similarly, we can require that multi-byte opcodes that have not been
> enabled my result in OP_SUCCESS.
>
> OP_OP is not the best name as it could be confusing. OP_SETOP, OP_NEXT,
> etc could be taken into consideration.
>
> The result of this is that we can worry less about whether it is worthy of
> a NOP to do an opcode, but focus on if the opcode has enough use cases to
> support it.
>
> I feel that someone must have brought this up before (but it is a little
> bit hard to find the history in this mailing list at this moment).
>
> What do people think?
>
> Thanks,
> Weikeng
>
--
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/3b2707fe-0ddd-4c1a-8167-fccef47a9d2en%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 3894 bytes --]
next prev parent reply other threads:[~2024-11-18 18:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-16 0:45 [bitcoindev] " Weikeng Chen
2024-11-18 15:10 ` Garlo Nicon [this message]
2024-11-18 17:15 ` Brandon Black
2024-11-18 18:54 ` Ethan Heilman
2024-11-19 16:38 ` 'moonsettler' via Bitcoin Development Mailing List
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=3b2707fe-0ddd-4c1a-8167-fccef47a9d2en@googlegroups.com \
--to=garlonicon@gmail$(echo .)com \
--cc=bitcoindev@googlegroups.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