Delivery-date: Mon, 17 Mar 2025 10:01:23 -0700 Received: from mail-qt1-f187.google.com ([209.85.160.187]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tuDq6-0001u4-Ds for bitcoindev@gnusha.org; Mon, 17 Mar 2025 10:01:23 -0700 Received: by mail-qt1-f187.google.com with SMTP id d75a77b69052e-47685de2945sf84270881cf.0 for ; Mon, 17 Mar 2025 10:01:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1742230876; cv=pass; d=google.com; s=arc-20240605; b=SVgtBP8HgdhIn+8442RYrZ8YP3FFsA9G8eaCwApDwdZTHhXdxqDXZSIKBksXrpBr/u CkwmoqUpbnpR3O/+tBYL8Aknob1l1R8OvK0VSDMdshG96fCYJ806ZCqZWoMpOjB6gvIn GTo8ILBZQUCwpDOUrHz/saI7on3rZz4f8OtR4kq9X4jFAjBvczZSd6r72Ga3KnJIj/5J VGd9uSNzvxSdPJ++aQtr36w/cgEO8+ssEElqqnbOxcm6bx3g2WEbCBiSx/JUc3kjrr5k 4BSRQqEQGLwzZarGru8Em/CbHZq2+SZOwuAO5pkWWb3uHbTYtu63Mmt6lm9eEo+ISE/X fMCw== 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:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:sender:dkim-signature; bh=I6mnXpySvj4UndC+e5Gr1lArIY7ZZB6rZdkSRr19S5I=; fh=fR6kPqHeLFMz+aB6/Lm2E9W7t4uKAzi6/1vLfi2NNTY=; b=G6MXKzrzM1FCdTpH9pJGS6QS4IyWKUPVQsS9ExOKLLIUC8drrqo/2U6nLDkjrqCb8l Y4eQA0HsF9ZPYkpQ3k5cV+sKWjPgvx5qyTlrn0tAFTFFp/eM+v85g03uYgx7MNQt/XsK 2Wk/Ox+Cx8MXEExnX5oPgsN4ZJ8bJ9vK+yHV5O9fXjE+IWZSTsb0+fqj45+BRnniz2Wo /AYBX7YlCv1RdjVB93HzWAWdOg4w2SMX2e2bmb/xE5QjW/7Mgb/JZRdhYvNu4TW1tOVF HYHKEZHmq8tA4250Ak5h6YZofqnQ+Fw5m9ltM54pBK7QcO7SwbamxYwL+RbqrcM5+Prs hflQ==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=af7JHlXE; spf=pass (google.com: domain of pete@petertodd.org designates 103.168.172.148 as permitted sender) smtp.mailfrom=pete@petertodd.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1742230876; x=1742835676; 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:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id:sender :from:to:cc:subject:date:message-id:reply-to; bh=I6mnXpySvj4UndC+e5Gr1lArIY7ZZB6rZdkSRr19S5I=; b=NFKlLTlNX5Jb2t3OBsmt1RZ6msO8M1vAo45OIXlhg1tQEDdGGod0U59jWU+Ssm+HOE q2BjdbuD/hdM8EcvhsFKcaQjjx/eGPUQL5zTsXOq+QUrS1hhzjN1gTPX83XRmIn94HrO nBSAXlocZ9xJZ3iHHsuIpnFUxzPTjqdrc4spcjHqH2RmIrX+q4ARKLhsy4OMAsoK8wIi t47GQ2vBH3jR3cCAKdl6IxVs13XAGH+RL1JlvEZrw/FCyUC/R9bly4Eb/c1ws+y2ldmV Iuecpuf24hcuI67LU6hFf19zwn4CVzqMl1r3Xq413ynXppH2lrbtHOsTyIXxkNmZLdbg c1rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742230876; x=1742835676; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=I6mnXpySvj4UndC+e5Gr1lArIY7ZZB6rZdkSRr19S5I=; b=Fkuj0QJSPY0IKAS6I4CuZ0ZDQnevCmzKR0bBx4FldFWJr6J1xJ1fxYQnAjbVeGGCOY sTV5ryq9zVfGKnTyleOKtJpxqgisD74ki8k7jwiPVkD+RKTCwC9HBBbJY3YjFKzCbbsr G0bEBhB9OIf4f/aeiRatdzpo2GihVZRIyovG+PV1mvZCZ6OKMRMbrTgmuCC0lECjlyOq M/9mRsC4fANcjz49sGR+ePqNZ4m/zLBFQ5wfaI3ALkSBGtX9QBJD/rnR3Dvhy5uS1Pjm XI8SK/sD5TqNxOIGubwRvjzNoYy9BVMIlkJ85fZO6v7Kh0Mo6fakVTjPbtCBLTVlpOIl Op5w== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWz3yWy1Lw56/hgb47YH+P0loxt7L9j7Y3I4FwRXn8pnJgElru/59Mazv33w6ifR4Vt+IAXXJRAH9uB@gnusha.org X-Gm-Message-State: AOJu0Ywo+WX763G0I4TN/up/wT8oSE98McQhh8D+sVcETqDZks64m8Dt ayqkGDTTmCqaWLYpkHvb8+hpr10QG2XcEC7Ab8CheSS3Op25XDWO X-Google-Smtp-Source: AGHT+IFFbqy/mcGWKUIRST6wBWBO8SKBFj52+50FaUd4RzjQlDUAqSk2EEyRvMzJwHstoilvaIdoUQ== X-Received: by 2002:ac8:5d89:0:b0:476:b3f0:a910 with SMTP id d75a77b69052e-476c8039477mr173054261cf.0.1742230876003; Mon, 17 Mar 2025 10:01:16 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com; h=ARLLPAIz8fl5qarY+FrjQHfsh6RlMqb+/UIHPx1i/B8ST83ePw== Received: by 2002:a05:622a:7706:b0:476:9c9c:1a5d with SMTP id d75a77b69052e-476b7e02b17ls11495781cf.2.-pod-prod-05-us; Mon, 17 Mar 2025 10:01:12 -0700 (PDT) X-Received: by 2002:a05:620a:318a:b0:7c5:4913:500a with SMTP id af79cd13be357-7c57c79be6dmr1482692485a.19.1742230872843; Mon, 17 Mar 2025 10:01:12 -0700 (PDT) Received: by 2002:a05:620a:530e:b0:7c5:495f:5415 with SMTP id af79cd13be357-7c57bd9074bms85a; Mon, 17 Mar 2025 09:54:22 -0700 (PDT) X-Received: by 2002:a05:620a:2992:b0:7c5:7a04:ef04 with SMTP id af79cd13be357-7c57c7d7ffdmr1962224285a.30.1742230461353; Mon, 17 Mar 2025 09:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742230461; cv=none; d=google.com; s=arc-20240605; b=NDmY/sP5B8gP1pTrZl5qnjFOr1lMQ0NLG2/Uf01AISdfvRcd/pUn4rVD1gQuo05xaI wESVsvU+ScCK2x34z8ci24IysipA/GSVIHYOK58Nxm0jyLW3gEd2u+Kzc2PYOYKL0HPQ jxzpxAicDsCwxKYqm7/19MhWTDpxtHuu+IUsKjgX26FKAdFeHeW9orRN1SlT0q2h+PQK DKC7MjycMTT0mndx/G4I5ujdFcaksnPhHQRdmA5TLCUH08xLXF+3VqMgwjhvvQe5dkak yRjiFLTuas98BCH46o4dTDFpvnFT2C3l1LbcLR2xmDQ+w3Q+QlUnWlkdGvvWShZWFdnf OlWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:dkim-signature; bh=QR4kyMyBLIiGhKK84ogRCmirpx0PHHiwjNZuuFXOBNw=; fh=ZezIQ4DPobkbkSLZGiZg2aqbrl+dlXwRCknPDPYULyQ=; b=KktpIfbMNhM0I0TyUXjXpuFBzSMipCmRFOY/6bO0jZEmU7rFQeUQq2NglSotoUZE/L uukfzh7zACpeh4/VZGxL+lluF8BNANFzf+MaiwrO/2p3Wx/IhMQAzD9TofAYmzbobBuQ Ac9qutgHzKawVqXa1RLNUBl8/SVa/Uhs0qkOqK02YBnpiESN9zz0KGgmZuRHw41zd2nF R+FTWmYoRHRpTc5EQXvukXIRkuuCZN8jf9FTWL0Qn0OYCh6mZPNot7YQIBQhxLQ0UpUT oybLzvVrx/0rGN3yGtgPlulBC04FthwuOzzB0d+gBvyG+lwrE4fD0TGogwCD5voQKKo+ cJsQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=af7JHlXE; spf=pass (google.com: domain of pete@petertodd.org designates 103.168.172.148 as permitted sender) smtp.mailfrom=pete@petertodd.org Received: from fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com. [103.168.172.148]) by gmr-mx.google.com with ESMTPS id af79cd13be357-7c573b58f63si40783385a.1.2025.03.17.09.54.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Mar 2025 09:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of pete@petertodd.org designates 103.168.172.148 as permitted sender) client-ip=103.168.172.148; Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 12DD813833C2; Mon, 17 Mar 2025 12:54:21 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Mon, 17 Mar 2025 12:54:21 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugedttdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomheprfgvthgvrhcuvfhougguuceophgvthgvsehpvghtvghrthhouggurd horhhgqeenucggtffrrghtthgvrhhnpeelvdellefftddukeduffejgfefjeeuheeileef tdfgteduteeggeevueethfejtdenucffohhmrghinhepphgvthgvrhhtohguugdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvght vgesphgvthgvrhhtohguugdrohhrghdpnhgspghrtghpthhtohepvddpmhhouggvpehsmh htphhouhhtpdhrtghpthhtohepsghithgtohhinhguvghvsehgohhoghhlvghgrhhouhhp shdrtghomhdprhgtphhtthhopeifvghitghhuhguvghnghesshhtuhdvtddvgedrjhhnuh drvgguuhdrtghn X-ME-Proxy: Feedback-ID: i525146e8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 17 Mar 2025 12:54:20 -0400 (EDT) Received: by localhost (Postfix, from userid 1000) id 9C8629FCCB; Mon, 17 Mar 2025 16:54:19 +0000 (UTC) Date: Mon, 17 Mar 2025 16:54:19 +0000 From: Peter Todd To: weichu deng 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: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DskUQjcAFGsQIBbh" Content-Disposition: inline In-Reply-To: X-Original-Sender: pete@petertodd.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=af7JHlXE; spf=pass (google.com: domain of pete@petertodd.org designates 103.168.172.148 as permitted sender) smtp.mailfrom=pete@petertodd.org 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.8 (/) --DskUQjcAFGsQIBbh Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline On Mon, Mar 17, 2025 at 09:14:05AM -0700, weichu deng wrote: > > > Dear fellow Bitcoin developers, > > > > I am pleased to present a new BIP proposal. This proposal introduces a new > opcode for Bitcoin scripts: OP_ISSUBSTR. > > > *Abstract* > > This BIP introduces two string opcodes, OP_ISSUBSTR and OP_ISSUBSTRVERIFY > (similar to the relationship between OP_EQUAL and OP_EQUALVERIFY), to > determine whether one string is a substring of another. As these opcodes do > not alter any blockchain state, they are secure. Bitcoin scripts are about validation. Not computation. This means that substring search and concatenation are equivalent. For every script that validates a substring search, you can instead concatenate the substring with the rest of the string, and validate equality instead. Basically speaking: foobar foo IsSubStr is equivalent to: foobar foo bar Cat Equal A real-world example would be more complex. But I hope that illustrates my point sufficiently. -- https://petertodd.org 'peter'[:-1]@petertodd.org -- 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/Z9hTu2TjMlLr5-Eg%40petertodd.org. --DskUQjcAFGsQIBbh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE0RcYcKRzsEwFZ3N5Lly11TVRLzcFAmfYU7kACgkQLly11TVR LzdpuhAAgCyg/6AltuHu1D63xsn9ZVLUcwkYRSU2JFc/KJyB+9QOOFwESQ6tE9C5 1HUA5QRvL9+QVGtLzecI360LTpQCF+vB3cE5GQI/taEGgZyQGn8mHLlzOgqY/qDX RRRc5mFFKV4/Y8d7/CHRYe5HiyDmMyvSgfgO5DN4LlZBqSs9BtVL01OmHdf3k2fO tyuic8FIVk9Ay7AOOulgG1ovS6iq+9SbjXjB4Lahg+xUHVM/3T7wF+fkJJ33In2V jgbnIbTU7TFUgfW6Nm58wHl/bFwIsq5TbMj/BrkCfpVwfr1K0krzEk7XksUZ5Yt6 4J1k85lWdvb0ooTPdXL60tplxKtPAxFteJjSGZS68srGAiVi0Z+TpedHIUrZx/0v hQwYONkxTcHj+ig8jJEAyasyRU3NS7IAXxc60c7jsv3HOf7EfzL+cqgje/iaUfY4 kor7tuWU5IIJQ+X/h4qyXysuVsGYHchfxDbqs1JPdJYO1hFdl99FLebPcocXauYW UNMtDJkIc0jT0MaGRbKYQrjy06jSjhe5YJ5//zTX0mEMyBYSMMQ0OIlAyq+4/k+n S95hJ9czV8I5E2E0QR98gBALYIQKzbEEyPocnkXp2GrWjeKNkXuJmjGxrUV77SwN ONl354nARDVuyGNhcGW0cSSznZX2RNpjJwUD/CElOW6tZ22Jimc= =aPwk -----END PGP SIGNATURE----- --DskUQjcAFGsQIBbh--