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