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
|
Return-Path: <stick@satoshilabs.com>
Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])
by lists.linuxfoundation.org (Postfix) with ESMTP id 789F6C0032
for <bitcoin-dev@lists.linuxfoundation.org>;
Fri, 11 Aug 2023 10:07:02 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by smtp1.osuosl.org (Postfix) with ESMTP id 4D0FD8213B
for <bitcoin-dev@lists.linuxfoundation.org>;
Fri, 11 Aug 2023 10:07:02 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4D0FD8213B
Authentication-Results: smtp1.osuosl.org;
dkim=pass (2048-bit key) header.d=satoshilabs.com header.i=@satoshilabs.com
header.a=rsa-sha256 header.s=google header.b=Ucj0tHpR
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5
tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001,
RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
Received: from smtp1.osuosl.org ([127.0.0.1])
by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id BFSRB9o6_NXn
for <bitcoin-dev@lists.linuxfoundation.org>;
Fri, 11 Aug 2023 10:07:01 +0000 (UTC)
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
[IPv6:2a00:1450:4864:20::62e])
by smtp1.osuosl.org (Postfix) with ESMTPS id C0E258210C
for <bitcoin-dev@lists.linuxfoundation.org>;
Fri, 11 Aug 2023 10:07:00 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org C0E258210C
Received: by mail-ej1-x62e.google.com with SMTP id
a640c23a62f3a-986d8332f50so256076566b.0
for <bitcoin-dev@lists.linuxfoundation.org>;
Fri, 11 Aug 2023 03:07:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=satoshilabs.com; s=google; t=1691748419; x=1692353219;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=EB+tn4wMqJxKYkeF3ul/Ex90D7fQoBEKpb/5sLdkgZc=;
b=Ucj0tHpR075XygIakoviQ1ocYBykYOOe/AGN8kRJEpoSFDVjEIeroxyZG1dmHSW8YL
1NPKzcTy80W0pbRlwtIEYbmJB+ZbgAr7IbgPikTmeOnW8SgnJrv7gzftg1lOtYTv5mFJ
2Oru9IwzDLRggfmJH54v1xCgOeGrGxjX0drI+/ApLZKUtNheOAWlVQZCCj6tkwBBG0uZ
TQPdfb/bLd7j4bYS5FulBQutBbGV3jn0OYqJQTsiswUYCcM2+ZQu0MvmvbsoXQDzGDdG
K3Rkl35J13BadNbiS9njNas2MF3J4ouOBucigY2CkOvXr7xdeHWuJQOjxkUoWJ5TIj/h
iiJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20221208; t=1691748419; x=1692353219;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=EB+tn4wMqJxKYkeF3ul/Ex90D7fQoBEKpb/5sLdkgZc=;
b=bdmkWKU4K2jqnx9skYDju/ES/YDk0V1kNdCgwykItGEpqOT3mVPh9yfkCRu3Y4keVt
D3cxxJT3wNZXEOy2rNLiCtcAPoxoZpS8zYeytzMVZPXNXRlqR9blBDz52F8er80tElj3
Ru68Gk+yRAZzMBMYx0YfJ4IGwRrIrQCp06UKtihr9vTqobwgZI51NN0Ar/rJOWUxGfEq
ZH1uPRfq66SRGO9TZy9CivCU+TMr6Vn1MJk0KM3cUar9u+SqcLehFodOMul1YFt5tp3w
wIm4UU06S3o/foeSApTaB6WRqISY1AfTEvxRuceCCcUYzDPmQH7z7sfnAxQkzsUZjiNi
o29w==
X-Gm-Message-State: AOJu0Yxu8eM62ppwRHOFY2pzMHxIiUyODIwH4ZSaLMrLez7wvEL8BaLI
FQR73fkPJTAAXrRRznUH3MEfW9ovq2wFPQsVeIgENqgIDDUYZEzsI5M=
X-Google-Smtp-Source: AGHT+IFt6vMw/Dfh9uH7H066yIPHgGmuVOR1VMLwMwgJp6t5bPMnNzetp1i7mNLkKTHijVxqrePE+BKUwxBQOEoU9I0=
X-Received: by 2002:a17:906:1cf:b0:99c:57ed:baf1 with SMTP id
15-20020a17090601cf00b0099c57edbaf1mr1171715ejj.51.1691748418784; Fri, 11 Aug
2023 03:06:58 -0700 (PDT)
MIME-Version: 1.0
References: <ZNW9BenWIhgX95zl@alke>
In-Reply-To: <ZNW9BenWIhgX95zl@alke>
From: Pavol Rusnak <stick@satoshilabs.com>
Date: Fri, 11 Aug 2023 12:06:22 +0200
Message-ID: <CAF90AvnE+rNnbrS3Y_A7xfnAhvB+0xUnLGFv4X6pFssjocBFtw@mail.gmail.com>
To: Tobin Harding <me@tobin.cc>,
Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="0000000000008d28420602a2df83"
Subject: Re: [bitcoin-dev] segwit naming ambiguity
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Fri, 11 Aug 2023 10:07:02 -0000
--0000000000008d28420602a2df83
Content-Type: text/plain; charset="UTF-8"
Here's my idea for a clean API:
1. `is_segwit()` returns true for a p2tr output
2. a function `segwit_version()` which returns an int according to segwit
version used
3. helper functions like `is_p2wpkh()`, `is_p2tr()`, `is_p2wsh()` for all
script types which all return a bool
On Fri, 11 Aug 2023 at 08:41, Tobin Harding via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:
> Question for OG bitcoin API designers please.
>
> If you were to see the following function
>
> `is_segwit()`
>
> would you assume it returns `true` or `false` for a p2tr transaction?
>
>
> Currently we (rust-bitcoin) are being liberal with the use of `v0` but
> its a pretty ugly. Is there an official, or widely used, name for segwit
> v0?
>
>
> Thanks,
> Tobin.
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
--
Best Regards / S pozdravom,
Pavol "Stick" Rusnak
Co-Founder, SatoshiLabs
--0000000000008d28420602a2df83
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Here's my idea for a clean API:</div><div><br></d=
iv>1. `is_segwit()` returns true for a p2tr output<div><br></div><div>2. a =
function `segwit_version()` which returns an int according to segwit versio=
n used</div><div><br></div><div>3. helper functions like `is_p2wpkh()`, `is=
_p2tr()`, `is_p2wsh()` for all script types which all return a bool</div><d=
iv>=C2=A0</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">On Fri, 11 Aug 2023 at 08:41, Tobin Harding via bitcoin-dev=
<<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@l=
ists.linuxfoundation.org</a>> wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex">Question for OG bitcoin API designers please.<br>
<br>
If you were to see the following function<br>
<br>
=C2=A0 =C2=A0 `is_segwit()`<br>
<br>
would you assume it returns `true` or `false` for a p2tr transaction?<br>
<br>
<br>
Currently we (rust-bitcoin) are being liberal with the use of `v0` but<br>
its a pretty ugly. Is there an official, or widely used, name for segwit v0=
?<br>
<br>
<br>
Thanks,<br>
Tobin.<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">=
bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mail=
man/listinfo/bitcoin-dev</a><br>
</blockquote></div><br clear=3D"all"><div><br></div><span class=3D"gmail_si=
gnature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><d=
iv dir=3D"ltr"><div><div dir=3D"ltr"><div></div><div>Best Regards / S pozdr=
avom,</div><div><br></div><div>Pavol "Stick" Rusnak</div><div>Co-=
Founder, SatoshiLabs</div></div></div></div></div>
--0000000000008d28420602a2df83--
|