]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - src/index.html
Entropy can be supplied by user
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / index.html
index 184e7d51fed4d2579bf69ef977aab26b2bc2d70f..cb7a7817aca290fbeb72204d79f80998db700010 100644 (file)
@@ -3,11 +3,11 @@
     <head lang="en">
         <meta charset="utf-8" />
         <title>BIP39 - Mnemonic Code</title>
-        <link rel="stylesheet" href="/css/bootstrap.min.css">
+        <link rel="stylesheet" href="css/bootstrap.min.css">
         <meta content="Mnemonic code for generating deterministic keys" name="description"/>
         <meta content="width=device-width, initial-scale=1.0" name="viewport" />
         <meta content="bitcoin mnemonic converter" name="description" />
-        <meta content="DC POS" name="author" />
+        <meta content="Ian Coleman" name="author" />
 
         <style>
             body {
                 border-bottom-left-radius: 20px 20px;
                 border-bottom-right-radius: 20px 20px;
             }
+            .no-border {
+                border: 0;
+                box-shadow: inset 0 1px 1px rgba(0,0,0,.0);
+                -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.0);
+            }
+            .phrase {
+                word-break: keep-all;
+            }
+            .strength {
+                /* override mobile width from bootstrap */
+                width: auto!important;
+                display: inline-block;
+            }
+            .languages * {
+                padding-left: 10px;
+            }
+            .monospace {
+                font-family: monospace;
+            }
         </style>
     </head>
     <body>
                 <div class="col-md-12">
                     <h2>Mnemonic</h2>
                     <form class="form-horizontal" role="form">
-                        <div class="col-sm-2"></div>
-                        <div class="col-sm-10">
-                            <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>
-                            <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p>
+                        <div class="form-group">
+                            <div class="col-sm-2"></div>
+                            <div class="col-sm-10">
+                                <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>
+                                <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p>
+                            </div>
+                        </div>
+                        <div class="form-group generate-container">
+                            <label class="col-sm-2 control-label"></label>
+                            <div class="col-sm-10">
+                                <div class="form-inline">
+                                    <div class="input-group-inline">
+                                        <button class="btn generate">Generate</button>
+                                        <span>a random</span>
+                                        <select id="strength" class="strength form-control">
+                                            <option value="3">3</option>
+                                            <option value="6">6</option>
+                                            <option value="9">9</option>
+                                            <option value="12">12</option>
+                                            <option value="15" selected>15</option>
+                                            <option value="18">18</option>
+                                            <option value="21">21</option>
+                                            <option value="24">24</option>
+                                        </select>
+                                        word mnemonic, or enter your own below.
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="entropy-container hidden">
+                            <label for="entropy" class="col-sm-2 control-label">Entropy</label>
+                            <div class="col-sm-10">
+                                <input id="entropy" class="entropy form-control" placeholder="Accepts binary, base 6, 6-sided dice, base 10, hexadecimal">
+                                <span class="help-block">
+                                    <div class="text-danger">
+                                    This is an advanced feature.
+                                    Your mnemonic may be insecure if this feature is used incorrectly.
+                                    <a href="#entropy-notes">Read more</a>
+                                    </div>
+                                    <div class="text-danger entropy-error"></div>
+                               </span>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <div class="col-sm-2"></div>
+                            <div class="col-sm-10 checkbox">
+                                <label>
+                                    <input type="checkbox" class="use-entropy">
+                                    Supply my own source of entropy
+                                </label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label"></label>
+                            <div class="col-sm-10 languages">
+                                <a href="#english">English</a>
+                                <a href="#japanese" title="Japanese">日本語</a>
+                                <a href="#spanish"  title="Spanish">Español</a>
+                                <a href="#chinese_simplified"  title="Chinese (Simplified)">中文(简体)</a>
+                                <a href="#chinese_traditional"  title="Chinese (Traditional)">中文(繁體)</a>
+                                <a href="#french"  title="French">Français</a>
+                                <a href="#italian"  title="Italian">Italiano</a>
+                            </div>
                         </div>
                         <div class="form-group">
                             <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
                             </div>
                         </div>
                         <div class="form-group">
-                            <label for="strength" class="col-sm-2 control-label">Number of words</label>
+                            <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
                             <div class="col-sm-10">
-                                <div class="input-group">
-                                    <input type="number" class="strength form-control" id="strength" value="12">
-                                    <span class="input-group-btn">
-                                        <button class="btn generate">Generate Random Mnemonic</button>
-                                    </span>
-                                </div>
+                                <textarea id="passphrase" class="passphrase form-control"></textarea>
                             </div>
                         </div>
                         <div class="form-group">
