summaryrefslogtreecommitdiff
path: root/b7/43ef89358fe84dd7194c479918ba33598b849a
blob: f1978dc4e89a2db34539b18df5ca362287313398 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
Delivery-date: Sun, 16 Feb 2025 03:59:04 -0800
Received: from mail-yb1-f184.google.com ([209.85.219.184])
	by mail.fairlystable.org with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
	(Exim 4.94.2)
	(envelope-from <bitcoindev+bncBC3PT7FYWAMRB7FFY66QMGQED4234CQ@googlegroups.com>)
	id 1tjdId-0006im-FW
	for bitcoindev@gnusha.org; Sun, 16 Feb 2025 03:59:04 -0800
Received: by mail-yb1-f184.google.com with SMTP id 3f1490d57ef6-e54da6701d2sf5128801276.0
        for <bitcoindev@gnusha.org>; Sun, 16 Feb 2025 03:59:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlegroups.com; s=20230601; t=1739707136; x=1740311936; darn=gnusha.org;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:x-original-sender:mime-version
         :subject:references:in-reply-to:message-id:to:from:date:sender:from
         :to:cc:subject:date:message-id:reply-to;
        bh=EHdMKxUqntkM6rssIOcoMxJR87HKOGXzykRXBy1Wy6c=;
        b=FFCEUkFzo+ogLmNyZVWke92Uq18c4uVlvgy4FE5lx/S976MzZHliSGI9QvuX/JJngq
         grBd7WtnjGYLKPxW0eVgcTebVK3AXM7Hy1G8UITITAHyVpaFb9/xsMM3TXXxaIG2tCgr
         VF/HuLMkrS0Va/JwUsvuYgMRWKd659vYOJ/yvZiTcK7c0WilyUinBqr1M1wrbRQw4GTS
         XfThYi1nsGrWaKWKnbqRTjCFXBbjy+crBlA/evcpJKfYZRwY9jsMg69UTmBH0Tbw7p/+
         mJP2X2iw71MAY+oG8ZtmTZ4NViXvKNaoNxkFkpMhH+hoQHnkO6zYgZs/Mq4uPu/L0+8p
         sp3g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1739707136; x=1740311936; darn=gnusha.org;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:x-original-sender:mime-version
         :subject:references:in-reply-to:message-id:to:from:date:from:to:cc
         :subject:date:message-id:reply-to;
        bh=EHdMKxUqntkM6rssIOcoMxJR87HKOGXzykRXBy1Wy6c=;
        b=O1+LK+1BhWaT7FeUEeYPpzgFOS6+ons27ykP0cGYTjhd7iQDJQJePKfQeKzDWos32p
         lxKcBMauxzgRipQVCNlZES8/UAeYKutVv6elMWvAUg0xFnlFMLNMAKiT74+ISJau4jod
         znj34+KN+tWPP9ZElImelLaxBTqqsGsCtCsCX+GKluL4CHv4YcyvY8L5yNQFIfckfrnV
         +sNDCzuobH4/UoOaCQbjp6Hr+oZQhkO5n32iljtHkZDzXPOnyW+4CHSXa3y/mTnXzx6p
         spzngT3wmODKUhzrSGojo795jHe/JaUou1bkKyhuGk+Zx9Yg7TrR/JdgdY/BeXeaFgHx
         AKgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1739707136; x=1740311936;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:x-original-sender:mime-version
         :subject:references:in-reply-to:message-id:to:from:date:x-beenthere
         :x-gm-message-state:sender:from:to:cc:subject:date:message-id
         :reply-to;
        bh=EHdMKxUqntkM6rssIOcoMxJR87HKOGXzykRXBy1Wy6c=;
        b=IJexXSo5OEink21U7MhDnNWvn5zS/+ij0KNBvMT70/kPjAPF82N90k5/cpQ34Tpcnu
         XvIKCQ2PU1DLtTTneqAv46jCwwrhZRoP6vmKvMHE1UjT8QsdEPBQjVwxcWSRidQ04o2c
         vG3YVpmzuDQ5jb14heBvLyhLRfGMs3BdSMzygZLiiHfTx/Tv0EHZF81wYkvkKc3Sb7G/
         iSOvW11g/kLGDqlKCq36PPK2Ga2KZw6hnXEd5/g9J8X0s3Iu4SCb/g1h0cOxsaRQfqgx
         6vS/HytJtFEBKgXERuts4rzV9y+D14xORtqWYY99Aqd3j+VhxkZvRPtvLW8j9GDS0OiS
         4CKA==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=1; AJvYcCXaiy+3lhMJufQ6+VOHa/HOad17apRsSOD8MXbeOThm3DShgOHGuxk3U5ufkM2vySiRsBvDiO2HfZbl@gnusha.org
X-Gm-Message-State: AOJu0YwetDJCd2YSw19PefhSvR8zgsuILBxo5xuNayswUt3RmwqMUtxy
	MxN5w8C+gW/Da6G0qr4XIcwuW3iQlCUnDsoEAuI9I4Y0hjYS5+C+
