summaryrefslogtreecommitdiff
path: root/50/7dd30635d920313667a49b28b9a059a233d6ce
blob: 217956412b703ea07c7065907c299755c838bdf0 (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
Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194]
	helo=mx.sourceforge.net)
	by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <mh.in.england@gmail.com>) id 1X7LGM-0003OM-Ab
	for bitcoin-development@lists.sourceforge.net;
	Wed, 16 Jul 2014 09:12:34 +0000
Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of gmail.com
	designates 209.85.214.178 as permitted sender)
	client-ip=209.85.214.178; envelope-from=mh.in.england@gmail.com;
	helo=mail-ob0-f178.google.com; 
Received: from mail-ob0-f178.google.com ([209.85.214.178])
	by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1X7LGL-0001u0-0W
	for bitcoin-development@lists.sourceforge.net;
	Wed, 16 Jul 2014 09:12:34 +0000
Received: by mail-ob0-f178.google.com with SMTP id nu7so629168obb.23
	for <bitcoin-development@lists.sourceforge.net>;
	Wed, 16 Jul 2014 02:12:27 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.182.233.230 with SMTP id tz6mr33515050obc.53.1405501946459; 
	Wed, 16 Jul 2014 02:12:26 -0700 (PDT)
Sender: mh.in.england@gmail.com
Received: by 10.76.35.234 with HTTP; Wed, 16 Jul 2014 02:12:26 -0700 (PDT)
In-Reply-To: <CACq0ZD5qTc-2f+puPaXMDFZNWUx8kvOZQMxqkM_e4YafhTW7cA@mail.gmail.com>
References: <CANEZrP3ZzCBohXWZmZxE=ofP74Df4Hd-hCLH6jYn=JKbiqNQXA@mail.gmail.com>
	<CAObn+gfbH61kyv_ttT4vsQuNFRWLB5H3xaux7GQ0co82ucO_eA@mail.gmail.com>
	<CANg-TZAe2PO9nwQktmDSJFtaLsg6hogOw6mj0SaROdJJr33vog@mail.gmail.com>
	<CANEZrP3E2mdvOUHiW9W_hM3Z_kn9um8E6aX5vf-S9tA7KgnpUQ@mail.gmail.com>
	<CACq0ZD5qTc-2f+puPaXMDFZNWUx8kvOZQMxqkM_e4YafhTW7cA@mail.gmail.com>
Date: Wed, 16 Jul 2014 11:12:26 +0200
X-Google-Sender-Auth: UcBAS3hPGzDLvfvNpwESd95e_2c
Message-ID: <CANEZrP0wQa1s3CsKrnWc5fmBOwO6V7Ly7L7OLwad-yr0OnnRUw@mail.gmail.com>
From: Mike Hearn <mike@plan99.net>
To: Aaron Voisine <voisine@gmail.com>
Content-Type: multipart/alternative; boundary=001a11c300123ffe2304fe4becf1
X-Spam-Score: -0.5 (/)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
	(mh.in.england[at]gmail.com)
	-0.0 SPF_PASS               SPF: sender matches SPF record
	1.0 HTML_MESSAGE           BODY: HTML included in message
	0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
	not necessarily valid
	-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Headers-End: 1X7LGL-0001u0-0W
Cc: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] BIP 38 NFC normalisation issue
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Wed, 16 Jul 2014 09:12:34 -0000

--001a11c300123ffe2304fe4becf1
Content-Type: text/plain; charset=UTF-8

I'm all for fixing bugs, but I know from bitter experience that outside the
BMP dragons lurk. Browsers don't even expose Unicode APIs at all. You end
up needing to ship an entire pure-js implementation, which can be too large
for some use cases (too much time sunk on that issue in my last job).

I'm hoping BIP 38 doesn't get widely used anyway, to be frank. People
moving private keys around by hand has caused quite a few problems in the
past, sometimes people lost money. It's better to work at the level of a
wallet and ideally ask people to move money using regular transactions. Way
less potential for errors.

Regardless, I'll file a JVM bug and see what the outcome is.


On Wed, Jul 16, 2014 at 12:23 AM, Aaron Voisine <voisine@gmail.com> wrote:

> If the user creates a password on an iOS device with an astral
> character and then can't enter that password on a JVM wallet, that
> sucks. If JVMs really can't support unicode NFC then that's a strong
> case to limit the spec to the subset of unicode that all popular
> platforms can support, but it sounds like it might just be a JVM
> string library bug that could hopefully be reported and fixed. I get
> the same result as in the test case using apple's
> CFStringNormalize(passphrase, kCFStringNormalizationFormC);
>
> Aaron Voisine
> breadwallet.com
>
>
> On Tue, Jul 15, 2014 at 11:20 AM, Mike Hearn <mike@plan99.net> wrote:
> > Yes, we know, Andreas' code is indeed doing normalisation.
> >
> > However it appears the output bytes end up being different. What I get
> back
> > is:
> >
> > cf930001303430300166346139
> >
> > vs
> >
> > cf9300f0909080f09f92a9
> >
> > from the spec.
> >
> > I'm not sure why. It appears this is due to the character from the astral
> > planes. Java is old and uses 16 bit characters internally - it wouldn't
> > surprise me if there's some weirdness that means it doesn't/won't support
> > this kind of thing.
> >
> > I recommend instead that any implementation that wishes to be compatible
> > with JVM based wallets (I suspect Android is the same) just refuse any
> > passphrase that includes characters outside the BMP. At least unless
> someone
> > can find a fix. I somehow doubt this will really hurt anyone.
> >
> >
> ------------------------------------------------------------------------------
> > Want fast and easy access to all the code in your enterprise? Index and
> > search up to 200,000 lines of code with a free copy of Black Duck
> > Code Sight - the same software that powers the world's largest code
> > search on Ohloh, the Black Duck Open Hub! Try it now.
> > http://p.sf.net/sfu/bds
> > _______________________________________________
> > Bitcoin-development mailing list
> > Bitcoin-development@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bitcoin-development
> >
>