-                            <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
+                            <label for="seed" class="col-sm-2 control-label">BIP39 Seed</label>
                             <div class="col-sm-10">
-                                <textarea id="passphrase" class="passphrase form-control"></textarea>
+                                <textarea id="seed" class="seed form-control" readonly="readonly"></textarea>
                             </div>
                         </div>
                         <div class="form-group">
                         <div class="form-group">
                             <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
                             <div class="col-sm-10">
-                                <textarea id="root-key" class="root-key form-control" readonly="readonly"></textarea>
+                                <textarea id="root-key" class="root-key form-control"></textarea>
                             </div>
                         </div>
                     </form>
                 <div class="col-md-12">
                     <h2>Derivation Path</h2>
                     <ul class="derivation-type nav nav-tabs" role="tablist">
-                        <li id="hive-tab" class="active">
-                            <a href="#hive" role="tab" data-toggle="tab">Hive Wallet</a>
-                        </li>
-                        <li id="mycelium-tab">
-                            <a href="#mycelium" role="tab" data-toggle="tab">Mycelium Wallet</a>
-                        </li>
-                        <li id="bip44-tab">
+                        <li id="bip44-tab" class="active">
                             <a href="#bip44" role="tab" data-toggle="tab">BIP44</a>
                         </li>
                         <li id="bip32-tab">
                         </li>
                     </ul>
                     <div class="derivation-type tab-content">
-                        <div id="hive" class="tab-pane active">
-                            <form class="form-horizontal" role="form">
-                                <br>
-                                <div class="col-sm-2"></div>
-                                <div class="col-sm-10">
-                                    <p>For more info see the <a href="https://www.hivewallet.com/" target="_blank">Hive Wallet homepage</a></p>
-                                </div>
-                                <div class="form-group">
-                                    <label for="hive-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
-                                    <div class="col-sm-10">
-                                        <input id="hive-path" type="text" class="path form-control" value="m/0'/0" readonly="readonly">
-                                    </div>
-                                </div>
-                            </form>
-                        </div>
-                        <div id="mycelium" class="tab-pane">
-                            <form class="form-horizontal" role="form">
-                                <br>
-                                <div class="col-sm-2"></div>
-                                <div class="col-sm-10">
-                                    <p>For more info see the <a href="http://www.mycelium.com/" target="_blank">Mycelium Wallet homepage</a></p>
-                                </div>
-                                <div class="form-group">
-                                    <label for="mycelium-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
-                                    <div class="col-sm-10">
-                                        <input id="mycelium-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly">
-                                    </div>
-                                </div>
-                            </form>
-                        </div>
-                        <div id="bip44" class="tab-pane">
+                        <div id="bip44" class="tab-pane active">
                             <form class="form-horizontal" role="form">
                                 <br>
                                 <div class="col-sm-2"></div>
                                         <input id="bip32-path" type="text" class="path form-control" value="m/0">
                                     </div>
                                 </div>
+                                <div class="form-group">
+                                    <div class="col-sm-2"></div>
+                                    <label class="col-sm-10">
+                                        <input class="hardened-addresses" type="checkbox">
+                                        Use hardened addresses
+                                    </label>
+                                </div>
+                                <div class="form-group">
+                                    <label class="col-sm-2 control-label">Hive Wallet</label>
+                                    <div class="col-sm-10">
+                                        <p class="form-control no-border">
+                                        Use path <code>m/0'/0</code>.
+                                        For more info see the <a href="https://www.hivewallet.com/" target="_blank">Hive Wallet homepage</a>
+                                        </p>
+                                    </div>
+                                </div>
+                                <div class="form-group">
+                                    <label for="mycelium-path" class="col-sm-2 control-label">Mycelium Wallet</label>
+                                    <div class="col-sm-10">
+                                        <p class="form-control no-border">
+                                        Use path <code>m/44'/0'/0'/0</code>.
+                                        For more info see the <a href="http://www.mycelium.com/" target="_blank">Mycelium Wallet homepage</a>
+                                        </p>
+                                    </div>
+                                </div>
+                                <div class="form-group">
+                                    <label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label>
+                                    <div class="col-sm-10">
+                                        <p class="form-control no-border">
+                                        Use path <code>m/0'/0'</code> with hardened addresses.
+                                        For more info see the <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a>
+                                        </p>
+                                    </div>
+                                </div>
+                                <div class="form-group">
+                                    <label class="col-sm-2 control-label">Block Explorers</label>
+                                    <div class="col-sm-10">
+                                        <p class="form-control no-border">
+                                        Use path <code>m/44'/0'/0'</code>.
+                                        Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xpriv</code> key.
+                                        </p>
+                                    </div>
+                                </div>
                             </form>
                         </div>
                     </div>
                         <thead>
                             <th>
                                 <div class="input-group">
