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
|
Return-Path: <bitcoin-dev@wuille.net>
Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])
by lists.linuxfoundation.org (Postfix) with ESMTP id EF7B4C013A
for <bitcoin-dev@lists.linuxfoundation.org>;
Mon, 18 Jan 2021 04:15:59 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by fraxinus.osuosl.org (Postfix) with ESMTP id D712785701
for <bitcoin-dev@lists.linuxfoundation.org>;
Mon, 18 Jan 2021 04:15:59 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from fraxinus.osuosl.org ([127.0.0.1])
by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id Y3OnxEXh9nt4
for <bitcoin-dev@lists.linuxfoundation.org>;
Mon, 18 Jan 2021 04:15:58 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-1.7.6
Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch
[185.70.40.134])
by fraxinus.osuosl.org (Postfix) with ESMTPS id 09D798561E
for <bitcoin-dev@lists.linuxfoundation.org>;
Mon, 18 Jan 2021 04:15:57 +0000 (UTC)
Date: Mon, 18 Jan 2021 04:15:49 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wuille.net;
s=protonmail2; t=1610943355;
bh=lSsqimuHU9nNLemaarvugAdbwhCnK8Asx1527b5uu8c=;
h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From;
b=WO5Ntx29HrIbarvvGSlnDfnNb0cHwrCkeD9dWvhiPiqgpyyRvZplGuw95kWFJ8Wxg
du4HgFgOq6/vvm680IPq6D45NBxpduS1c62S1gblfJVt2LNsu4oqRUF1nNWicR46S4
7Fpl8a2EiSeJduq6jlPvavGhspB6baaiG6u1DX2VkUNwQGTjQQ95B+OXiRPmvuq2aK
lfglQYeNdKE+TiGZrfWltcESQ0Z89D/ukWHSlJPexNuXd4gMb6x9J/SCnAKjhfuXX9
XttbH+Lt+ADV5fD4tBfddapXbA9eqQQc8z2CzBgu5xuokDxHwkaL3G8uedNGu0FY2D
dWaFI5BVEAMwA==
To: nakagat <nakagat@gmail.com>
From: Pieter Wuille <bitcoin-dev@wuille.net>
Reply-To: Pieter Wuille <bitcoin-dev@wuille.net>
Message-ID: <N9ny4XfpI4SATvCXSKO_ns03ONm4p17tAGXxInoXIe16S7zfH6b8Uj2SkS-pL5sEEp7Wpyi0RZ8J92WZPDeHYKBBuq1xnV6eEUbKouej-TU=@wuille.net>
In-Reply-To: <CAHk9a9d_xm2nO1t5GsLJiny1V3H=uv8jGuUTywQetZQOXxyG9w@mail.gmail.com>
References: <jfRUzc8uB5fpIQy-a_TfTwjAD4FMtf2eInfHdgZRoLwc0NdTv7srnRLtmwFHPLInJfglSzOXXe0SVR3cgHejGPi0Kwl81UV_wkwVJcQi1rA=@wuille.net>
<CAHk9a9d_xm2nO1t5GsLJiny1V3H=uv8jGuUTywQetZQOXxyG9w@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Bech32m BIP: new checksum,
and usage for segwit address
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: Mon, 18 Jan 2021 04:16:00 -0000
Hi all,
A few updates, in response to comments here and in a few other places:
- Updated several reference implementations (C, C++, Python, Javascript) to=
support Bech32m: https://github.com/sipa/bech32/tree/bech32m (but contribu=
tions to update other languages are welcome!)
- Updated website, including error-locating JS decoder, and demo: http://bi=
tcoin.sipa.be/bech32/demo/demo.html
- Opened a Bitcoin Core PR: https://github.com/bitcoin/bitcoin/pull/20861
- Updates to the BIP draft (https://github.com/sipa/bips/blob/bip-bech32m/b=
ip-bech32m.mediawiki):
* Made the title clearer (so it doesn't imply Bech32m is used for v0)
* Added rationale for not permitting both Bech32 and Bech32m for v0
* Added a section on error location
* Added links for more reference implementations
On Friday, January 15, 2021 12:01 AM, nakagat <nakagat@gmail.com> wrote:
> I read the BIP draft of Bech32m and implemented it in Go.
Cool! Do feel like contributing it to https://github.com/sipa/bech32/tree/b=
ech32m?
> Let me ask you one question.
> Does Checksum have to be fixed?
> The 'bech32_verify_checksum' function has hrp and data as parameters,
> so how about committing Checksum with these two values?
>
> For example, calculate Checksum from hrp and data using hash, chacha20, e=
tc.
I'm not entirely sure what you mean. Do you mean:
1) Can we use a hash function to compute the checksum instead of Bech32's a=
lgorithm?
If you compute the checksum using the HRP and the data using a hash functio=
n, you just 2^-30 failure probability for any error. The idea behind Bech32=
was doing better than that for common errors: any error that consists of u=
p to 4 substitutions are a failure probability of 0 - far better than a has=
h can do.
2) Can we keep using Bech32's algorithm, but compute the final xorred-in co=
nstant from the HRP and the data using a hash function?
That would be functionally equivalent to (1).
3) Can we keep using Bech32's algorithm, but compute the final xorred-in co=
nstant from the HRP (but not the data) using a hash function?
It would mean that some (very) small set of potential HRPs would exhibit mu=
ch worse behavior than others - including the 'q'-before-'p' that the origi=
nal Bech32 has.
Does that clarify things?
Cheers,
--
Pieter
|