--001a11c300123ffe2304fe4becf1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;m all for fixing bugs, but I know from bitter experi=
ence that outside the BMP dragons lurk. Browsers don&#39;t even expose Unic=
ode APIs at all. You end up needing to ship an entire pure-js implementatio=
n, which can be too large for some use cases (too much time sunk on that is=
sue in my last job).<div>
<br></div><div>I&#39;m hoping BIP 38 doesn&#39;t get widely used anyway, to=
 be frank. People moving private keys around by hand has caused quite a few=
 problems in the past, sometimes people lost money. It&#39;s better to work=
 at the level of a wallet and ideally ask people to move money using regula=
r transactions. Way less potential for errors.</div>
<div><br></div><div>Regardless, I&#39;ll file a JVM bug and see what the ou=
tcome is.</div></div><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Wed, Jul 16, 2014 at 12:23 AM, Aaron Voisine <span dir=3D"ltr">&=
lt;<a href=3D"mailto:voisine@gmail.com" target=3D"_blank">voisine@gmail.com=
</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">If the user creates a password on an iOS dev=
ice with an astral<br>
character and then can&#39;t enter that password on a JVM wallet, that<br>
sucks. If JVMs really can&#39;t support unicode NFC then that&#39;s a stron=
g<br>
case to limit the spec to the subset of unicode that all popular<br>
platforms can support, but it sounds like it might just be a JVM<br>
string library bug that could hopefully be reported and fixed. I get<br>
the same result as in the test case using apple&#39;s<br>
CFStringNormalize(passphrase, kCFStringNormalizationFormC);<br>
<br>
Aaron Voisine<br>
<a href=3D"http://breadwallet.com" target=3D"_blank">breadwallet.com</a><br=
>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
<br>
On Tue, Jul 15, 2014 at 11:20 AM, Mike Hearn &lt;<a href=3D"mailto:mike@pla=
n99.net">mike@plan99.net</a>&gt; wrote:<br>
&gt; Yes, we know, Andreas&#39; code is indeed doing normalisation.<br>
&gt;<br>
&gt; However it appears the output bytes end up being different. What I get=
 back<br>
&gt; is:<br>
&gt;<br>
&gt; cf930001303430300166346139<br>
&gt;<br>
&gt; vs<br>
&gt;<br>
&gt; cf9300f0909080f09f92a9<br>
&gt;<br>
&gt; from the spec.<br>
&gt;<br>
&gt; I&#39;m not sure why. It appears this is due to the character from the=
 astral<br>
&gt; planes. Java is old and uses 16 bit characters internally - it wouldn&=
#39;t<br>
&gt; surprise me if there&#39;s some weirdness that means it doesn&#39;t/wo=
n&#39;t support<br>
&gt; this kind of thing.<br>
&gt;<br>
&gt; I recommend instead that any implementation that wishes to be compatib=
le<br>
&gt; with JVM based wallets (I suspect Android is the same) just refuse any=
<br>
&gt; passphrase that includes characters outside the BMP. At least unless s=
omeone<br>
&gt; can find a fix. I somehow doubt this will really hurt anyone.<br>
&gt;<br>
</div></div><div class=3D"HOEnZb"><div class=3D"h5">&gt; ------------------=
------------------------------------------------------------<br>
&gt; Want fast and easy access to all the code in your enterprise? Index an=
d<br>
&gt; search up to 200,000 lines of code with a free copy of Black Duck<br>
&gt; Code Sight - the same software that powers the world&#39;s largest cod=
e<br>
&gt; search on Ohloh, the Black Duck Open Hub! Try it now.<br>
&gt; <a href=3D"http://p.sf.net/sfu/bds" target=3D"_blank">http://p.sf.net/=
sfu/bds</a><br>
&gt; _______________________________________________<br>
&gt; Bitcoin-development mailing list<br>
&gt; <a href=3D"mailto:Bitcoin-development@lists.sourceforge.net">Bitcoin-d=
evelopment@lists.sourceforge.net</a><br>
&gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/bitcoin-develo=
pment" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/bitco=
in-development</a><br>
&gt;<br>
</div></div></blockquote></div><br></div>

--001a11c300123ffe2304fe4becf1--