Delivery-date: Tue, 01 Apr 2025 07:49:13 -0700 Received: from mail-qv1-f61.google.com ([209.85.219.61]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tzcvR-0002R8-5M for bitcoindev@gnusha.org; Tue, 01 Apr 2025 07:49:13 -0700 Received: by mail-qv1-f61.google.com with SMTP id 6a1803df08f44-6e8ffb630ffsf82359306d6.1 for ; Tue, 01 Apr 2025 07:49:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1743518947; cv=pass; d=google.com; s=arc-20240605; b=lxB/HXqOAJgWl9JlXiDxfHcosMea//mWxS7xh5KOq8kBRa9VkHikqbce+Iz7X0FEcN 54Ol5SVMwAhaVgBrstA/Udj+J6PavAI4sr7tCwY3ioBNPwlarzXpUo9pEZ/fPUmgWxQn 6cQzGqaXJ8MjHnwKRLoIWlLiwVwjnRB5cGdDBc0qc//jp3bCiBrt0Eev84UmdSkiNCmO Z6JTNli4HCLwUIoAJ833jiGfbFLyXzPX8Rzs9Ekx+W6sbHqRYiNe/ULuOkGDIAbOKqeC NW5m2jrEcdmEqLNdn9zujZHhA+OfNg+aagbm69tgUfVCo+1+6Ciqzy/rtSOhzpMeB8PD /C1A== 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:mime-version:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:sender :dkim-signature; bh=SwoJF3TsplQ4ggDCj6oR7h9FdLyCOZLqJyAHCHEv/G4=; fh=CsOl21VMU+fEmQ2OgAVy/QDkjDjOqfLhUbUn49cC6qA=; b=j/6a+GmQZKzczjGAlLkA29BNZEYV8Lmmb+7V73s7ad86CJR7ce/zWncjKFhbTBaFgG RGPmwL3vWFPusFkVeDOpxnPp8UdBupz6uiO1j+WxXy3mLT2d8MmM0k/yLYn71xk0jH+2 vW+YW9ANZuLeYsERIyMYWZFnQClxIg8NNpgjGu+NWnoYeqMw3qIdAA/vSEkSrVIO7aQ2 qGK7NnnQ7v3LXZHt1q1NBGv+OBnULVpYA0aNJ8TSZZdghtz4+EMos9JlHrd1wWylDSHB sUkoGAOoGIfs5u70MJjWq2lAmuvObTVTMbIOLwQQtrK9QXW95xiCKQcnR0JzGHe+JZfr Li/g==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@wuille.net header.s=protonmail2 header.b=IEzcE5dw; spf=pass (google.com: domain of bitcoin-dev@wuille.net designates 109.224.244.21 as permitted sender) smtp.mailfrom=bitcoin-dev@wuille.net; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wuille.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1743518947; x=1744123747; 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:mime-version:feedback-id:references:in-reply-to :message-id:subject:cc:from:to:date:sender:from:to:cc:subject:date :message-id:reply-to; bh=SwoJF3TsplQ4ggDCj6oR7h9FdLyCOZLqJyAHCHEv/G4=; b=VJBYWjj7i4gcKOir732TivO1f7dCrJjVaUT3INXYsA65A1NnyD+S/FWxXwOoZW0+zM 75ofX9uUvLz+ocy8vTlrhkM4EIdBl1XvYizL64M33btxUXae5f0wSXsA/YjQFOIb76GQ UzEub6U+twUqoFxYihzd8o7P38XyvsMp9ymd0I/sBnLKaDvEX6sxykEgIP+EHwGQ9aMw 2H3iynMRlUH9WQs5l/rY7rCzF8J0Gn6gBKLj6RkjH3RTv4Gk7WmJJEBcZE+bfXwPw30N Fst6gRUh9BUtvlajv+Q1Dl6nUUik9xPXL05Sm2fSVT8+F80dOOljbGuqzL8+2okQMzwC 9Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743518947; x=1744123747; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:feedback-id:references:in-reply-to :message-id:subject:cc:from:to:date:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=SwoJF3TsplQ4ggDCj6oR7h9FdLyCOZLqJyAHCHEv/G4=; b=Ektd5twA4Bnh7y3QBXIMGtQMihK2lgAZUrjKkE3a1A9WkJ3VKw49kX5O0PEFPwQWWE vOdUhN6sP1fI4Bo/6o+XPbL9ztaQI1mx/rXzh9DnxUWA6DJ/Jm2aEIzXkAeaAkYE33Sb sn+e2OH1J5QpgHhHQUhNLVIUat9jY2AbjHo9IULtgqXdrLwzusPS97lu2AHaob1Z3BjK SrIaF9GMZG1Jh/JSV7INsa3tv2bSAZFG1CRC2ekTAAqgzymq7mIR6br6xIpyIMWKLHzk e8+XyjPBNjj0i5wphVpnaNdJtxXvsK28af5mcFQ35Vbh5wbhtVB0OMuHg53g7yZxX3YT lcxA== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUj9RX4XLQvGq20F6jpJT+R+pRPxkKFGXIi2yPP/H4d6/ljX/9JVOAmyhLfucHV/f7VzGVtHZ3YKC9/@gnusha.org X-Gm-Message-State: AOJu0YwZi7zuP8Dk13xcpz0qBnQiKxf9h5U0El+b7t6C4Mq8yNIieIxs xVl4UriNjR5FEdIvsePBLgYxHO1AnBZtrrzYq6vuo5YLN8EiMqpp X-Google-Smtp-Source: AGHT+IEgbAM+wVtNXSzAwEx2sxHlgEg22Sk91vKomWNzVroEuyIV7MqOF3DkGMiMFVu6KXfNYeZEcQ== X-Received: by 2002:a05:6214:ca2:b0:6e8:fad9:c688 with SMTP id 6a1803df08f44-6eed5fe34eamr263242546d6.16.1743518946998; Tue, 01 Apr 2025 07:49:06 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com; h=ARLLPAKNS0tDsdpkPmAs/L6OL2dxoq/cNCZHooVG/jt6XPCerg== Received: by 2002:a0c:aa52:0:b0:6e8:f69b:bae9 with SMTP id 6a1803df08f44-6ed22f9970fls5970096d6.0.-pod-prod-03-us; Tue, 01 Apr 2025 07:49:03 -0700 (PDT) X-Received: by 2002:a05:6214:19c4:b0:6e4:4484:f35b with SMTP id 6a1803df08f44-6eed61f7c75mr198824766d6.30.1743518943100; Tue, 01 Apr 2025 07:49:03 -0700 (PDT) Received: by 2002:a05:620a:d8d:b0:7c5:3b15:3956 with SMTP id af79cd13be357-7c75bf0e5d5ms85a; Tue, 1 Apr 2025 05:25:34 -0700 (PDT) X-Received: by 2002:ac8:7d85:0:b0:476:b783:c94d with SMTP id d75a77b69052e-477f7aeae5dmr197902371cf.35.1743510333153; Tue, 01 Apr 2025 05:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743510333; cv=none; d=google.com; s=arc-20240605; b=ZsRYd3zRknuYyEDqYCT0YrBnaONVmsZ9+JtQV7fjEtrlE4kI5BqMuD8FSEhOl/VnGa AFxcSxtt4nzLsCCSJahWn71atNfKjwKQPAshnTT9UM/KuA0ej8c1ok/9FOOD/pwkmtlE qWCJ0iPa5NPRQFtqIK/jithKweXn4OEXAGqc2B2mthULQq2eyy2PNa6LmYiXvWAbA/hk k8WBZ8UwWtgD0CPE/7h2g9MyOsJTAB0alLUhpFINRGVE85UqhZTILEhZwtyxEQ+KG3R7 TqJABrJgDpKWeRX1iXQ951k6zv4FCNt9FCM0a5WywSpmoC5T30gyQfvCmZs7nQeD1eQy aCWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=mime-version:feedback-id:references:in-reply-to:message-id:subject :cc:from:to:date:dkim-signature; bh=rzKu9pe3ugS5feTxMbB67a+t+dpa+60y90AQAkelV4Q=; fh=GeJIUmU5jL7J6QstWKEKlkHrfJpGokhJFVi/d43gVbE=; b=IjnK+Wh6ASa+2oedrH5aBRhIA+9Kl4XsBZWbWBHLZ1gxGCkXv3owbk1a5ElIxh7OkK 18Jy/wOABycrQKFFjudai5bA/YdYzqU/jkR0Zd8DaceivFmAEKMc9XGFMiQy0f4DENoy hkR9v12xYgt2lDgjMj/mG/fegU98a/vU7Qdsvqu9Psa/tOERMsTNNryyoHDJz6WqvMVI EvZ+Y0YhBNbaWabNc+7sOyvzSeC9UnvyBFl6F/34VYWsdG9EX0x4SjGIUUXsmbb6Zcuj FxP65tL17oq1C9BcO8BpVLEUBVXOoYimvpvmjYIBrjNxM2pD+xhk1zs87O+18iBZbcjP Zjvg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@wuille.net header.s=protonmail2 header.b=IEzcE5dw; spf=pass (google.com: domain of bitcoin-dev@wuille.net designates 109.224.244.21 as permitted sender) smtp.mailfrom=bitcoin-dev@wuille.net; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wuille.net Received: from mail-24421.protonmail.ch (mail-24421.protonmail.ch. [109.224.244.21]) by gmr-mx.google.com with ESMTPS id d75a77b69052e-47782a3dc20si3801801cf.2.2025.04.01.05.25.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 05:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of bitcoin-dev@wuille.net designates 109.224.244.21 as permitted sender) client-ip=109.224.244.21; Date: Tue, 01 Apr 2025 12:25:26 +0000 To: Javier Mateos From: Pieter Wuille Cc: Bitcoin Development Mailing List Subject: =?UTF-8?Q?Re=3A_=5Bbitcoindev=5D_New_Proposal=EF=BC=9AString_Substring_Sea?= =?UTF-8?Q?rch_in_Bitcoin_Script_=2D_OP=5FISSUBSTR?= Message-ID: In-Reply-To: References: <678d40e3-3e22-4d55-82c0-b25ccafb87ecn@googlegroups.com> <8c823e50-197e-479c-8651-9e0407a4168en@googlegroups.com> Feedback-ID: 19463299:user:proton X-Pm-Message-ID: b68664d6719d048b23578912094285d0d0a5bd96 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1=_S7ptwJtszq2WrJr68GQIo1ppERhW8I5AYWxFbJ7PeM" X-Original-Sender: bitcoin-dev@wuille.net X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@wuille.net header.s=protonmail2 header.b=IEzcE5dw; spf=pass (google.com: domain of bitcoin-dev@wuille.net designates 109.224.244.21 as permitted sender) smtp.mailfrom=bitcoin-dev@wuille.net; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wuille.net 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.7 (/) --b1=_S7ptwJtszq2WrJr68GQIo1ppERhW8I5AYWxFbJ7PeM Content-Type: text/plain; charset="UTF-8" On Monday, March 31st, 2025 at 4:41 PM, Javier Mateos 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. --b1=_S7ptwJtszq2WrJr68GQIo1ppERhW8I5AYWxFbJ7PeM Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Monday, March 31st, 2025 at 4:41 PM, Javier Mateos <javierpma= teos@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=20 position already, so the script can always be modified to instead take=20 that position as an additional input.

This is a general principle: the point of scripts is verifying provided=20 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=20 multiplication opcode.

--
Pieter

--
You received this message because you are subscribed to the Google Groups &= quot;Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitcoind= ev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/frERr= HlzWhpskJw74fBQorSrXEaBP1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7= Ownbsa0KZ26ihfJjri6R01kuozA%3D%40wuille.net.
--b1=_S7ptwJtszq2WrJr68GQIo1ppERhW8I5AYWxFbJ7PeM--