public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Pieter Wuille <bitcoin-dev@wuille.net>
To: Javier Mateos <javierpmateos@gmail.com>
Cc: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Subject: Re: [bitcoindev] New Proposal:String Substring Search in Bitcoin Script - OP_ISSUBSTR
Date: Tue, 01 Apr 2025 12:25:26 +0000	[thread overview]
Message-ID: <frERrHlzWhpskJw74fBQorSrXEaBP1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01kuozA=@wuille.net> (raw)
In-Reply-To: <e8c30db7-b509-4fbd-93ef-0bca0313003cn@googlegroups.com>

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

On Monday, March 31st, 2025 at 4:41 PM, Javier Mateos <javierpmateos@gmail.com> wrote:

> The solution of splitting the string and using OP_CAT only works if the exact position of the substring is known. How would a case be handled where the substring could be in any position

Whoever produces the signature/witness for spending the coin always knows the position already, so the script can always be modified to instead take that position as an additional input.

This is a general principle: the point of scripts is verifying provided information, not computing it. As another example, this means that there is no need for a division or square root opcode if one has a multiplication opcode.

--
Pieter

-- 
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/frERrHlzWhpskJw74fBQorSrXEaBP1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01kuozA%3D%40wuille.net.

[-- Attachment #2: Type: text/html, Size: 1770 bytes --]

  reply	other threads:[~2025-04-01 14:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 16:14 [bitcoindev] New Proposal:String Substring Search in Bitcoin Script - OP_ISSUBSTR weichu deng
2025-03-17 16:54 ` Peter Todd
2025-03-18 15:32   ` weichu deng
2025-03-18 21:33     ` Rijndael
2025-03-19  9:07       ` weichu deng
2025-03-20  0:23         ` Vojtěch Strnad
2025-03-28 22:40           ` Javier Mateos
2025-04-01 12:25             ` Pieter Wuille [this message]
2025-04-01 15:35               ` Martin Habovštiak
2025-03-18 16:41   ` Erik Aronesty

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='frERrHlzWhpskJw74fBQorSrXEaBP1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01kuozA=@wuille.net' \
    --to=bitcoin-dev@wuille.net \
    --cc=bitcoindev@googlegroups.com \
    --cc=javierpmateos@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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