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