X-Google-Smtp-Source: AGHT+IEoEaCZ5C9iBX1klDX3ExFDv8Hxxheuhb58SVoaJxZ3a/dCETif/z9+0jzyaeGZO/B1+E35Eg==
X-Received: by 2002:a05:6902:220f:b0:e57:8991:be4b with SMTP id 3f1490d57ef6-e5dc91ebcccmr3951059276.35.1739707136410;
        Sun, 16 Feb 2025 03:58:56 -0800 (PST)
X-BeenThere: bitcoindev@googlegroups.com; h=Adn5yVFl6pDr8vrmrGdH6JGDBSdZewb4LwKIfXdIztwu+zZhDw==
Received: by 2002:a25:d852:0:b0:e58:562:680 with SMTP id 3f1490d57ef6-e5da7920908ls535352276.0.-pod-prod-08-us;
 Sun, 16 Feb 2025 03:58:52 -0800 (PST)
X-Received: by 2002:a05:690c:4c10:b0:6ef:820c:a752 with SMTP id 00721157ae682-6fb582b8af8mr52027527b3.20.1739707132453;
        Sun, 16 Feb 2025 03:58:52 -0800 (PST)
Received: by 2002:a05:690c:4786:b0:6fb:3e32:1a09 with SMTP id 00721157ae682-6fb44927275ms7b3;
        Sat, 15 Feb 2025 13:13:26 -0800 (PST)
X-Received: by 2002:a05:690c:25c5:b0:6ef:4a1f:36d6 with SMTP id 00721157ae682-6fb5831d609mr37671797b3.23.1739654005503;
        Sat, 15 Feb 2025 13:13:25 -0800 (PST)
Date: Sat, 15 Feb 2025 13:13:24 -0800 (PST)
From: Antoine Riard <antoine.riard@gmail.com>
To: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Message-Id: <97c36a7a-fe4d-4e24-8bbb-a55b7284fe71n@googlegroups.com>
In-Reply-To: <Z6-AD12xTqxCxjqf@petertodd.org>
References: <jiyMlvTX8BnG71f75SqChQZxyhZDQ65kldcugeIDJVJsvK4hadCO3GT46xFc7_cUlWdmOCG0B_WIz0HAO5ZugqYTuX5qxnNLRBn3MopuATI=@protonmail.com>
 <ff82fe21-8e02-42df-8760-c3e358a12766@murch.one>
 <53c78eb9-2050-46d5-a688-be82846135a4n@googlegroups.com>
 <Z6-AD12xTqxCxjqf@petertodd.org>
Subject: Re: [bitcoindev] Update on the Great Consensus Cleanup Revival
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_89316_1223663156.1739654004942"
X-Original-Sender: antoine.riard@gmail.com
Precedence: list
Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com
List-ID: <bitcoindev.googlegroups.com>
X-Google-Group-Id: 786775582512
List-Post: <https://groups.google.com/group/bitcoindev/post>, <mailto:bitcoindev@googlegroups.com>
List-Help: <https://groups.google.com/support/>, <mailto:bitcoindev+help@googlegroups.com>
List-Archive: <https://groups.google.com/group/bitcoindev
List-Subscribe: <https://groups.google.com/group/bitcoindev/subscribe>, <mailto:bitcoindev+subscribe@googlegroups.com>
List-Unsubscribe: <mailto:googlegroups-manage+786775582512+unsubscribe@googlegroups.com>,
 <https://groups.google.com/group/bitcoindev/subscribe>
X-Spam-Score: -0.5 (/)

------=_Part_89316_1223663156.1739654004942
Content-Type: multipart/alternative; 
	boundary="----=_Part_89317_867889912.1739654004942"

------=_Part_89317_867889912.1739654004942
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Peter,

I'm talking about this check in VerifyScript as of commit 43e71f74 in=20
bitcoin core.

```
    if ((flags & SCRIPT_VERIFY_SIGPUSHONLY) !=3D 0 &&=20
!scriptSig.IsPushOnly()) {
        return set_error(serror, SCRIPT_ERR_SIG_PUSHONLY);
    }
```

In my understanding, we never set SCRIPT_VERIFY_SIGPUSHONLY, neither in=20
MANDATORY_SCRIPT_VERIFY_FLAGS,
nor in STANDARD_SCRIPT_VERIFY_FLAGS, and this sounds okay as it's a script=
=20
check pertaining to BIP62
rule 2, and BIP62 was never activated. As far as I can tell, that's more a=
=20
stale check just right=20
there in the interpreter code paths.

We still return SCRIPT_ERR_SIG_PUSHONLY for P2SH spends, verifying the=20
scriptSig is push-only.

All the unit tests (i.e `script_tests.cpp`) are manually setting the=20
SCRIPT_VERIFY_SIGPUSHONLY flag
to verify the logic correctness, even it appears as never being set for=20
block validation.

The original PR is there: https://github.com/bitcoin/bitcoin/pull/5065

Feel free to point me out if I'm missing something obvious here.