-                                    Index&nbsp;&nbsp;
+                                    Path&nbsp;&nbsp;
                                     <button class="index-toggle">Toggle</button>
                                 </div>
                             </th>
                                     <button class="address-toggle">Toggle</button>
                                 </div>
                             </th>
+                            <th>
+                                <div class="input-group">
+                                    Public Key&nbsp;&nbsp;
+                                    <button class="public-key-toggle">Toggle</button>
+                                </div>
+                            </th>
                             <th>
                                 <div class="input-group">
                                     Private Key&nbsp;&nbsp;
                                 </div>
                             </th>
                         </thead>
-                        <tbody class="addresses">
+                        <tbody class="addresses monospace">
                             <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
                             <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
                             <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
                         but be careful - it can be easy to make mistakes if you
                         don't know what you're doing
                     </p>
+                    <h3 id="entropy-notes">Entropy</h3>
+                    <p>
+                    Entropy values must be sourced from a
+                    <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>.
+                    This means flipping a fair coin, rolling a fair dice, noise measurements etc. Do <strong>NOT</strong> use
+                    phrases from books, lyrics from songs, your birthday or steet address, keyboard mashing, or anything you <i>think</i>
+                    is random, because chances are <em>overwhelming</em> that it isn't random enough for the needs of this tool.
+                    </p>
+                    <p>
+                    The random mnemonic generator on this page uses a
+                    <a href="https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues" target="_blank">cryptographically secure random number generator</a>,
+                    and can generally be trusted more than your own intuition about randomness.
+                    If cryptographic randomness isn't available in your browser, this page will show a warning and <i>will not generate
+                    random mnemonics</i>.
+                    </p>
+                    <p>
+                    <a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank">You are not a good source of entropy.</a>
+                    </p>
                 </div>
             </div>
 
                     </p>
                     <p>
                     Alternatively, download it from
-                    <a href="https://github.com/dcpos/bip39">
-                        https://github.com/dcpos/bip39
+                    <a href="https://github.com/iancoleman/bip39">
+                        https://github.com/iancoleman/bip39
                     </a>
 
                 </div>
 
                     <p>
                         <span>Get the source code at - </span>
-                        <a href="https://github.com/dcpos/bip39" target="_blank">
-                            https://github.com/dcpos/bip39
+                        <a href="https://github.com/iancoleman/bip39" target="_blank">
+                            https://github.com/iancoleman/bip39
                         </a>
                     </p>
 
             <tr>
                 <td class="index"><span></span></td>
                 <td class="address"><span></span></td>
+                <td class="pubkey"><span></span></td>
                 <td class="privkey"><span></span></td>
             </tr>
         </script>
-        <script src="/js/jquery.min.js"></script>
-        <script src="/js/bootstrap.min.js"></script>
-        <script src="/js/bitcoinjs-1-5-7.js"></script>
-        <script src="/js/sjcl-bip39.js"></script>
-        <script src="/js/wordlist_english.js"></script>
-        <script src="/js/jsbip39.js"></script>
-        <script src="/js/index.js"></script>
+        <script src="js/jquery.min.js"></script>
+        <script src="js/bootstrap.min.js"></script>
+        <script src="js/levenshtein.js"></script>
+        <script src="js/bitcoinjs-1-5-7.js"></script>
+        <script src="js/bitcoinjs-extensions.js"></script>
+        <script src="js/sjcl-bip39.js"></script>
+        <script src="js/wordlist_english.js"></script>
+        <script src="js/wordlist_japanese.js"></script>
+        <script src="js/wordlist_spanish.js"></script>
+        <script src="js/wordlist_chinese_simplified.js"></script>
+        <script src="js/wordlist_chinese_traditional.js"></script>
+        <script src="js/wordlist_french.js"></script>
+        <script src="js/wordlist_italian.js"></script>
+        <script src="js/jsbip39.js"></script>
+        <script src="js/entropy.js"></script>
+        <script src="js/index.js"></script>
     </body>
 </html>