aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriancoleman <1281387+iancoleman@users.noreply.github.com>2019-11-11 09:28:28 +1100
committerGitHub <noreply@github.com>2019-11-11 09:28:28 +1100
commitd0428a8d211dd5914c4c8547c69c75aca4cccfd6 (patch)
treeb0fbf9db522b149ac0fcce969ccaf83bf3391789
parent3dbf117928bb17d58cc54fa1faa9354c014e665b (diff)
parentd9b5b5d0de33e97ae38330df860d7ff3867f7bb7 (diff)
downloadBIP39-d0428a8d211dd5914c4c8547c69c75aca4cccfd6.tar.gz
BIP39-d0428a8d211dd5914c4c8547c69c75aca4cccfd6.tar.zst
BIP39-d0428a8d211dd5914c4c8547c69c75aca4cccfd6.zip
Merge pull request #279 from mctrivia/master
Added Split Phrase Card Output
-rw-r--r--index.html960
-rw-r--r--src/index.html6
-rw-r--r--src/js/index.js28
3 files changed, 994 insertions, 0 deletions
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..a392b50
--- /dev/null
+++ b/index.html
@@ -0,0 +1,960 @@
1<!DOCTYPE html>
2<html>
3 <head lang="en">
4 <meta charset="utf-8" />
5 <title>BIP39 - Mnemonic Code</title>
6 <link rel="stylesheet" href="css/bootstrap-3.3.7.css">
7 <link rel="stylesheet" href="css/app.css">
8 <meta content="Mnemonic code for generating deterministic keys" name="description"/>
9 <meta content="width=device-width, initial-scale=1.0" name="viewport" />
10 <meta content="bitcoin mnemonic converter" name="description" />
11 <meta content="Ian Coleman" name="author" />
12 <link type="image/x-icon" rel="icon" href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" />
13 </head>
14 <body>
15 <div class="container">
16
17 <h1 class="text-center">Mnemonic Code Converter</h1>
18 <p class="version">v0.3.9</p>
19 <hr>
20 <div class="row">
21 <div class="col-md-12">
22 <h2>Mnemonic</h2>
23 <form class="form-horizontal" role="form">
24 <div class="form-group">
25 <div class="col-sm-2"></div>
26 <div class="col-sm-10">
27 <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum).</p>
28 <p>
29 For more info see the
30 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>.
31 </p>
32 </div>
33 </div>
34 <div class="form-group generate-container">
35 <label class="col-sm-2 control-label"></label>
36 <div class="col-sm-10">
37 <div class="form-inline">
38 <div class="input-group-inline">
39 <span>Generate a random mnemonic</span>:
40 <button class="btn generate" ><b>GENERATE</b></button>
41 <select id="strength" class="strength form-control">
42 <option value="3">3</option>
43 <option value="6">6</option>
44 <option value="9">9</option>
45 <option value="12">12</option>
46 <option value="15" selected>15</option>
47 <option value="18">18</option>
48 <option value="21">21</option>
49 <option value="24">24</option>
50 </select>
51 <span>words, or enter your own below</span>.
52 <p class="warning help-block hidden">
53 <span class="text-danger">
54 Mnemonics with less than 12 words have low entropy and may be guessed by an attacker.
55 </span>
56 </p>
57 </div>
58 </div>
59 </div>
60 </div>
61 <div class="entropy-container hidden">
62 <div class="form-group text-danger">
63 <label class="col-sm-2 control-label">Warning</label>
64 <div class="col-sm-10 form-control-static">
65 <span>Entropy is an advanced feature. Your mnemonic may be insecure if this feature is used incorrectly.</span>
66 <a href="#entropy-notes">Read more</a>
67 </div>
68 </div>
69 <div class="form-group">
70 <label for="entropy" class="col-sm-2 control-label">Entropy</label>
71 <div class="col-sm-7">
72 <textarea id="entropy" rows="2" class="entropy private-data form-control" placeholder="Accepts either binary, base 6, 6-sided dice, base 10, hexadecimal or cards"></textarea>
73 <div class="row filter-warning text-danger hidden">
74 <p class="col-sm-12">
75 <strong>
76 Some characters have been discarded
77 </strong>
78 </p>
79 </div>
80 <div class="row">
81 <label class="col-sm-3 control-label"><span class="more-info" title="Based on estimates from zxcvbn using Filtered Entropy">Time To Crack</span></label>
82 <div class="crack-time col-sm-3 form-control-static"></div>
83 <label class="col-sm-3 control-label">Event Count</label>
84 <div class="event-count col-sm-3 form-control-static"></div>
85 </div>
86 <div class="row">
87 <label class="col-sm-3 control-label">Entropy Type</label>
88 <div class="type col-sm-3 form-control-static"></div>
89 <label class="col-sm-3 control-label">Bits Per Event</label>
90 <div class="bits-per-event col-sm-3 form-control-static"></div>
91 </div>
92 <div class="row">
93 <label class="col-sm-3 control-label">Raw Entropy Words</label>
94 <div class="word-count col-sm-3 form-control-static"></div>
95 <label class="col-sm-3 control-label"><span class="more-info" title="Total bits of entropy may be less than indicated if any entropy event uses a weak source.">Total Bits</span></label>
96 <div class="bits col-sm-3 form-control-static"></div>
97 </div>
98 <label class="col-sm-3 control-label">Filtered Entropy</label>
99 <div class="filtered private-data col-sm-9 form-control-static"></div>
100 <label class="col-sm-3 control-label">Raw Binary</label>
101 <div class="binary private-data col-sm-9 form-control-static"></div>
102 <label class="col-sm-3 control-label">Binary Checksum</label>
103 <div class="checksum private-data col-sm-9 form-control-static">&nbsp;</div>
104 <label class="col-sm-3 control-label">Word Indexes</label>
105 <div class="word-indexes private-data col-sm-9 form-control-static">&nbsp;</div>
106 <label class="col-sm-3 control-label">Mnemonic Length</label>
107 <div class="col-sm-9">
108 <select class="mnemonic-length form-control">
109 <option value="raw" selected>Use Raw Entropy (3 words per 32 bits)</option>
110 <option value="12">12 <span>Words</span></option>
111 <option value="15">15 <span>Words</span></option>
112 <option value="18">18 <span>Words</span></option>
113 <option value="21">21 <span>Words</span></option>
114 <option value="24">24 <span>Words</span></option>
115 </select>
116 <p class="weak-entropy-override-warning hidden">
117 <span class="text-danger">
118 The mnemonic will appear more secure than it really is.
119 </span>
120 </p>
121 </div>
122 </div>
123 <div class="col-sm-3">
124 <p>Valid entropy values include:</p>
125 <ul>
126 <li><strong>Binary</strong> [0-1]<br>101010011</li>
127 <li><strong>Base 6</strong> [0-5]<br>123434014</li>
128 <li><strong>Dice</strong> [1-6]<br>62535634</li>
129 <li><strong>Base 10</strong> [0-9]<br>90834528</li>
130 <li><strong>Hex</strong> [0-9A-F]<br>4187a8bfd9</li>
131 <li><strong>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc</li>
132 </ul>
133 </div>
134 </div>
135 </div>
136 <div class="form-group">
137 <div class="col-sm-2"></div>
138 <div class="col-sm-10 checkbox">
139 <label>
140 <input type="checkbox" class="use-entropy">
141 <span>Show entropy details</span>
142 </label>
143 </div>
144 </div>
145 <div class="form-group">
146 <div class="col-sm-2"></div>
147 <div class="col-sm-10 checkbox">
148 <label>
149 <input type="checkbox" class="privacy-screen-toggle">
150 <span>Hide all private info</span>
151 </label>
152 </div>
153 </div>
154 <div class="form-group">
155 <label class="col-sm-2 control-label">Mnemonic Language</label>
156 <div class="col-sm-10 languages">
157 <div class="form-control no-border">
158 <a href="#english">English</a>
159 <a href="#japanese" title="Japanese">日本語</a>
160 <a href="#spanish" title="Spanish">Español</a>
161 <a href="#chinese_simplified" title="Chinese (Simplified)">中文(简体)</a>
162 <a href="#chinese_traditional" title="Chinese (Traditional)">中文(繁體)</a>
163 <a href="#french" title="French">Français</a>
164 <a href="#italian" title="Italian">Italiano</a>
165 <a href="#korean" title="Korean">한국어</a>
166 </div>
167 </div>
168 </div>
169 <div class="form-group">
170 <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
171 <div class="col-sm-10">
172 <textarea id="phrase" class="phrase private-data form-control" data-show-qr></textarea>
173 </div>
174 </div>
175 <div class="form-group">
176 <label for="phrase" class="col-sm-2 control-label">BIP39 Split Mnemonic</label>
177 <div class="col-sm-10">
178 <textarea id="phraseSplit" class="phraseSplit private-data form-control" title="Only 2 of 3 cards needed to recover."></textarea>
179 </div>
180 <div id="phraseSplitWarn" class="phraseSplitWarn"></div>
181 </div>
182 <div class="form-group">
183 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
184 <div class="col-sm-10">
185 <textarea id="passphrase" class="passphrase private-data form-control"></textarea>
186 </div>
187 </div>
188 <div class="form-group">
189 <label for="seed" class="col-sm-2 control-label">BIP39 Seed</label>
190 <div class="col-sm-10">
191 <textarea id="seed" class="seed private-data form-control" readonly="readonly" data-show-qr></textarea>
192 </div>
193 </div>
194 <div class="form-group">
195 <label for="network-phrase" class="col-sm-2 control-label">Coin</label>
196 <div class="col-sm-10">
197 <select id="network-phrase" class="network form-control">
198 <!-- populated by javascript -->
199 </select>
200 </div>
201 </div>
202 <div class="form-group">
203 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
204 <div class="col-sm-10">
205 <textarea id="root-key" class="root-key private-data form-control" data-show-qr></textarea>
206 </div>
207 </div>
208 <div class="form-group litecoin-ltub-container hidden">
209 <label for="litecoin-use-ltub" class="col-sm-2 control-label">Prefixes</label>
210 <div class="col-sm-10 checkbox">
211 <label>
212 <input type="checkbox" id="litecoin-use-ltub" class="litecoin-use-ltub" checked="checked">
213 Use <code>Ltpv / Ltub</code> instead of <code>xprv / xpub</code>
214 </label>
215 </div>
216 </div>
217 </form>
218 </div>
219 </div>
220
221 <hr>
222
223 <div class="row">
224 <div class="col-md-12">
225 <h2>Derivation Path</h2>
226 <ul class="derivation-type nav nav-tabs" role="tablist">
227 <li id="bip32-tab">
228 <a href="#bip32" role="tab" data-toggle="tab">BIP32</a>
229 </li>
230 <li id="bip44-tab" class="active">
231 <a href="#bip44" role="tab" data-toggle="tab">BIP44</a>
232 </li>
233 <li id="bip49-tab">
234 <a href="#bip49" role="tab" data-toggle="tab">BIP49</a>
235 </li>
236 <li id="bip84-tab">
237 <a href="#bip84" role="tab" data-toggle="tab">BIP84</a>
238 </li>
239 <li id="bip141-tab">
240 <a href="#bip141" role="tab" data-toggle="tab">BIP141</a>
241 </li>
242 </ul>
243 <div class="derivation-type tab-content">
244 <div id="bip44" class="tab-pane active">
245 <form class="form-horizontal" role="form">
246 <br>
247 <div class="col-sm-2"></div>
248 <div class="col-sm-10">
249 <p>
250 For more info see the
251 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a>.
252 </p>
253 </div>
254 <div class="form-group">
255 <label for="purpose-bip44" class="col-sm-2 control-label">
256 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
257 </label>
258 <div class="col-sm-10">
259 <input id="purpose-bip44" type="text" class="purpose form-control" value="44" readonly>
260 </div>
261 </div>
262 <div class="form-group">
263 <label for="coin-bip44" class="col-sm-2 control-label">
264 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
265 </label>
266 <div class="col-sm-10">
267 <input id="coin-bip44" type="text" class="coin form-control" value="0" readonly>
268 </div>
269 </div>
270 <div class="form-group">
271 <label for="account-bip44" class="col-sm-2 control-label">
272 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
273 </label>
274 <div class="col-sm-10">
275 <input id="account-bip44" type="text" class="account form-control" value="0">
276 </div>
277 </div>
278 <div class="form-group">
279 <label for="change-bip44" class="col-sm-2 control-label">
280 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
281 </label>
282 <div class="col-sm-10">
283 <input id="change-bip44" type="text" class="change form-control" value="0">
284 </div>
285 </div>
286 <div class="form-group">
287 <label class="col-sm-2 control-label">
288 </label>
289 <div class="col-sm-10">
290 <p>The account extended keys can be used for importing to most BIP44 compatible wallets, such as mycelium or electrum.</p>
291 </div>
292 </div>
293 <div class="form-group">
294 <label for="account-xprv" class="col-sm-2 control-label">
295 <span>Account Extended Private Key</span>
296 </label>
297 <div class="col-sm-10">
298 <textarea id="account-xprv-bip44" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
299 </div>
300 </div>
301 <div class="form-group">
302 <label for="account-xpub" class="col-sm-2 control-label">
303 <span>Account Extended Public Key</span>
304 </label>
305 <div class="col-sm-10">
306 <textarea id="account-xpub-bip44" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
307 </div>
308 </div>
309 <div class="form-group">
310 <label class="col-sm-2 control-label">
311 </label>
312 <div class="col-sm-10">
313 <p>The BIP32 derivation path and extended keys are the basis for the derived addresses.</p>
314 </div>
315 </div>
316 <div class="form-group">
317 <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
318 <div class="col-sm-10">
319 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly">
320 </div>
321 </div>
322 </form>
323 </div>
324 <div id="bip32" class="tab-pane">
325 <form class="form-horizontal" role="form">
326 <br>
327 <div class="col-sm-2"></div>
328 <div class="col-sm-10">
329 <p>
330 For more info see the
331 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a>
332 </p>
333 </div>
334 <div class="form-group">
335 <label for="bip32-client" class="col-sm-2 control-label">Client</label>
336 <div class="col-sm-10">
337 <select id="bip32-client" class="client form-control">
338 <option value="custom">Custom derivation path</option>
339 <!-- populated by javascript -->
340 </select>
341 </div>
342 </div>
343 <div class="form-group">
344 <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
345 <div class="col-sm-10">
346 <input id="bip32-path" type="text" class="path form-control" value="m/0">
347 </div>
348 </div>
349 <div class="form-group">
350 <div class="col-sm-2"></div>
351 <label class="col-sm-10">
352 <input class="hardened-addresses" type="checkbox">
353 <span>Use hardened addresses</span>
354 </label>
355 </div>
356 <div class="form-group">
357 <label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label>
358 <div class="col-sm-10">
359 <p class="form-control no-border">
360 Use path <code>m/0'/0'</code> with hardened addresses.
361 </p>
362 <p class="form-control no-border">
363 For more info see the
364 <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a>
365 </p>
366 </div>
367 </div>
368 <div class="form-group">
369 <label for="core-path" class="col-sm-2 control-label">Multibit</label>
370 <div class="col-sm-10">
371 <p class="form-control no-border">
372 <span>Use path <code>m/0'/0</code>.</span>
373 </p>
374 <p class="form-control no-border">
375 <span>For more info see</span>
376 <a href="https://multibit.org/" target="_blank">MultiBit HD</a>
377 </p>
378 </div>
379 </div>
380 <div class="form-group">
381 <label class="col-sm-2 control-label">Block Explorers</label>
382 <div class="col-sm-10">
383 <p class="form-control no-border">
384 <span>Use path <code>m/44'/0'/0'</code>.</span>
385 <span>Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xprv</code> key.</span>
386 </p>
387 <p class="form-control no-border">
388 <span>Can be used with</span>:
389 <a href="https://blockchain.info/" target="_blank">blockchain.info</a>
390 </p>
391 </div>
392 </div>
393 </form>
394 </div>
395 <div id="bip49" class="tab-pane">
396 <form class="form-horizontal" role="form">
397 <br>
398 <div class="unavailable hidden">
399 <div class="form-group">
400 <div class="col-sm-2"></div>
401 <div class="col-sm-10">
402 <p>BIP49 is unavailable for this coin.</p>
403 </div>
404 </div>
405 </div>
406 <div class="available">
407 <div class="col-sm-2"></div>
408 <div class="col-sm-10">
409 <p>
410 For more info see the
411 <a href="https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki" target="_blank">BIP49 spec</a>.
412 </p>
413 </div>
414 <div class="form-group">
415 <label for="purpose-bip49" class="col-sm-2 control-label">
416 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
417 </label>
418 <div class="col-sm-10">
419 <input id="purpose-bip49" type="text" class="purpose form-control" value="49" readonly>
420 </div>
421 </div>
422 <div class="form-group">
423 <label for="coin-bip49" class="col-sm-2 control-label">
424 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
425 </label>
426 <div class="col-sm-10">
427 <input id="coin-bip49" type="text" class="coin form-control" value="0" readonly>
428 </div>
429 </div>
430 <div class="form-group">
431 <label for="account-bip49" class="col-sm-2 control-label">
432 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
433 </label>
434 <div class="col-sm-10">
435 <input id="account-bip49" type="text" class="account form-control" value="0">
436 </div>
437 </div>
438 <div class="form-group">
439 <label for="change-bip49" class="col-sm-2 control-label">
440 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
441 </label>
442 <div class="col-sm-10">
443 <input id="change-bip49" type="text" class="change form-control" value="0">
444 </div>
445 </div>
446 <div class="form-group">
447 <label class="col-sm-2 control-label">
448 </label>
449 <div class="col-sm-10">
450 <p>The account extended keys can be used for importing to most BIP49 compatible wallets.</p>
451 </div>
452 </div>
453 <div class="form-group">
454 <label for="account-xprv" class="col-sm-2 control-label">
455 <span>Account Extended Private Key</span>
456 </label>
457 <div class="col-sm-10">
458 <textarea id="account-xprv-bip49" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
459 </div>
460 </div>
461 <div class="form-group">
462 <label for="account-xpub" class="col-sm-2 control-label">
463 <span>Account Extended Public Key</span>
464 </label>
465 <div class="col-sm-10">
466 <textarea id="account-xpub-bip49" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
467 </div>
468 </div>
469 <div class="form-group">
470 <label class="col-sm-2 control-label">
471 </label>
472 <div class="col-sm-10">
473 <p>The BIP32 derivation path and extended keys are the basis for the derived addresses.</p>
474 </div>
475 </div>
476 <div class="form-group">
477 <label for="bip49-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
478 <div class="col-sm-10">
479 <input id="bip49-path" type="text" class="path form-control" value="m/49'/0'/0'/0" readonly="readonly">
480 </div>
481 </div>
482 </div>
483 </form>
484 </div>
485 <div id="bip141" class="tab-pane">
486 <form class="form-horizontal" role="form">
487 <br>
488 <div class="unavailable hidden">
489 <div class="form-group">
490 <div class="col-sm-2"></div>
491 <div class="col-sm-10">
492 <p>BIP141 is unavailable for this coin.</p>
493 </div>
494 </div>
495 </div>
496 <div class="available">
497 <div class="col-sm-2"></div>
498 <div class="col-sm-10">
499 <p>
500 For more info see the
501 <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki" target="_blank">BIP141 spec</a>
502 </p>
503 </div>
504 <div class="form-group">
505 <label for="bip141-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
506 <div class="col-sm-10">
507 <input id="bip141-path" type="text" class="bip141-path form-control" value="m/0">
508 </div>
509 </div>
510 <div class="form-group">
511 <label class="col-sm-2 control-label">Script Semantics</label>
512 <div class="col-sm-10">
513 <select class="form-control bip141-semantics">
514 <option value="p2wpkh">P2WPKH</option>
515 <option value="p2wpkh-p2sh" selected>P2WPKH nested in P2SH</option>
516 </select>
517 </div>
518 </div>
519 </div>
520 </form>
521 </div>
522 <div id="bip84" class="tab-pane">
523 <form class="form-horizontal" role="form">
524 <br>
525 <div class="unavailable hidden">
526 <div class="form-group">
527 <div class="col-sm-2"></div>
528 <div class="col-sm-10">
529 <p>BIP84 is unavailable for this coin.</p>
530 </div>
531 </div>
532 </div>
533 <div class="available">
534 <div class="col-sm-2"></div>
535 <div class="col-sm-10">
536 <p>
537 For more info see the
538 <a href="https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki" target="_blank">BIP84 spec</a>.
539 </p>
540 </div>
541 <div class="form-group">
542 <label for="purpose-bip84" class="col-sm-2 control-label">
543 Purpose
544 </label>
545 <div class="col-sm-10">
546 <input id="purpose-bip84" type="text" class="purpose form-control" value="84" readonly>
547 </div>
548 </div>
549 <div class="form-group">
550 <label for="coin-bip84" class="col-sm-2 control-label">
551 Coin
552 </label>
553 <div class="col-sm-10">
554 <input id="coin-bip84" type="text" class="coin form-control" value="0" readonly>
555 </div>
556 </div>
557 <div class="form-group">
558 <label for="account-bip84" class="col-sm-2 control-label">
559 Account
560 </label>
561 <div class="col-sm-10">
562 <input id="account-bip84" type="text" class="account form-control" value="0">
563 </div>
564 </div>
565 <div class="form-group">
566 <label for="change-bip84" class="col-sm-2 control-label">
567 External / Internal
568 </label>
569 <div class="col-sm-10">
570 <input id="change-bip84" type="text" class="change form-control" value="0">
571 </div>
572 </div>
573 <div class="form-group">
574 <label class="col-sm-2 control-label">
575 </label>
576 <div class="col-sm-10">
577 <p>The account extended keys can be used for importing to most BIP84 compatible wallets.</p>
578 </div>
579 </div>
580 <div class="form-group">
581 <label for="account-xprv" class="col-sm-2 control-label">
582 <span>Account Extended Private Key</span>
583 </label>
584 <div class="col-sm-10">
585 <textarea id="account-xprv-bip84" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
586 </div>
587 </div>
588 <div class="form-group">
589 <label for="account-xpub" class="col-sm-2 control-label">
590 <span>Account Extended Public Key</span>
591 </label>
592 <div class="col-sm-10">
593 <textarea id="account-xpub-bip84" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
594 </div>
595 </div>
596 <div class="form-group">
597 <label class="col-sm-2 control-label">
598 </label>
599 <div class="col-sm-10">
600 <p>The BIP32 derivation path and extended keys are the basis for the derived addresses.</p>
601 </div>
602 </div>
603 <div class="form-group">
604 <label for="bip84-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
605 <div class="col-sm-10">
606 <input id="bip84-path" type="text" class="path form-control" value="m/84'/0'/0'/0" readonly="readonly">
607 </div>
608 </div>
609 </div>
610 </form>
611 </div>
612 </div>
613 <form class="form-horizontal" role="form">
614 <div class="form-group">
615 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Private Key</label>
616 <div class="col-sm-10">
617 <textarea id="extended-priv-key" class="extended-priv-key private-data form-control" readonly="readonly" data-show-qr></textarea>
618 </div>
619 </div>
620 <div class="form-group">
621 <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Public Key</label>
622 <div class="col-sm-10">
623 <textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly" data-show-qr></textarea>
624 </div>
625 </div>
626 </form>
627 </div>
628 </div>
629
630 <hr>
631
632 <div class="row">
633 <div class="col-md-12">
634 <h2>Derived Addresses</h2>
635 <p>Note these addresses are derived from the BIP32 Extended Key</p>
636 </div>
637 <div class="col-md-12 bch-addr-type-container hidden">
638 <div class="radio">
639 <label>
640 <input type="radio" value="cashaddr" name="bch-addr-type" class="use-bch-cashaddr-addresses" checked="checked">
641 <span>Use CashAddr addresses for Bitcoin Cash (ie starting with 'q' instead of '1')</span>
642 </label>
643 </div>
644 <div class="radio">
645 <label>
646 <input type="radio" value="bitpay" name="bch-addr-type" class="use-bch-bitpay-addresses">
647 <span>Use BitPay-style addresses for Bitcoin Cash (ie starting with 'C' instead of '1')</span>
648 </label>
649 </div>
650 <div class="radio">
651 <label>
652 <input type="radio" value="legacy" name="bch-addr-type" class="use-bch-legacy-addresses">
653 <span>Use legacy addresses for Bitcoin Cash (ie starting with '1')</span>
654 </label>
655 </div>
656 </div>
657 <div class="col-md-12">
658 <div class="checkbox">
659 <label>
660 <input type="checkbox" class="use-bip38">
661 <span>Encrypt private keys using BIP38 and this password:</span>
662 </label>
663 <input class="bip38-password private-data">
664 <span>Enabling BIP38 means each key will take several minutes to generate.</span>
665 </div>
666 </div>
667 <ul class="addresses-type nav nav-tabs" role="tablist">
668 <li id="table-tab" class="active">
669 <a href="#table" role="tab" data-toggle="tab">Table</a>
670 </li>
671 <li id="csv-tab">
672 <a href="#csv" role="tab" data-toggle="tab">CSV</a>
673 </li>
674 </ul>
675 <div class="addresses-type tab-content">
676 <div id="table" class="tab-pane active">
677 <div class="col-md-12">
678 <table class="table table-striped">
679 <thead>
680 <th>
681 <div class="input-group">
682 <span>Path</span>&nbsp;&nbsp;
683 <button class="index-toggle">Toggle</button>
684 </div>
685 </th>
686 <th>
687 <div class="input-group">
688 <span>Address</span>&nbsp;&nbsp;
689 <button class="address-toggle">Toggle</button>
690 </div>
691 </th>
692 <th>
693 <div class="input-group">
694 <span>Public Key</span>&nbsp;&nbsp;
695 <button class="public-key-toggle">Toggle</button>
696 </div>
697 </th>
698 <th>
699 <div class="input-group">
700 <span>Private Key</span>&nbsp;&nbsp;
701 <button class="private-key-toggle">Toggle</button>
702 </div>
703 </th>
704 </thead>
705 <tbody class="addresses monospace">
706 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
707 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
708 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
709 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
710 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
711 </tbody>
712 </table>
713 </div>
714 </div>
715 <div id="csv" class="tab-pane">
716 <div class="col-md-12">
717 <textarea class="csv form-control" rows="25" readonly></textarea>
718 </div>
719 </div>
720 </div>
721 </div>
722 <span>Show</span>
723 <input type="number" class="rows-to-add" value="20">
724 <button class="more">more rows</button>
725 <span>starting from index</span>
726 <input type="number" class="more-rows-start-index">
727 <span>(leave blank to generate from next index)</span>
728
729 <hr>
730
731 <div class="row">
732 <div class="col-md-12">
733 <h2>More info</h2>
734 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
735 <p>
736 Read more at the
737 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
738 </p>
739 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
740 <p>
741 Read more at the
742 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
743 </p>
744 <p>
745 See the demo at
746 <a href="http://bip32.org/" target="_blank">bip32.org</a>
747 </p>
748 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
749 <p>
750 Read more at the
751 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
752 </p>
753 <h3>BIP49 <span class="small">Derivation scheme for P2WPKH-nested-in-P2SH based accounts</span></h3>
754 <p>
755 Read more at the
756 <a href="https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki" target="_blank">official BIP49 spec</a>
757 </p>
758 <h3>Private Keys</h3>
759 <p>
760 <span>
761 Use private keys at
762 <a href="https://web.archive.org/web/20150707020924/https://brainwallet.org/" target="_blank">brainwallet.org</a>.
763 </span>
764 <span>Be careful - it can be easy to make mistakes if you don't know what you're doing.</span>
765 </p>
766 <h3 id="entropy-notes">Entropy</h3>
767 <p>
768 <span>Entropy values should not include the BIP39 checksum. This is automatically added by the tool.</span>
769 </p>
770 <p>
771 <span>
772 Entropy values must be sourced from a
773 <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>.
774 </span>
775 <span>This means flipping a fair coin, rolling a fair dice, noise measurements etc.</span>
776 <span>
777 Do <strong>NOT</strong> use phrases from books, lyrics from songs, your birthday or street address,
778 keyboard mashing, or anything you <i>think</i> is random, because chances are overwhelming it isn't
779 random enough for the needs of this tool.
780 </span>
781 </p>
782 <p>
783 <strong><span>Do not store entropy.</span></strong>
784 </p>
785 <p>
786 <span>Storing entropy (such as keeping a deck of cards in a specific shuffled order) is unreliable compared to storing a mnemonic.</span>
787 <span>Instead of storing entropy, store the mnemonic generated from the entropy.</span>
788 <span><a href="https://en.wikipedia.org/wiki/Steganography#Physical" target="_blank">Steganography</a> may be beneficial when storing the mnemonic.</span>
789 </p>
790 <p>
791 <span>
792 The random mnemonic generator on this page uses a
793 <a href="https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues" target="_blank">cryptographically secure random number generator</a>.
794 </span>
795 <span>The built in random generator can generally be trusted more than your own intuition about randomness.</span>
796 <span>If cryptographic randomness isn't available in your browser, this page will show a warning and the generate button will not work.</span>
797 <span>In that case you might choose to use your own source of entropy.</span>
798 </p>
799 <p>
800 <a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank">You are not a good source of entropy.</a>
801 </p>
802 <h3>License</h3>
803 <p>
804 <span>Please refer to <a href="https://github.com/iancoleman/bip39/blob/master/LICENSE" target="_blank">the software license</a> for more detail.
805 </span>
806 </p>
807 <p>The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.</p>
808 </div>
809 </div>
810
811 <hr>
812
813 <div class="row">
814 <div class="col-md-12">
815 <h2>Alternative Tools</h2>
816 <p>This tool is interoperable with any BIP39 wallet.</p>
817 <p>Some similar tools to this one (ie not consumer wallets) are</p>
818 <p>
819 <a href="https://bip32jp.github.io/english/">
820 https://bip32jp.github.io/english/
821 </a>
822 </p>
823 </div>
824 </div>
825
826 <hr>
827
828 <div class="row">
829 <div class="col-md-12">
830
831 <h2>Offline Usage</h2>
832
833 <p>
834 You can use this tool without having to be online.
835 </p>
836 <p>
837 In your browser, select file save-as, and save this page
838 as a file.
839 </p>
840 <p>
841 Double-click that file to open it in a browser
842 on any offline computer.
843 </p>
844 <p>
845 <span>Alternatively, download the file from the repository</span>
846 -
847 <a href="https://github.com/iancoleman/bip39">https://github.com/iancoleman/bip39</a>
848 </p>
849
850 </div>
851 </div>
852
853 <hr>
854
855 <div class="row">
856 <div class="col-md-12">
857
858 <h2>This project is 100% open-source code</h2>
859
860 <p>
861 <span>Get the source code from the repository</span>
862 -
863 <a href="https://github.com/iancoleman/bip39" target="_blank">
864 https://github.com/iancoleman/bip39
865 </a>
866 </p>
867
868 <h3>Libraries</h3>
869
870 <p>
871 <span>BitcoinJS - </span>
872 <a href="https://github.com/bitcoinjs/bitcoinjs-lib" target="_blank">
873 https://github.com/bitcoinjs/bitcoinjs-lib
874 </a>
875 </p>
876
877 <p>
878 <span>jsBIP39 - </span>
879 <a href="https://github.com/iancoleman/jsbip39" target="_blank">
880 https://github.com/iancoleman/jsbip39
881 </a>
882 </p>
883
884 <p>
885 <span>sjcl - </span>
886 <a href="https://github.com/bitwiseshiftleft/sjcl" target="_blank">
887 https://github.com/bitwiseshiftleft/sjcl
888 </a>
889 </p>
890
891 <p>
892 <span>jQuery - </span>
893 <a href="https://jquery.com/" target="_blank">
894 https://jquery.com/
895 </a>
896 </p>
897
898 <p>
899 <span>Twitter Bootstrap - </span>
900 <a href="http://getbootstrap.com/" target="_blank">
901 http://getbootstrap.com/
902 </a>
903 </p>
904
905 </div>
906 </div>
907
908 </div>
909
910 <div class="qr-container hidden">
911 <div class="qr-hint bg-primary hidden">Click field to hide QR</div>
912 <div class="qr-hint bg-primary">Click field to show QR</div>
913 <div class="qr-hider hidden">
914 <div class="qr-image"></div>
915 <div class="qr-warning bg-primary">Caution: Scanner may keep history</div>
916 </div>
917 </div>
918
919 <div class="feedback-container">
920 <div class="feedback">Loading...</div>
921 </div>
922
923 <script type="text/template" id="address-row-template">
924 <tr>
925 <td class="index"><span></span></td>
926 <td class="address"><span data-show-qr></span></td>
927 <td class="pubkey"><span data-show-qr></span></td>
928 <td class="privkey private-data"><span data-show-qr></span></td>
929 </tr>
930 </script>
931 <script src="js/polyfill.es6.js"></script>
932 <script src="js/basex.js"></script>
933 <script src="js/unorm.js"></script>
934 <script src="js/jquery-3.2.1.js"></script>
935 <script src="js/bootstrap-3.3.7.js"></script>
936 <script src="js/levenshtein.js"></script>
937 <script src="js/kjua-0.1.1.min.js"></script>
938 <script src="js/bitcoinjs-3.3.2.js"></script>
939 <script src="js/bitcoinjs-extensions.js"></script>
940 <script src="js/bitcoinjs-bip38-2.0.2.js"></script>
941 <script src="js/segwit-parameters.js"></script>
942 <script src="js/ethereumjs-util.js"></script>
943 <script src="js/ripple-util.js"></script>
944 <script src="js/bchaddrjs-0.2.1.js"></script>
945 <script src="js/sjcl-bip39.js"></script>
946 <script src="js/wordlist_english.js"></script>
947 <script src="js/wordlist_japanese.js"></script>
948 <script src="js/wordlist_spanish.js"></script>
949 <script src="js/wordlist_chinese_simplified.js"></script>
950 <script src="js/wordlist_chinese_traditional.js"></script>
951 <script src="js/wordlist_french.js"></script>
952 <script src="js/wordlist_italian.js"></script>
953 <script src="js/wordlist_korean.js"></script>
954 <script src="js/jsbip39.js"></script>
955 <script src="js/biginteger.js"></script>
956 <script src="js/zxcvbn.js"></script>
957 <script src="js/entropy.js"></script>
958 <script src="js/index.js"></script>
959 </body>
960</html>
diff --git a/src/index.html b/src/index.html
index 95fccc1..8862904 100644
--- a/src/index.html
+++ b/src/index.html
@@ -173,6 +173,12 @@
173 </div> 173 </div>
174 </div> 174 </div>
175 <div class="form-group"> 175 <div class="form-group">
176 <label for="phrase" class="col-sm-2 control-label">BIP39 Split Mnemonic</label>
177 <div class="col-sm-10">
178 <textarea id="phraseSplit" class="phraseSplit private-data form-control" title="Only 2 of 3 cards needed to recover."></textarea>
179 </div>
180 </div>
181 <div class="form-group">
176 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label> 182 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
177 <div class="col-sm-10"> 183 <div class="col-sm-10">
178 <textarea id="passphrase" class="passphrase private-data form-control" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea> 184 <textarea id="passphrase" class="passphrase private-data form-control" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
diff --git a/src/js/index.js b/src/js/index.js
index da901f6..035a2b3 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -44,6 +44,7 @@
44 DOM.entropyWeakEntropyOverrideWarning = DOM.entropyContainer.find(".weak-entropy-override-warning"); 44 DOM.entropyWeakEntropyOverrideWarning = DOM.entropyContainer.find(".weak-entropy-override-warning");
45 DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning"); 45 DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning");
46 DOM.phrase = $(".phrase"); 46 DOM.phrase = $(".phrase");
47 DOM.splitPhrase = $(".phraseSplit");
47 DOM.passphrase = $(".passphrase"); 48 DOM.passphrase = $(".passphrase");
48 DOM.generateContainer = $(".generate-container"); 49 DOM.generateContainer = $(".generate-container");
49 DOM.generate = $(".generate"); 50 DOM.generate = $(".generate");
@@ -304,6 +305,7 @@
304 clearDisplay(); 305 clearDisplay();
305 clearEntropyFeedback(); 306 clearEntropyFeedback();
306 DOM.phrase.val(""); 307 DOM.phrase.val("");
308 DOM.phraseSplit.val("");
307 showValidationError("Blank entropy"); 309 showValidationError("Blank entropy");
308 return; 310 return;
309 } 311 }
@@ -338,6 +340,7 @@
338 showPending(); 340 showPending();
339 // Clear existing mnemonic and passphrase 341 // Clear existing mnemonic and passphrase
340 DOM.phrase.val(""); 342 DOM.phrase.val("");
343 DOM.phraseSplit.val("");
341 DOM.passphrase.val(""); 344 DOM.passphrase.val("");
342 seed = null; 345 seed = null;
343 if (rootKeyChangedTimeoutEvent != null) { 346 if (rootKeyChangedTimeoutEvent != null) {
@@ -424,6 +427,7 @@
424 if (DOM.phrase.val().length > 0) { 427 if (DOM.phrase.val().length > 0) {
425 var newPhrase = convertPhraseToNewLanguage(); 428 var newPhrase = convertPhraseToNewLanguage();
426 DOM.phrase.val(newPhrase); 429 DOM.phrase.val(newPhrase);
430 writeSplitPhrase(newPhrase);
427 phraseChanged(); 431 phraseChanged();
428 } 432 }
429 else { 433 else {
@@ -484,6 +488,7 @@
484 // show the words 488 // show the words
485 var words = mnemonic.toMnemonic(data); 489 var words = mnemonic.toMnemonic(data);
486 DOM.phrase.val(words); 490 DOM.phrase.val(words);
491 writeSplitPhrase(words);
487 // show the entropy 492 // show the entropy
488 var entropyHex = uint8ArrayToHex(data); 493 var entropyHex = uint8ArrayToHex(data);
489 DOM.entropy.val(entropyHex); 494 DOM.entropy.val(entropyHex);
@@ -1422,6 +1427,28 @@
1422 } 1427 }
1423 return phrase; 1428 return phrase;
1424 } 1429 }
1430
1431 function writeSplitPhrase(phrase) {
1432 var wordCount = phrase.split(/\s/g).length; //get number of words in phrase
1433 var left=[]; //initialize array of indexs
1434 for (var i=0;i<wordCount;i++) left.push(i); //add all indexs to array
1435 var group=[[],[],[]], //make array for 3 groups
1436 groupI=-1; //initialize group index
1437 var seed = Math.abs(sjcl.hash.sha256.hash(phrase)[0])% 2147483647; //start seed at sudo random value based on hash of words
1438 while (left.length>0) { //while indexs left
1439 groupI=(groupI+1)%3; //get next group to insert index into
1440 seed = seed * 16807 % 2147483647; //change random value.(simple predicatable random number generator works well for this use)
1441 var selected=Math.floor(left.length*(seed - 1) / 2147483646); //get index in left we will use for this group
1442 group[groupI].push(left[selected]); //add index to group
1443 left.splice(selected,1); //remove selected index
1444 }
1445 var cards=[phrase.split(/\s/g),phrase.split(/\s/g),phrase.split(/\s/g)];//make array of cards
1446 for (var i=0;i<3;i++) { //go through each card
1447 for (var ii=0;ii<wordCount/3;ii++) cards[i][group[i][ii]]='XXXX'; //erase words listed in the group
1448 cards[i]='Card '+(i+1)+': '+wordArrayToPhrase(cards[i]); //combine words on card back to string
1449 }
1450 DOM.splitPhrase.val(cards.join("\r\n")); //make words visible
1451 }
1425 1452
1426 function isUsingOwnEntropy() { 1453 function isUsingOwnEntropy() {
1427 return DOM.useEntropy.prop("checked"); 1454 return DOM.useEntropy.prop("checked");
@@ -1480,6 +1507,7 @@
1480 var phrase = mnemonic.toMnemonic(entropyArr); 1507 var phrase = mnemonic.toMnemonic(entropyArr);
1481 // Set the mnemonic in the UI 1508 // Set the mnemonic in the UI
1482 DOM.phrase.val(phrase); 1509 DOM.phrase.val(phrase);
1510 writeSplitPhrase(phrase);
1483 // Show the word indexes 1511 // Show the word indexes
1484 showWordIndexes(); 1512 showWordIndexes();
1485 // Show the checksum 1513 // Show the checksum