Best,
Antoine
OTS hash: 42e2e614fea49ec876539e28b323718df3ef734b3a4b247fcc649f0704ea1b61
Le vendredi 14 f=C3=A9vrier 2025 =C3=A0 17:45:54 UTC, Peter Todd a =C3=A9cr=
it :

> On Fri, Feb 07, 2025 at 05:02:46AM -0800, Antoine Riard wrote:
> > This might be a stylistic note, though I could point in bitcoin core=20
> code=20
> > today implemented
> > check in the script interpreter right in the crux of consensus code=20
> paths=20
> > that is just stale
> > due to a never-activated BIP (-- yes I'm starring at you SIGPUSHONLY).
>
> What specifically do you mean by this? You mean the
> SCRIPT_ERR_SIG_PUSHONLY error condition?
>
> --=20
> https://petertodd.org 'peter'[:-1]@petertodd.org
>

--=20
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 e=
mail to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/=
97c36a7a-fe4d-4e24-8bbb-a55b7284fe71n%40googlegroups.com.

------=_Part_89317_867889912.1739654004942
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Peter,<br /><br />I'm talking about this check in VerifyScript as of com=
mit 43e71f74 in bitcoin core.<br /><br />```<br />=C2=A0 =C2=A0 if ((flags =
&amp; SCRIPT_VERIFY_SIGPUSHONLY) !=3D 0 &amp;&amp; !scriptSig.IsPushOnly())=
 {<br />=C2=A0 =C2=A0 =C2=A0 =C2=A0 return set_error(serror, SCRIPT_ERR_SIG=
_PUSHONLY);<br />=C2=A0 =C2=A0 }<br />```<br /><br />In my understanding, w=
e never set SCRIPT_VERIFY_SIGPUSHONLY, neither in MANDATORY_SCRIPT_VERIFY_F=
LAGS,<br />nor in STANDARD_SCRIPT_VERIFY_FLAGS, and this sounds okay as it'=
s a script check pertaining to BIP62<br />rule 2, and BIP62 was never activ=
ated. As far as I can tell, that's more a stale check just right <br />ther=
e in the interpreter code paths.<br /><br />We still return SCRIPT_ERR_SIG_=
PUSHONLY for P2SH spends, verifying the scriptSig is push-only.<br /><br />=
All the unit tests (i.e `script_tests.cpp`) are manually setting the SCRIPT=
_VERIFY_SIGPUSHONLY flag<br />to verify the logic correctness, even it appe=
ars as never being set for block validation.<br /><br />The original PR is =
there: https://github.com/bitcoin/bitcoin/pull/5065<br /><br />Feel free to=
 point me out if I'm missing something obvious here.<br /><br />Best,<br />=
Antoine<br />OTS hash: 42e2e614fea49ec876539e28b323718df3ef734b3a4b247fcc64=
9f0704ea1b61<br /><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gma=
il_attr">Le vendredi 14 f=C3=A9vrier 2025 =C3=A0 17:45:54 UTC, Peter Todd a=
 =C3=A9crit=C2=A0:<br/></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: =
1ex;">On Fri, Feb 07, 2025 at 05:02:46AM -0800, Antoine Riard wrote:
<br>&gt; This might be a stylistic note, though I could point in bitcoin co=
re code=20
<br>&gt; today implemented
<br>&gt; check in the script interpreter right in the crux of consensus cod=
e paths=20
<br>&gt; that is just stale
<br>&gt; due to a never-activated BIP (-- yes I&#39;m starring at you SIGPU=
SHONLY).
<br>
<br>What specifically do you mean by this? You mean the
<br>SCRIPT_ERR_SIG_PUSHONLY error condition?
<br>
<br>--=20
<br><a href=3D"https://petertodd.org" target=3D"_blank" rel=3D"nofollow" da=
ta-saferedirecturl=3D"https://www.google.com/url?hl=3Dfr&amp;q=3Dhttps://pe=
tertodd.org&amp;source=3Dgmail&amp;ust=3D1739740336967000&amp;usg=3DAOvVaw2=
R5OF6_OMmQmcP5By1hwUJ">https://petertodd.org</a> &#39;peter&#39;[:-1]@<a hr=
ef=3D"http://petertodd.org" target=3D"_blank" rel=3D"nofollow" data-safered=
irecturl=3D"https://www.google.com/url?hl=3Dfr&amp;q=3Dhttp://petertodd.org=
&amp;source=3Dgmail&amp;ust=3D1739740336967000&amp;usg=3DAOvVaw3gQoNAsh87fH=
YcS42yF758">petertodd.org</a>
<br></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Bitcoin Development Mailing List&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:bitcoindev+unsubscribe@googlegroups.com">bitcoind=
ev+unsubscribe@googlegroups.com</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
bitcoindev/97c36a7a-fe4d-4e24-8bbb-a55b7284fe71n%40googlegroups.com?utm_med=
ium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/bitcoind=
ev/97c36a7a-fe4d-4e24-8bbb-a55b7284fe71n%40googlegroups.com</a>.<br />

------=_Part_89317_867889912.1739654004942--

------=_Part_89316_1223663156.1739654004942--