]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blame - src/index.html
Entropy section consumes less vertical space
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / index.html
CommitLineData
ebd8d4e8
IC
1<!DOCTYPE html>
2<html>
3 <head lang="en">
4 <meta charset="utf-8" />
5 <title>BIP39 - Mnemonic Code</title>
cee442b1 6 <link rel="stylesheet" href="css/bootstrap.min.css">
ebd8d4e8
IC
7 <meta content="Mnemonic code for generating deterministic keys" name="description"/>
8 <meta content="width=device-width, initial-scale=1.0" name="viewport" />
9 <meta content="bitcoin mnemonic converter" name="description" />
b630f83d 10 <meta content="Ian Coleman" name="author" />
ebd8d4e8
IC
11
12 <style>
f52dcdbd
IC
13 body {
14 padding-bottom: 32px;
15 }
d198865f
IC
16 .form-control[readonly] {
17 cursor: text;
dd566a1e 18 }
ebd8d4e8
IC
19 .feedback-container {
20 position: fixed;
21 top: 0;
22 width: 100%;
23 text-align: center;
24 z-index: 4;
25 }
26 .feedback {
27 display: table;
28 padding: 0.5em 1em;
29 background-color: orange;
30 margin: 0 auto;
31 font-size: 2em;
32 color: #444;
33 border: 2px solid #555;
34 border-top: 0;
35 border-bottom-left-radius: 20px 20px;
36 border-bottom-right-radius: 20px 20px;
37 }
55a9e51a
IC
38 .no-border {
39 border: 0;
40 box-shadow: inset 0 1px 1px rgba(0,0,0,.0);
41 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.0);
42 }
5ee7bb9e
IC
43 .phrase {
44 word-break: keep-all;
45 }
0a84fe6a 46 .generate-container .strength {
b0818b31
IC
47 /* override mobile width from bootstrap */
48 width: auto!important;
49 display: inline-block;
50 }
39836616 51 .languages * {
7c31e3cd
IC
52 padding-left: 10px;
53 }
d737abf6
IC
54 .monospace {
55 font-family: monospace;
56 }
0a84fe6a
IC
57 .entropy-container .filtered,
58 .entropy-container .binary {
59 word-wrap: break-word;
60 }
61 .entropy-container li {
62 padding-bottom: 5px;
63 }
ebd8d4e8
IC
64 </style>
65 </head>
66 <body>
67 <div class="container">
68
69 <h1 class="text-center">Mnemonic Code Converter</h1>
70 <hr>
71 <div class="row">
72 <div class="col-md-12">
d4779799 73 <h2>Mnemonic</h2>
ebd8d4e8 74 <form class="form-horizontal" role="form">
ebd8d4e8 75 <div class="form-group">
c6624d51
IC
76 <div class="col-sm-2"></div>
77 <div class="col-sm-10">
78 <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>
79 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p>
80 </div>
81 </div>
82 <div class="form-group generate-container">
b0818b31 83 <label class="col-sm-2 control-label"></label>
ebd8d4e8 84 <div class="col-sm-10">
b0818b31
IC
85 <div class="form-inline">
86 <div class="input-group-inline">
87 <button class="btn generate">Generate</button>
88 <span>a random</span>
89 <select id="strength" class="strength form-control">
90 <option value="3">3</option>
91 <option value="6">6</option>
92 <option value="9">9</option>
93 <option value="12">12</option>
94 <option value="15" selected>15</option>
95 <option value="18">18</option>
96 <option value="21">21</option>
97 <option value="24">24</option>
98 </select>
99 word mnemonic, or enter your own below.
100 </div>
101 </div>
ebd8d4e8 102 </div>
7c31e3cd 103 </div>
c6624d51 104 <div class="entropy-container hidden">
0a84fe6a
IC
105 <div class="form-group text-danger">
106 <label class="col-sm-2 control-label">Warning</label>
107 <div class="col-sm-10 form-control-static">
108 Entropy is an advanced feature.
109 Your mnemonic may be insecure if this feature is used incorrectly.
110 <a href="#entropy-notes">Read more</a>
439f0e25 111 </div>
1cf1bbaf 112 </div>
0a84fe6a
IC
113 <div class="form-group">
114 <label for="entropy" class="col-sm-2 control-label">Entropy</label>
115 <div class="col-sm-7">
116 <textarea id="entropy" rows="2" class="entropy form-control" placeholder="Accepts binary, base 6, 6-sided dice, base 10, hexadecimal, cards"></textarea>
117 <label class="col-sm-3 control-label">Strength</label>
118 <div class="strength col-sm-3 form-control-static"></div>
119 <label class="col-sm-3 control-label">Event Count</label>
120 <div class="event-count col-sm-3 form-control-static"></div>
121 <label class="col-sm-3 control-label">Entropy Type</label>
122 <div class="type col-sm-3 form-control-static"></div>
123 <label class="col-sm-3 control-label">Bits Per Event</label>
124 <div class="bits-per-event col-sm-3 form-control-static"></div>
125 <label class="col-sm-3 control-label">Word Count</label>
126 <div class="word-count col-sm-3 form-control-static"></div>
127 <label class="col-sm-3 control-label">Total Bits</label>
128 <div class="bits col-sm-3 form-control-static"></div>
129 <label class="col-sm-3 control-label">Filtered Entropy</label>
130 <div class="filtered col-sm-9 form-control-static"></div>
131 <label class="col-sm-3 control-label">Raw Binary</label>
132 <div class="binary col-sm-9 form-control-static"></div>
133 <label class="col-sm-3 control-label">Mnemonic Length</label>
134 <div class="col-sm-9">
1cf1bbaf 135 <select class="mnemonic-length form-control">
3599674d 136 <option value="raw">From entropy length (3 words per 32 bits)</option>
1cf1bbaf
IC
137 <option value="12">12 Words</option>
138 <option value="15">15 Words</option>
139 <option value="18">18 Words</option>
140 <option value="21">21 Words</option>
141 <option value="24">24 Words</option>
142 </select>
c6624d51 143 </div>
1cf1bbaf 144 </div>
0a84fe6a
IC
145 <div class="col-sm-3">
146 <p>Valid entropy values include:</p>
147 <ul>
148 <li><strong>Binary</strong> [0-1]<br>101010011</li>
149 <li><strong>Base 6</strong> [0-5]<br>123434014</li>
150 <li><strong>Dice</strong> [1-6]<br>62535634</li>
151 <li><strong>Base 10</strong> [0-9]<br>90834528</li>
152 <li><strong>Hex</strong> [0-9A-F]<br>4187a8bfd9</li>
153 <li><strong>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc</li>
154 </ul>
155 </div>
c6624d51
IC
156 </div>
157 </div>
158 <div class="form-group">
159 <div class="col-sm-2"></div>
160 <div class="col-sm-10 checkbox">
161 <label>
162 <input type="checkbox" class="use-entropy">
163 Supply my own source of entropy
164 </label>
165 </div>
166 </div>
167 <div class="form-group">
7c31e3cd
IC
168 <label class="col-sm-2 control-label"></label>
169 <div class="col-sm-10 languages">
170 <a href="#english">English</a>
171 <a href="#japanese" title="Japanese">日本語</a>
172 <a href="#spanish" title="Spanish">Español</a>
173 <a href="#chinese_simplified" title="Chinese (Simplified)">中文(简体)</a>
174 <a href="#chinese_traditional" title="Chinese (Traditional)">中文(繁體)</a>
175 <a href="#french" title="French">Français</a>
176 <a href="#italian" title="Italian">Italiano</a>
177 </div>
ebd8d4e8
IC
178 </div>
179 <div class="form-group">
b0818b31 180 <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
ebd8d4e8 181 <div class="col-sm-10">
b0818b31 182 <textarea id="phrase" class="phrase form-control"></textarea>
ebd8d4e8
IC
183 </div>
184 </div>
1abcc511
PR
185 <div class="form-group">
186 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
187 <div class="col-sm-10">
188 <textarea id="passphrase" class="passphrase form-control"></textarea>
189 </div>
190 </div>
3e0ed16a
KK
191 <div class="form-group">
192 <label for="seed" class="col-sm-2 control-label">BIP39 Seed</label>
193 <div class="col-sm-10">
194 <textarea id="seed" class="seed form-control" readonly="readonly"></textarea>
195 </div>
196 </div>
4d457a38
IC
197 <div class="form-group">
198 <label for="network-phrase" class="col-sm-2 control-label">Coin</label>
199 <div class="col-sm-10">
200 <select id="network-phrase" class="network form-control">
7f15cb6e 201 <!-- populated by javascript -->
4d457a38
IC
202 </select>
203 </div>
204 </div>
ebd8d4e8
IC
205 <div class="form-group">
206 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
207 <div class="col-sm-10">
efe41586 208 <textarea id="root-key" class="root-key form-control"></textarea>
ebd8d4e8
IC
209 </div>
210 </div>
211 </form>
212 </div>
213 </div>
214
215 <hr>
216
217 <div class="row">
218 <div class="col-md-12">
219 <h2>Derivation Path</h2>
220 <ul class="derivation-type nav nav-tabs" role="tablist">
55a9e51a 221 <li id="bip44-tab" class="active">
23d4a0f1
IC
222 <a href="#bip44" role="tab" data-toggle="tab">BIP44</a>
223 </li>
3b40653f 224 <li id="bip32-tab">
23d4a0f1
IC
225 <a href="#bip32" role="tab" data-toggle="tab">BIP32</a>
226 </li>
ebd8d4e8
IC
227 </ul>
228 <div class="derivation-type tab-content">
55a9e51a 229 <div id="bip44" class="tab-pane active">
ebd8d4e8
IC
230 <form class="form-horizontal" role="form">
231 <br>
232 <div class="col-sm-2"></div>
233 <div class="col-sm-10">
234 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a></p>
235 </div>
236 <div class="form-group">
237 <label for="purpose" class="col-sm-2 control-label">
238 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
239 </label>
240 <div class="col-sm-10">
241 <input id="purpose" type="text" class="purpose form-control" value="44">
242 </div>
243 </div>
244 <div class="form-group">
245 <label for="coin" class="col-sm-2 control-label">
246 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
247 </label>
248 <div class="col-sm-10">
249 <input id="coin" type="text" class="coin form-control" value="0">
250 </div>
251 </div>
252 <div class="form-group">
253 <label for="account" class="col-sm-2 control-label">
254 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
255 </label>
256 <div class="col-sm-10">
257 <input id="account" type="text" class="account form-control" value="0">
258 </div>
259 </div>
260 <div class="form-group">
261 <label for="change" class="col-sm-2 control-label">
262 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
263 </label>
264 <div class="col-sm-10">
265 <input id="change" type="text" class="change form-control" value="0">
266 </div>
267 </div>
268 <div class="form-group">
269 <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
270 <div class="col-sm-10">
d198865f 271 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly">
ebd8d4e8
IC
272 </div>
273 </div>
274 </form>
275 </div>
276 <div id="bip32" class="tab-pane">
277 <form class="form-horizontal" role="form">
278 <br>
279 <div class="col-sm-2"></div>
280 <div class="col-sm-10">
281 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a></p>
282 </div>
283 <div class="form-group">
284 <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
285 <div class="col-sm-10">
286 <input id="bip32-path" type="text" class="path form-control" value="m/0">
287 </div>
288 </div>
146e089e
IC
289 <div class="form-group">
290 <div class="col-sm-2"></div>
291 <label class="col-sm-10">
292 <input class="hardened-addresses" type="checkbox">
293 Use hardened addresses
294 </label>
295 </div>
55a9e51a
IC
296 <div class="form-group">
297 <label class="col-sm-2 control-label">Hive Wallet</label>
298 <div class="col-sm-10">
299 <p class="form-control no-border">
300 Use path <code>m/0'/0</code>.
301 For more info see the <a href="https://www.hivewallet.com/" target="_blank">Hive Wallet homepage</a>
302 </p>
303 </div>
304 </div>
305 <div class="form-group">
306 <label for="mycelium-path" class="col-sm-2 control-label">Mycelium Wallet</label>
307 <div class="col-sm-10">
308 <p class="form-control no-border">
309 Use path <code>m/44'/0'/0'/0</code>.
310 For more info see the <a href="http://www.mycelium.com/" target="_blank">Mycelium Wallet homepage</a>
311 </p>
312 </div>
313 </div>
8786746b
IC
314 <div class="form-group">
315 <label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label>
316 <div class="col-sm-10">
317 <p class="form-control no-border">
318 Use path <code>m/0'/0'</code> with hardened addresses.
319 For more info see the <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a>
320 </p>
321 </div>
322 </div>
aa51da11
IC
323 <div class="form-group">
324 <label class="col-sm-2 control-label">Block Explorers</label>
325 <div class="col-sm-10">
326 <p class="form-control no-border">
327 Use path <code>m/44'/0'/0'</code>.
328 Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xpriv</code> key.
329 </p>
330 </div>
331 </div>
ebd8d4e8
IC
332 </form>
333 </div>
334 </div>
335 <form class="form-horizontal" role="form">
336 <div class="form-group">
337 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Key</label>
338 <div class="col-sm-10">
d198865f 339 <textarea id="extended-priv-key" class="extended-priv-key form-control" readonly="readonly"></textarea>
ebd8d4e8
IC
340 </div>
341 </div>
342 <div class="form-group">
343 <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Key (addresses only)</label>
344 <div class="col-sm-10">
d198865f 345 <textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly"></textarea>
ebd8d4e8
IC
346 </div>
347 </div>
348 </form>
349 </div>
350 </div>
351
352 <hr>
353
354 <div class="row">
355 <div class="col-md-12">
356 <h2>Derived Addresses</h2>
357 <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p>
358 <table class="table table-striped">
359 <thead>
360 <th>
361 <div class="input-group">
ae30fed8 362 Path&nbsp;&nbsp;
ebd8d4e8
IC
363 <button class="index-toggle">Toggle</button>
364 </div>
365 </th>
366 <th>
367 <div class="input-group">
368 Address&nbsp;&nbsp;
369 <button class="address-toggle">Toggle</button>
370 </div>
371 </th>
1b12b2f5
IC
372 <th>
373 <div class="input-group">
374 Public Key&nbsp;&nbsp;
375 <button class="public-key-toggle">Toggle</button>
376 </div>
377 </th>
ebd8d4e8
IC
378 <th>
379 <div class="input-group">
380 Private Key&nbsp;&nbsp;
381 <button class="private-key-toggle">Toggle</button>
382 </div>
383 </th>
384 </thead>
d737abf6 385 <tbody class="addresses monospace">
ebd8d4e8
IC
386 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
387 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
388 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
389 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
390 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
391 </tbody>
392 </table>
393 </div>
394 </div>
395 <span>Show next </button>
396 <input type="number" class="rows-to-add" value="20">
397 <button class="more">Show</button>
398
399 <hr>
400
401 <div class="row">
402 <div class="col-md-12">
403 <h2>More info</h2>
404 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
405 <p>
406 Read more at the
407 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
408 </p>
409 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
410 <p>
411 Read more at the
412 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
413 and see the demo at
414 <a href="http://bip32.org/" target="_blank">bip32.org</a>
415 </p>
416 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
417 <p>
418 Read more at the
419 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
420 </p>
421 <h3>Private Keys</h3>
422 <p>
423 Use private keys at
c90c680e 424 <a href="https://web.archive.org/web/20150707020924/https://brainwallet.org/" target="_blank">brainwallet.org</a>,
ebd8d4e8
IC
425 but be careful - it can be easy to make mistakes if you
426 don't know what you're doing
427 </p>
c6624d51
IC
428 <h3 id="entropy-notes">Entropy</h3>
429 <p>
430 Entropy values must be sourced from a
431 <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>.
432 This means flipping a fair coin, rolling a fair dice, noise measurements etc. Do <strong>NOT</strong> use
433 phrases from books, lyrics from songs, your birthday or steet address, keyboard mashing, or anything you <i>think</i>
434 is random, because chances are <em>overwhelming</em> that it isn't random enough for the needs of this tool.
435 </p>
436 <p>
437 The random mnemonic generator on this page uses a
438 <a href="https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues" target="_blank">cryptographically secure random number generator</a>,
439 and can generally be trusted more than your own intuition about randomness.
440 If cryptographic randomness isn't available in your browser, this page will show a warning and <i>will not generate
441 random mnemonics</i>.
442 </p>
443 <p>
444 <a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank">You are not a good source of entropy.</a>
445 </p>
ebd8d4e8
IC
446 </div>
447 </div>
45b8a745
IC
448
449 <hr>
450
c5863485
IC
451 <div class="row">
452 <div class="col-md-12">
453
454 <h2>Offline Usage</h2>
455
456 <p>
457 You can use this tool without having to be online.
458 </p>
459 <p>
460 In your browser, select file save-as, and save this page
461 as a file.
462 </p>
463 <p>
464 Double-click that file to open it in a browser
465 on any offline computer.
466 </p>
467 <p>
468 Alternatively, download it from
b630f83d
IC
469 <a href="https://github.com/iancoleman/bip39">
470 https://github.com/iancoleman/bip39
c5863485
IC
471 </a>
472
473 </div>
474 </div>
475
476 <hr>
477
45b8a745
IC
478 <div class="row">
479 <div class="col-md-12">
480
481 <h2>This project is 100% open-source code</h2>
482
483 <p>
484 <span>Get the source code at - </span>
b630f83d
IC
485 <a href="https://github.com/iancoleman/bip39" target="_blank">
486 https://github.com/iancoleman/bip39
45b8a745
IC
487 </a>
488 </p>
489
490 <h3>Libraries</h3>
491
492 <p>
493 <span>BitcoinJS - </span>
494 <a href="https://github.com/bitcoinjs/bitcoinjs-lib" target="_blank">
495 https://github.com/bitcoinjs/bitcoinjs-lib
496 </a>
497 </p>
498
499 <p>
500 <span>jsBIP39 - </span>
501 <a href="https://github.com/iancoleman/jsbip39" target="_blank">
502 https://github.com/iancoleman/jsbip39
503 </a>
504 </p>
505
506 <p>
0937f3ab
IC
507 <span>sjcl - </span>
508 <a href="https://github.com/bitwiseshiftleft/sjcl" target="_blank">
509 https://github.com/bitwiseshiftleft/sjcl
45b8a745
IC
510 </a>
511 </p>
512
513 <p>
514 <span>jQuery - </span>
515 <a href="https://jquery.com/" target="_blank">
516 https://jquery.com/
517 </a>
518 </p>
519
520 <p>
521 <span>Twitter Bootstrap - </span>
522 <a href="http://getbootstrap.com/" target="_blank">
523 http://getbootstrap.com/
524 </a>
525 </p>
526
527 </div>
528 </div>
529
ebd8d4e8
IC
530 </div>
531
532 <div class="feedback-container">
d26cce22 533 <div class="feedback">Loading...</div>
ebd8d4e8
IC
534 </div>
535
536 <script type="text/template" id="address-row-template">
537 <tr>
538 <td class="index"><span></span></td>
539 <td class="address"><span></span></td>
1b12b2f5 540 <td class="pubkey"><span></span></td>
ebd8d4e8
IC
541 <td class="privkey"><span></span></td>
542 </tr>
543 </script>
cee442b1
KK
544 <script src="js/jquery.min.js"></script>
545 <script src="js/bootstrap.min.js"></script>
563e401a 546 <script src="js/levenshtein.js"></script>
cee442b1
KK
547 <script src="js/bitcoinjs-1-5-7.js"></script>
548 <script src="js/bitcoinjs-extensions.js"></script>
549 <script src="js/sjcl-bip39.js"></script>
550 <script src="js/wordlist_english.js"></script>
3a8dbe99
IC
551 <script src="js/wordlist_japanese.js"></script>
552 <script src="js/wordlist_spanish.js"></script>
553 <script src="js/wordlist_chinese_simplified.js"></script>
554 <script src="js/wordlist_chinese_traditional.js"></script>
555 <script src="js/wordlist_french.js"></script>
556 <script src="js/wordlist_italian.js"></script>
cee442b1 557 <script src="js/jsbip39.js"></script>
b299a6a7 558 <script src="js/zxcvbn.js"></script>
c6624d51 559 <script src="js/entropy.js"></script>
cee442b1 560 <script src="js/index.js"></script>
ebd8d4e8
IC
561 </body>
562</html>