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