summaryrefslogtreecommitdiff
path: root/a5/88fcd6bc44c0cd744fd47caa2c173ad27c63a3
blob: 82432fccb6e27c306669dc38f6c224018098d62b (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
Return-Path: <giacomo.caironi@gmail.com>
Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])
 by lists.linuxfoundation.org (Postfix) with ESMTP id B4A30C000D
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 16 Sep 2021 21:37:01 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp3.osuosl.org (Postfix) with ESMTP id 9D853607FE
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 16 Sep 2021 21:37:01 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -0.199
X-Spam-Level: 
X-Spam-Status: No, score=-0.199 tagged_above=-999 required=5
 tests=[BAYES_40=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: smtp3.osuosl.org (amavisd-new);
 dkim=pass (2048-bit key) header.d=gmail.com
Received: from smtp3.osuosl.org ([127.0.0.1])
 by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id puKrfHI4ZSKY
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 16 Sep 2021 21:37:01 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com
 [IPv6:2607:f8b0:4864:20::735])
 by smtp3.osuosl.org (Postfix) with ESMTPS id DAB8B60730
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 16 Sep 2021 21:37:00 +0000 (UTC)
Received: by mail-qk1-x735.google.com with SMTP id ay33so10933845qkb.10
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 16 Sep 2021 14:37:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:from:date:message-id:subject:to;
 bh=rmm7Ntd1/M38rKLdi8KrFPB93RRenrDKyHORXPxSVKQ=;
 b=qqNYXIrArc3s4BS9nB2Qa7dVvLq7TDOBvQWh4jYGBNBttp6z0YFrGQJs0EmBqVpmNb
 mhXAmWGvEJy1GeOfkDiWZNM92lSJJ76JpPxXPfryCax+YZ2e3yx23H3tqJMhQLJy0AWL
 8A2n+ZIdd3/ijoN1ip8EPVwX027ckAmjP9vqwm8qq9kc/ESD6HbVK/iCzsZxWbhkr0W6
 A/KCCMR5paOXtG+RdhQpdLJF+rfCbWTHffQYTyEspe6VDMy9+r4YbUnoMYquKwKHWjLi
 YiLgQM1ReNdCMTBx72Gzr6LMYUiDp7msyM8IDJDQXF18hDCGHtNuYcKM7UFlHF0/Aavu
 ThTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=rmm7Ntd1/M38rKLdi8KrFPB93RRenrDKyHORXPxSVKQ=;
 b=ZxB9U3wN1in7PnpS4Ei4v84BX83LXq37jneZUos6mYBGoOCGVTCYhhC4jnT1m/ts27
 aJM+bS+Y/PDwJWIcEVyx8p387JmfJB6Sd3EYOGvSOVVK2s+7ASTozX7YQXZwWEpwZFAO
 QWDhy/5mp1OAMQcD8V+pFI6LEX2JijuCoFTiFzchSodyKWRuye9hQ6tq3oejBoVniIKA
 qHpgrPfIX5LrUzAaqDOTk3AxNUUC/LFz/oF9a45oz24HH/0oauN2qxZqDG0J88qBhNsL
 YUQNrVYQeUg4pshTN9q5pt7FAD5HRqZHGwt0T978fnQfmGTvl2f0IZHZTZ2/uZwhNXTv
 cyRA==
X-Gm-Message-State: AOAM530uiNp2nNlRI7+6KYf6iFOKF+PQbEMs2vCbWFqAB4726TwemPbT
 Vlyc9OyeT6+ZjPVesrr2BoTvEpWrlIkf6TCZ8euDBWiP
X-Google-Smtp-Source: ABdhPJwAprgK8AqniSJtepWOc47UY0IY90saK5vvfrZYLLiiMvXfI4qDU9WbHEbeLM2gIvUGNnwiPl6nKbnxEoXf1IA=
X-Received: by 2002:a25:ca08:: with SMTP id a8mr9493520ybg.231.1631828219631; 
 Thu, 16 Sep 2021 14:36:59 -0700 (PDT)
MIME-Version: 1.0
From: Giacomo Caironi <giacomo.caironi@gmail.com>
Date: Thu, 16 Sep 2021 23:36:48 +0200
Message-ID: <CACHAfwcJrf8kc9+=2+ekjuPTPjW8T6qJS538QQ2DJedAn-XxKA@mail.gmail.com>
To: bitcoin-dev@lists.linuxfoundation.org
Content-Type: multipart/alternative; boundary="0000000000005d9a8905cc239d24"
X-Mailman-Approved-At: Thu, 16 Sep 2021 21:39:41 +0000
Subject: [bitcoin-dev] Test cases for Taproot signature message
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: Thu, 16 Sep 2021 21:37:01 -0000

--0000000000005d9a8905cc239d24
Content-Type: text/plain; charset="UTF-8"

Hi,
recently I have worked on a python implementation of bitcoin signature
messages, and I have found that there was way better documentation about
Segwit signature message than Taproot.

1) Segwit signature message got its own BIP, completed with test cases
regarding only that specific function; Taproot on the other hand has the
signature message function defined in BIP 341 and the test vectors in a
different BIP (341). This is confusing. Shouldn't we create a different BIP
only for Taproot signature message exactly like Segwit?

2) The test vectors for Taproot have no documentation and, most
importantly, they are not atomic, in the sense that they do not target a
specific part of the taproot code but all of it. This may not be a very big
problem, but for signature verification it is. Because there are hashes
involved, we can't really debug why a signature message doesn't pass
validation, either it is valid or it is not. BIP 143 in this case is really
good, because it provides hash preimages, so it is possible to debug the
function and see where something went wrong. Because of this, writing the
Segwit signature hash function took a fraction of the time compared to
Taproot.

If this idea is accepted I will be more than happy to write the test cases
for Taproot.

BTW this is the first time I contribute to Bitcoin, let me know if I was
rude or did something wrong. Moreover english is not my first language, so
I apologize if I wrote something awful above

--0000000000005d9a8905cc239d24
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,=C2=A0<div>recently I have worked on a python implement=
ation of bitcoin signature messages, and I have found that there was way be=
tter documentation about Segwit signature message than Taproot.</div><div><=
br></div><div>1) Segwit signature message got its own BIP, completed with t=
est cases regarding only that specific function; Taproot on the other hand =
has the signature message function defined in BIP 341 and the test vectors =
in a different BIP (341). This is confusing. Shouldn&#39;t we create a diff=
erent BIP only for Taproot signature message exactly like Segwit?</div><div=
><br></div><div>2) The test vectors for Taproot have no documentation and, =
most importantly, they are not atomic, in the sense that they do not target=
 a specific part of the taproot code but all of it. This may not be a very =
big problem, but for signature verification it is. Because there are hashes=
 involved, we can&#39;t really debug why a signature message doesn&#39;t pa=
ss validation, either it is valid or it is not. BIP 143 in this case is rea=
lly good, because it provides hash preimages, so it is possible to debug th=
e function and see where something went wrong. Because of this, writing the=
 Segwit signature hash function took a fraction of the time compared to Tap=
root.</div><div><br></div><div>If this idea is accepted I will be more than=
 happy to write the test cases for Taproot.</div><div><br></div><div>BTW th=
is is the first time I contribute to Bitcoin, let me know if I was rude or =
did something wrong. Moreover english is not my first language, so I apolog=
ize if I wrote something awful above</div></div>

--0000000000005d9a8905cc239d24--