aboutsummaryrefslogtreecommitdiff
path: root/bip39-standalone.html
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2016-11-30 15:32:26 +1100
committerIan Coleman <coleman.ian@gmail.com>2016-11-30 15:32:26 +1100
commitea87f1d32c4c7218e226376e5a5926c46672eae8 (patch)
treecfabbb6ac441f7227178e10a4689a092f1d0e7fd /bip39-standalone.html
parent87ad2c6e4c7987320d8ce147fe9310b702c5deea (diff)
downloadBIP39-ea87f1d32c4c7218e226376e5a5926c46672eae8.tar.gz
BIP39-ea87f1d32c4c7218e226376e5a5926c46672eae8.tar.zst
BIP39-ea87f1d32c4c7218e226376e5a5926c46672eae8.zip
Translations and new card entropy in standalone
Diffstat (limited to 'bip39-standalone.html')
-rw-r--r--bip39-standalone.html681
1 files changed, 467 insertions, 214 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html
index a373d6a..e8aaaa6 100644
--- a/bip39-standalone.html
+++ b/bip39-standalone.html
@@ -52,9 +52,13 @@
52 width: auto!important; 52 width: auto!important;
53 display: inline-block; 53 display: inline-block;
54 } 54 }
55 .languages * { 55 .languages a {
56 padding-left: 10px; 56 padding-left: 10px;
57 } 57 }
58 .languages a:nth-of-type(1) {
59 margin-left: -12px;
60 padding-left: 0;
61 }
58 .monospace { 62 .monospace {
59 font-family: monospace; 63 font-family: monospace;
60 } 64 }
@@ -95,8 +99,11 @@
95 <div class="form-group"> 99 <div class="form-group">
96 <div class="col-sm-2"></div> 100 <div class="col-sm-2"></div>
97 <div class="col-sm-10"> 101 <div class="col-sm-10">
98 <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> 102 <p data-translate>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>
99 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p> 103 <p data-translate-html>
104 For more info see the
105 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>.
106 </p>
100 </div> 107 </div>
101 </div> 108 </div>
102 <div class="form-group generate-container"> 109 <div class="form-group generate-container">
@@ -104,8 +111,8 @@
104 <div class="col-sm-10"> 111 <div class="col-sm-10">
105 <div class="form-inline"> 112 <div class="form-inline">
106 <div class="input-group-inline"> 113 <div class="input-group-inline">
114 <span data-translate>Generate a random mnemonic, or enter your own below</span>:
107 <button class="btn generate">Generate</button> 115 <button class="btn generate">Generate</button>
108 <span>a random</span>
109 <select id="strength" class="strength form-control"> 116 <select id="strength" class="strength form-control">
110 <option value="3">3</option> 117 <option value="3">3</option>
111 <option value="6">6</option> 118 <option value="6">6</option>
@@ -116,67 +123,66 @@
116 <option value="21">21</option> 123 <option value="21">21</option>
117 <option value="24">24</option> 124 <option value="24">24</option>
118 </select> 125 </select>
119 word mnemonic, or enter your own below. 126 <span data-translate>words</span>
120 </div> 127 </div>
121 </div> 128 </div>
122 </div> 129 </div>
123 </div> 130 </div>
124 <div class="entropy-container hidden"> 131 <div class="entropy-container hidden">
125 <div class="form-group text-danger"> 132 <div class="form-group text-danger">
126 <label class="col-sm-2 control-label">Warning</label> 133 <label class="col-sm-2 control-label" data-translate>Warning</label>
127 <div class="col-sm-10 form-control-static"> 134 <div class="col-sm-10 form-control-static">
128 Entropy is an advanced feature. 135 <span data-translate>Entropy is an advanced feature. Your mnemonic may be insecure if this feature is used incorrectly.</span>
129 Your mnemonic may be insecure if this feature is used incorrectly. 136 <a href="#entropy-notes" data-translate>Read more</a>
130 <a href="#entropy-notes">Read more</a>
131 </div> 137 </div>
132 </div> 138 </div>
133 <div class="form-group"> 139 <div class="form-group">
134 <label for="entropy" class="col-sm-2 control-label">Entropy</label> 140 <label for="entropy" class="col-sm-2 control-label" data-translate>Entropy</label>
135 <div class="col-sm-7"> 141 <div class="col-sm-7">
136 <textarea id="entropy" rows="2" class="entropy form-control" placeholder="Accepts binary, base 6, 6-sided dice, base 10, hexadecimal, cards"></textarea> 142 <textarea id="entropy" rows="2" class="entropy form-control" placeholder="Accepts binary, base 6, 6-sided dice, base 10, hexadecimal, cards" data-translate-placeholder></textarea>
137 <div class="row"> 143 <div class="row">
138 <label class="col-sm-3 control-label">Strength</label> 144 <label class="col-sm-3 control-label" data-translate>Strength</label>
139 <div class="strength col-sm-3 form-control-static"></div> 145 <div class="strength col-sm-3 form-control-static"></div>
140 <label class="col-sm-3 control-label">Event Count</label> 146 <label class="col-sm-3 control-label" data-translate>Event Count</label>
141 <div class="event-count col-sm-3 form-control-static"></div> 147 <div class="event-count col-sm-3 form-control-static"></div>
142 </div> 148 </div>
143 <div class="row"> 149 <div class="row">
144 <label class="col-sm-3 control-label">Entropy Type</label> 150 <label class="col-sm-3 control-label" data-translate>Entropy Type</label>
145 <div class="type col-sm-3 form-control-static"></div> 151 <div class="type col-sm-3 form-control-static"></div>
146 <label class="col-sm-3 control-label">Bits Per Event</label> 152 <label class="col-sm-3 control-label" data-translate>Bits Per Event</label>
147 <div class="bits-per-event col-sm-3 form-control-static"></div> 153 <div class="bits-per-event col-sm-3 form-control-static"></div>
148 </div> 154 </div>
149 <div class="row"> 155 <div class="row">
150 <label class="col-sm-3 control-label">Word Count</label> 156 <label class="col-sm-3 control-label" data-translate>Word Count</label>
151 <div class="word-count col-sm-3 form-control-static"></div> 157 <div class="word-count col-sm-3 form-control-static"></div>
152 <label class="col-sm-3 control-label">Total Bits</label> 158 <label class="col-sm-3 control-label" data-translate>Total Bits</label>
153 <div class="bits col-sm-3 form-control-static"></div> 159 <div class="bits col-sm-3 form-control-static"></div>
154 </div> 160 </div>
155 <label class="col-sm-3 control-label">Filtered Entropy</label> 161 <label class="col-sm-3 control-label" data-translate>Filtered Entropy</label>
156 <div class="filtered col-sm-9 form-control-static"></div> 162 <div class="filtered col-sm-9 form-control-static"></div>
157 <label class="col-sm-3 control-label">Raw Binary</label> 163 <label class="col-sm-3 control-label" data-translate>Raw Binary</label>
158 <div class="binary col-sm-9 form-control-static"></div> 164 <div class="binary col-sm-9 form-control-static"></div>
159 <label class="col-sm-3 control-label">Mnemonic Length</label> 165 <label class="col-sm-3 control-label" data-translate>Mnemonic Length</label>
160 <div class="col-sm-9"> 166 <div class="col-sm-9">
161 <select class="mnemonic-length form-control"> 167 <select class="mnemonic-length form-control">
162 <option value="raw">From entropy length (3 words per 32 bits)</option> 168 <option value="raw" data-translate>From entropy length (3 words per 32 bits)</option>
163 <option value="12">12 Words</option> 169 <option value="12">12 <span data-translate>Words</span></option>
164 <option value="15" selected>15 Words</option> 170 <option value="15" selected>15 <span data-translate>Words</option>
165 <option value="18">18 Words</option> 171 <option value="18">18 <span data-translate>Words</span></option>
166 <option value="21">21 Words</option> 172 <option value="21">21 <span data-translate>Words</span></option>
167 <option value="24">24 Words</option> 173 <option value="24">24 <span data-translate>Words</span></option>
168 </select> 174 </select>
169 </div> 175 </div>
170 </div> 176 </div>
171 <div class="col-sm-3"> 177 <div class="col-sm-3">
172 <p>Valid entropy values include:</p> 178 <p data-translate>Valid entropy values include:</p>
173 <ul> 179 <ul>
174 <li><strong>Binary</strong> [0-1]<br>101010011</li> 180 <li><strong data-translate>Binary</strong> [0-1]<br>101010011</li>
175 <li><strong>Base 6</strong> [0-5]<br>123434014</li> 181 <li><strong data-translate>Base 6</strong> [0-5]<br>123434014</li>
176 <li><strong>Dice</strong> [1-6]<br>62535634</li> 182 <li><strong data-translate>Dice</strong> [1-6]<br>62535634</li>
177 <li><strong>Base 10</strong> [0-9]<br>90834528</li> 183 <li><strong data-translate>Base 10</strong> [0-9]<br>90834528</li>
178 <li><strong>Hex</strong> [0-9A-F]<br>4187a8bfd9</li> 184 <li><strong data-translate>Hex</strong> [0-9A-F]<br>4187a8bfd9</li>
179 <li><strong>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc</li> 185 <li><strong data-translate>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc</li>
180 </ul> 186 </ul>
181 </div> 187 </div>
182 </div> 188 </div>
@@ -186,42 +192,44 @@
186 <div class="col-sm-10 checkbox"> 192 <div class="col-sm-10 checkbox">
187 <label> 193 <label>
188 <input type="checkbox" class="use-entropy"> 194 <input type="checkbox" class="use-entropy">
189 Supply my own source of entropy 195 <span data-translate>Supply my own source of entropy</span>
190 </label> 196 </label>
191 </div> 197 </div>
192 </div> 198 </div>
193 <div class="form-group"> 199 <div class="form-group">
194 <label class="col-sm-2 control-label"></label> 200 <label class="col-sm-2 control-label" data-translate>Mnemonic Language</label>
195 <div class="col-sm-10 languages"> 201 <div class="col-sm-10 languages">
196 <a href="#english">English</a> 202 <div class="form-control no-border">
197 <a href="#japanese" title="Japanese">日本語</a> 203 <a href="#english">English</a>
198 <a href="#spanish" title="Spanish">Español</a> 204 <a href="#japanese" title="Japanese">日本語</a>
199 <a href="#chinese_simplified" title="Chinese (Simplified)">中文(简体)</a> 205 <a href="#spanish" title="Spanish">Español</a>
200 <a href="#chinese_traditional" title="Chinese (Traditional)">中文(繁體)</a> 206 <a href="#chinese_simplified" title="Chinese (Simplified)">中文(简体)</a>
201 <a href="#french" title="French">Français</a> 207 <a href="#chinese_traditional" title="Chinese (Traditional)">中文(繁體)</a>
202 <a href="#italian" title="Italian">Italiano</a> 208 <a href="#french" title="French">Français</a>
209 <a href="#italian" title="Italian">Italiano</a>
210 </div>
203 </div> 211 </div>
204 </div> 212 </div>
205 <div class="form-group"> 213 <div class="form-group">
206 <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label> 214 <label for="phrase" class="col-sm-2 control-label" data-translate>BIP39 Mnemonic</label>
207 <div class="col-sm-10"> 215 <div class="col-sm-10">
208 <textarea id="phrase" class="phrase form-control"></textarea> 216 <textarea id="phrase" class="phrase form-control"></textarea>
209 </div> 217 </div>
210 </div> 218 </div>
211 <div class="form-group"> 219 <div class="form-group">
212 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label> 220 <label for="passphrase" class="col-sm-2 control-label" data-translate>BIP39 Passphrase (optional)</label>
213 <div class="col-sm-10"> 221 <div class="col-sm-10">
214 <textarea id="passphrase" class="passphrase form-control"></textarea> 222 <textarea id="passphrase" class="passphrase form-control"></textarea>
215 </div> 223 </div>
216 </div> 224 </div>
217 <div class="form-group"> 225 <div class="form-group">
218 <label for="seed" class="col-sm-2 control-label">BIP39 Seed</label> 226 <label for="seed" class="col-sm-2 control-label" data-translate>BIP39 Seed</label>
219 <div class="col-sm-10"> 227 <div class="col-sm-10">
220 <textarea id="seed" class="seed form-control" readonly="readonly"></textarea> 228 <textarea id="seed" class="seed form-control" readonly="readonly"></textarea>
221 </div> 229 </div>
222 </div> 230 </div>
223 <div class="form-group"> 231 <div class="form-group">
224 <label for="network-phrase" class="col-sm-2 control-label">Coin</label> 232 <label for="network-phrase" class="col-sm-2 control-label" data-translate>Coin</label>
225 <div class="col-sm-10"> 233 <div class="col-sm-10">
226 <select id="network-phrase" class="network form-control"> 234 <select id="network-phrase" class="network form-control">
227 <!-- populated by javascript --> 235 <!-- populated by javascript -->
@@ -229,7 +237,7 @@
229 </div> 237 </div>
230 </div> 238 </div>
231 <div class="form-group"> 239 <div class="form-group">
232 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label> 240 <label for="root-key" class="col-sm-2 control-label" data-translate>BIP32 Root Key</label>
233 <div class="col-sm-10"> 241 <div class="col-sm-10">
234 <textarea id="root-key" class="root-key form-control"></textarea> 242 <textarea id="root-key" class="root-key form-control"></textarea>
235 </div> 243 </div>
@@ -257,11 +265,14 @@
257 <br> 265 <br>
258 <div class="col-sm-2"></div> 266 <div class="col-sm-2"></div>
259 <div class="col-sm-10"> 267 <div class="col-sm-10">
260 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a></p> 268 <p data-translate-html>
269 For more info see the
270 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a>.
271 </p>
261 </div> 272 </div>
262 <div class="form-group"> 273 <div class="form-group">
263 <label for="purpose" class="col-sm-2 control-label"> 274 <label for="purpose" class="col-sm-2 control-label">
264 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a> 275 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank" data-translate>Purpose</a>
265 </label> 276 </label>
266 <div class="col-sm-10"> 277 <div class="col-sm-10">
267 <input id="purpose" type="text" class="purpose form-control" value="44"> 278 <input id="purpose" type="text" class="purpose form-control" value="44">
@@ -269,7 +280,7 @@
269 </div> 280 </div>
270 <div class="form-group"> 281 <div class="form-group">
271 <label for="coin" class="col-sm-2 control-label"> 282 <label for="coin" class="col-sm-2 control-label">
272 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a> 283 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank" data-translate>Coin</a>
273 </label> 284 </label>
274 <div class="col-sm-10"> 285 <div class="col-sm-10">
275 <input id="coin" type="text" class="coin form-control" value="0"> 286 <input id="coin" type="text" class="coin form-control" value="0">
@@ -277,7 +288,7 @@
277 </div> 288 </div>
278 <div class="form-group"> 289 <div class="form-group">
279 <label for="account" class="col-sm-2 control-label"> 290 <label for="account" class="col-sm-2 control-label">
280 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a> 291 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank" data-translate>Account</a>
281 </label> 292 </label>
282 <div class="col-sm-10"> 293 <div class="col-sm-10">
283 <input id="account" type="text" class="account form-control" value="0"> 294 <input id="account" type="text" class="account form-control" value="0">
@@ -285,14 +296,14 @@
285 </div> 296 </div>
286 <div class="form-group"> 297 <div class="form-group">
287 <label for="change" class="col-sm-2 control-label"> 298 <label for="change" class="col-sm-2 control-label">
288 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a> 299 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank" data-translate>External / Internal</a>
289 </label> 300 </label>
290 <div class="col-sm-10"> 301 <div class="col-sm-10">
291 <input id="change" type="text" class="change form-control" value="0"> 302 <input id="change" type="text" class="change form-control" value="0">
292 </div> 303 </div>
293 </div> 304 </div>
294 <div class="form-group"> 305 <div class="form-group">
295 <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label> 306 <label for="bip44-path" class="col-sm-2 control-label" data-translate>BIP32 Derivation Path</label>
296 <div class="col-sm-10"> 307 <div class="col-sm-10">
297 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly"> 308 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly">
298 </div> 309 </div>
@@ -304,10 +315,13 @@
304 <br> 315 <br>
305 <div class="col-sm-2"></div> 316 <div class="col-sm-2"></div>
306 <div class="col-sm-10"> 317 <div class="col-sm-10">
307 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a></p> 318 <p data-translate>
319 For more info see the
320 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a>
321 </p>
308 </div> 322 </div>
309 <div class="form-group"> 323 <div class="form-group">
310 <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label> 324 <label for="bip32-path" class="col-sm-2 control-label" data-translate>BIP32 Derivation Path</label>
311 <div class="col-sm-10"> 325 <div class="col-sm-10">
312 <input id="bip32-path" type="text" class="path form-control" value="m/0"> 326 <input id="bip32-path" type="text" class="path form-control" value="m/0">
313 </div> 327 </div>
@@ -316,49 +330,52 @@
316 <div class="col-sm-2"></div> 330 <div class="col-sm-2"></div>
317 <label class="col-sm-10"> 331 <label class="col-sm-10">
318 <input class="hardened-addresses" type="checkbox"> 332 <input class="hardened-addresses" type="checkbox">
319 Use hardened addresses 333 <span data-translate>Use hardened addresses</span>
320 </label> 334 </label>
321 </div> 335 </div>
322 <div class="form-group"> 336 <div class="form-group">
323 <label for="mycelium-path" class="col-sm-2 control-label">Mycelium Wallet</label> 337 <label for="mycelium-path" class="col-sm-2 control-label" data-translate>Mycelium Wallet</label>
324 <div class="col-sm-10"> 338 <div class="col-sm-10">
325 <p class="form-control no-border"> 339 <p class="form-control no-border" data-translate-html>
326 <code>m/44'/0'/0'</code> generates extended keys for import / export. 340 <code>m/44'/0'/0'</code> generates extended keys for import / export
327 </p> 341 </p>
328 <p class="form-control no-border"> 342 <p class="form-control no-border" data-translate-html>
329 <code>m/44'/0'/1'</code> to generate the next account. Continue incrementing for more accounts (most use a single account). 343 <code>m/44'/0'/1'</code> for the next account. Continue incrementing for more accounts (most use a single account).
330 </p> 344 </p>
331 <p class="form-control no-border"> 345 <p class="form-control no-border" data-translate-html>
332 <code>m/44'/0'/0'/0</code> to generate public addresses. 346 <code>m/44'/0'/0'/0</code> generates public addresses
333 </p> 347 </p>
334 <p class="form-control no-border"> 348 <p class="form-control no-border" data-translate-html>
335 <code>m/44'/0'/0'/1</code> to generate change addresses. 349 <code>m/44'/0'/0'/1</code> generates change addresses
336 </p> 350 </p>
337 <p class="form-control no-border"> 351 <p class="form-control no-border" data-translate-html>
338 For more info see the <a href="http://www.mycelium.com/" target="_blank">Mycelium Wallet homepage</a> 352 For more info see the
353 <a href="http://www.mycelium.com/" target="_blank">Mycelium Wallet homepage</a>
339 </p> 354 </p>
340 </div> 355 </div>
341 </div> 356 </div>
342 <div class="form-group"> 357 <div class="form-group">
343 <label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label> 358 <label for="core-path" class="col-sm-2 control-label" data-translate>Bitcoin Core</label>
344 <div class="col-sm-10"> 359 <div class="col-sm-10">
345 <p class="form-control no-border"> 360 <p class="form-control no-border" data-translate-html>
346 Use path <code>m/0'/0'</code> with hardened addresses. 361 Use path <code>m/0'/0'</code> with hardened addresses.
347 </p> 362 </p>
348 <p class="form-control no-border"> 363 <p class="form-control no-border" data-translate-html>
349 For more info see the <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a> 364 For more info see the
365 <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a>
350 </p> 366 </p>
351 </div> 367 </div>
352 </div> 368 </div>
353 <div class="form-group"> 369 <div class="form-group">
354 <label class="col-sm-2 control-label">Block Explorers</label> 370 <label class="col-sm-2 control-label" data-translate>Block Explorers</label>
355 <div class="col-sm-10"> 371 <div class="col-sm-10">
356 <p class="form-control no-border"> 372 <p class="form-control no-border">
357 Use path <code>m/44'/0'/0'</code>. 373 <span data-translate-html>Use path <code>m/44'/0'/0'</code>.</span>
358 Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xprv</code> key. 374 <span data-translate-html>Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xprv</code> key.</span>
359 </p> 375 </p>
360 <p class="form-control no-border"> 376 <p class="form-control no-border">
361 Supported by <a href="https://blockchain.info/" target="_blank">blockchain.info</a>. 377 <span data-translate>Can be used with</span>:
378 <a href="https://blockchain.info/" target="_blank">blockchain.info</a>
362 </p> 379 </p>
363 </div> 380 </div>
364 </div> 381 </div>
@@ -367,13 +384,13 @@
367 </div> 384 </div>
368 <form class="form-horizontal" role="form"> 385 <form class="form-horizontal" role="form">
369 <div class="form-group"> 386 <div class="form-group">
370 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Key</label> 387 <label for="extended-priv-key" class="col-sm-2 control-label" data-translate>BIP32 Extended Key</label>
371 <div class="col-sm-10"> 388 <div class="col-sm-10">
372 <textarea id="extended-priv-key" class="extended-priv-key form-control" readonly="readonly"></textarea> 389 <textarea id="extended-priv-key" class="extended-priv-key form-control" readonly="readonly"></textarea>
373 </div> 390 </div>
374 </div> 391 </div>
375 <div class="form-group"> 392 <div class="form-group">
376 <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Key (addresses only)</label> 393 <label for="extended-pub-key" class="col-sm-2 control-label" data-translate>BIP32 Extended Key (addresses only)</label>
377 <div class="col-sm-10"> 394 <div class="col-sm-10">
378 <textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly"></textarea> 395 <textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly"></textarea>
379 </div> 396 </div>
@@ -387,31 +404,31 @@
387 <div class="row"> 404 <div class="row">
388 <div class="col-md-12"> 405 <div class="col-md-12">
389 <h2>Derived Addresses</h2> 406 <h2>Derived Addresses</h2>
390 <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p> 407 <p data-translate>Note these addreses are derived from the BIP32 Extended Key</p>
391 <table class="table table-striped"> 408 <table class="table table-striped">
392 <thead> 409 <thead>
393 <th> 410 <th>
394 <div class="input-group"> 411 <div class="input-group">
395 Path&nbsp;&nbsp; 412 <span data-translate>Path</span>&nbsp;&nbsp;
396 <button class="index-toggle">Toggle</button> 413 <button class="index-toggle" data-translate>Toggle</button>
397 </div> 414 </div>
398 </th> 415 </th>
399 <th> 416 <th>
400 <div class="input-group"> 417 <div class="input-group">
401 Address&nbsp;&nbsp; 418 <span data-translate>Address</span>&nbsp;&nbsp;
402 <button class="address-toggle">Toggle</button> 419 <button class="address-toggle" data-translate>Toggle</button>
403 </div> 420 </div>
404 </th> 421 </th>
405 <th> 422 <th>
406 <div class="input-group"> 423 <div class="input-group">
407 Public Key&nbsp;&nbsp; 424 <span data-translate>Public Key</span>&nbsp;&nbsp;
408 <button class="public-key-toggle">Toggle</button> 425 <button class="public-key-toggle" data-translate>Toggle</button>
409 </div> 426 </div>
410 </th> 427 </th>
411 <th> 428 <th>
412 <div class="input-group"> 429 <div class="input-group">
413 Private Key&nbsp;&nbsp; 430 <span data-translate>Private Key</span>&nbsp;&nbsp;
414 <button class="private-key-toggle">Toggle</button> 431 <button class="private-key-toggle" data-translate>Toggle</button>
415 </div> 432 </div>
416 </th> 433 </th>
417 </thead> 434 </thead>
@@ -425,56 +442,66 @@
425 </table> 442 </table>
426 </div> 443 </div>
427 </div> 444 </div>
428 <span>Show next </button> 445 <span data-translate>Show more rows</span>:
429 <input type="number" class="rows-to-add" value="20"> 446 <input type="number" class="rows-to-add" value="20">
430 <button class="more">Show</button> 447 <button class="more" data-translate>Show</button>
431 448
432 <hr> 449 <hr>
433 450
434 <div class="row"> 451 <div class="row">
435 <div class="col-md-12"> 452 <div class="col-md-12">
436 <h2>More info</h2> 453 <h2 data-translate>More info</h2>
437 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3> 454 <h3>BIP39 <span class="small" data-translate>Mnemonic code for generating deterministic keys</span></h3>
438 <p> 455 <p data-translate-html>
439 Read more at the 456 Read more at the
440 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a> 457 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
441 </p> 458 </p>
442 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3> 459 <h3>BIP32 <span class="small" data-translate>Hierarchical Deterministic Wallets</span></h3>
443 <p> 460 <p data-translate-html>
444 Read more at the 461 Read more at the
445 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a> 462 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
446 and see the demo at 463 </p>
464 <p data-translate-html>
465 See the demo at
447 <a href="http://bip32.org/" target="_blank">bip32.org</a> 466 <a href="http://bip32.org/" target="_blank">bip32.org</a>
448 </p> 467 </p>
449 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3> 468 <h3>BIP44 <span class="small" data-translate>Multi-Account Hierarchy for Deterministic Wallets</span></h3>
450 <p> 469 <p data-translate-html>
451 Read more at the 470 Read more at the
452 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a> 471 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
453 </p> 472 </p>
454 <h3>Private Keys</h3> 473 <h3 data-translate>Private Keys</h3>
455 <p> 474 <p>
456 Use private keys at 475 <span data-translate-html>
457 <a href="https://web.archive.org/web/20150707020924/https://brainwallet.org/" target="_blank">brainwallet.org</a>, 476 Use private keys at
458 but be careful - it can be easy to make mistakes if you 477 <a href="https://web.archive.org/web/20150707020924/https://brainwallet.org/" target="_blank">brainwallet.org</a>.
459 don't know what you're doing 478 </span>
479 <span data-translate>Be careful - it can be easy to make mistakes if you don't know what you're doing.</span>
460 </p> 480 </p>
461 <h3 id="entropy-notes">Entropy</h3> 481 <h3 id="entropy-notes" data-translate>Entropy</h3>
462 <p> 482 <p>
463 Entropy values must be sourced from a 483 <span data-translate-html>
464 <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>. 484 Entropy values must be sourced from a
465 This means flipping a fair coin, rolling a fair dice, noise measurements etc. Do <strong>NOT</strong> use 485 <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>.
466 phrases from books, lyrics from songs, your birthday or steet address, keyboard mashing, or anything you <i>think</i> 486 </span>
467 is random, because chances are <em>overwhelming</em> that it isn't random enough for the needs of this tool. 487 <span data-translate>This means flipping a fair coin, rolling a fair dice, noise measurements etc.</span>
488 <span data-translate-html>
489 Do <strong>NOT</strong> use phrases from books, lyrics from songs, your birthday or steet address,
490 keyboard mashing, or anything you <i>think</i> is random, because chances are overwhelming it isn't
491 random enough for the needs of this tool.
492 </span>
468 </p> 493 </p>
469 <p> 494 <p>
470 The random mnemonic generator on this page uses a 495 <span data-translate-html>
471 <a href="https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues" target="_blank">cryptographically secure random number generator</a>, 496 The random mnemonic generator on this page uses a
472 and can generally be trusted more than your own intuition about randomness. 497 <a href="https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues" target="_blank">cryptographically secure random number generator</a>.
473 If cryptographic randomness isn't available in your browser, this page will show a warning and <i>will not generate 498 </span>
474 random mnemonics</i>. 499 <span data-translate>The built in random generator can generally be trusted more than your own intuition about randomness.</span>
500 <span data-translate>If cryptographic randomness isn't available in your browser, this page will show a warning and the generate button will not work.</span>
501 <span data-translate>In that case you might choose to use your own source of entropy.</span>
475 </p> 502 </p>
476 <p> 503 <p>
477 <a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank">You are not a good source of entropy.</a> 504 <a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank" data-translate>You are not a good source of entropy.</a>
478 </p> 505 </p>
479 </div> 506 </div>
480 </div> 507 </div>
@@ -484,24 +511,24 @@
484 <div class="row"> 511 <div class="row">
485 <div class="col-md-12"> 512 <div class="col-md-12">
486 513
487 <h2>Offline Usage</h2> 514 <h2 data-translate>Offline Usage</h2>
488 515
489 <p> 516 <p data-translate>
490 You can use this tool without having to be online. 517 You can use this tool without having to be online.
491 </p> 518 </p>
492 <p> 519 <p data-translate>
493 In your browser, select file save-as, and save this page 520 In your browser, select file save-as, and save this page
494 as a file. 521 as a file.
495 </p> 522 </p>
496 <p> 523 <p data-translate>
497 Double-click that file to open it in a browser 524 Double-click that file to open it in a browser
498 on any offline computer. 525 on any offline computer.
499 </p> 526 </p>
500 <p> 527 <p>
501 Alternatively, download it from 528 <span data-translate>Alternatively, download the file from the repository</span>
502 <a href="https://github.com/iancoleman/bip39"> 529 -
503 https://github.com/iancoleman/bip39 530 <a href="https://github.com/iancoleman/bip39">https://github.com/iancoleman/bip39</a>
504 </a> 531 </p>
505 532
506 </div> 533 </div>
507 </div> 534 </div>
@@ -511,16 +538,17 @@
511 <div class="row"> 538 <div class="row">
512 <div class="col-md-12"> 539 <div class="col-md-12">
513 540
514 <h2>This project is 100% open-source code</h2> 541 <h2 data-translate>This project is 100% open-source code</h2>
515 542
516 <p> 543 <p>
517 <span>Get the source code at - </span> 544 <span data-translate>Get the source code from the repository</span>
545 -
518 <a href="https://github.com/iancoleman/bip39" target="_blank"> 546 <a href="https://github.com/iancoleman/bip39" target="_blank">
519 https://github.com/iancoleman/bip39 547 https://github.com/iancoleman/bip39
520 </a> 548 </a>
521 </p> 549 </p>
522 550
523 <h3>Libraries</h3> 551 <h3 data-translate>Libraries</h3>
524 552
525 <p> 553 <p>
526 <span>BitcoinJS - </span> 554 <span>BitcoinJS - </span>
@@ -14608,6 +14636,242 @@ sjcl.hash.sha256.prototype = {
14608 } 14636 }
14609}; 14637};
14610</script> 14638</script>
14639 <script>// An extremely basic translation library
14640//
14641// Example usage:
14642//
14643// Set some html to be translated. Do this using the 'data-translate' attribute:
14644//
14645// <div data-translate>Test</div>
14646// <div data-translate-html><em>keep em tag</em></div>
14647// <input data-translate-placeholder placeholder="Example text">
14648//
14649// Obtain all the phrases to be translated via js debug console:
14650//
14651// Translate.phrasesAsJson();
14652//
14653// Use that template to translate the phrases into another language.
14654// Leave the key the same. Change the value to the new language.
14655//
14656// Create a js file to load the new phrases. In this example for Spanish,
14657// es.js will contain the following code:
14658//
14659// Translate.loadForeignPhrases("es", {
14660// "Test": "Test in Spanish",
14661// "<em>keep em tag</em>": "<em>keep em tag in Spanish</em>",
14662// "Example text": "Example text in Spanish"
14663// });
14664//
14665// In your UI put a listener for clicking on the Spanish button:
14666//
14667// mySpanishButton.addEventListener("click", function() {
14668// Translate.setLanguage("es");
14669// });
14670// myEnglishButton.addEventListener("click", function() {
14671// Translate.setLanguage("en");
14672// });
14673
14674Translate = new (function() {
14675
14676 var defaultLanguage = "en";
14677
14678 var allPhrases = {};
14679 allPhrases[defaultLanguage] = {};
14680
14681 // Node types
14682
14683 var text = {
14684 selector: "[data-translate]",
14685 getKey: function() {
14686 return this.textContent.trim().replace(/\s+/g, " ");
14687 },
14688 setPhrase: function(p) {
14689 this.textContent = p;
14690 },
14691 }
14692
14693 var html = {
14694 selector: "[data-translate-html]",
14695 getKey: function() {
14696 return this.innerHTML.trim().replace(/\s+/g, " ");
14697 },
14698 setPhrase: function(p) {
14699 this.innerHTML = p;
14700 },
14701 }
14702
14703 var placeholder = {
14704 selector: "[data-translate-placeholder]",
14705 getKey: function() {
14706 return this.getAttribute("placeholder").trim().replace(/\s+/g, " ");
14707 },
14708 setPhrase: function(p) {
14709 this.setAttribute("placeholder", p);
14710 },
14711 }
14712
14713 // Get elements to be translated
14714 var allEls = getEls(text)
14715 .concat(getEls(html))
14716 .concat(getEls(placeholder));
14717
14718 // Provides access to phrases from a non-default language.
14719 // See phrases_en.js for example usage.
14720 this.loadForeignPhrases = function(language, phrases) {
14721 allPhrases[language] = phrases;
14722 }
14723
14724 // Displays a different language, eg "en" or "fr"
14725 this.setLanguage = function(language) {
14726 for (var i=0; i<allEls.length; i++) {
14727 var el = allEls[i];
14728 var key = el.key;
14729 if (!(language in allPhrases)) {
14730 console.log(language + " not in allPhrases");
14731 return;
14732 }
14733 if (!(key in allPhrases[language])) {
14734 console.log(language + " does not contain phrase: " + key);
14735 return;
14736 }
14737 var phrase = allPhrases[language][key];
14738 el.setPhrase(phrase);
14739 }
14740 }
14741
14742 // Converts the phrases to a key-pair json file.
14743 // This is a good way to export phrases for use in translation tools.
14744 this.phrasesAsJson = function(language) {
14745 var keys = [];
14746 for (var i=0; i<allEls.length; i++) {
14747 var el = allEls[i];
14748 var key = el.key;
14749 keys.push(key);
14750 }
14751 keys.sort();
14752 var output = {};
14753 for (var i=0; i<keys.length; i++) {
14754 var key = keys[i];
14755 var translated = "";
14756 if (language in allPhrases && key in allPhrases[language]) {
14757 translated = allPhrases[language][key];
14758 }
14759 output[key] = translated;
14760 }
14761 return JSON.stringify(output, null, 2);
14762 }
14763
14764 function getEls(nodeType) {
14765 var nodes = document.querySelectorAll(nodeType.selector);
14766 var els = [];
14767 for (var i=0; i<nodes.length; i++) {
14768 var node = nodes[i];
14769 node.getKey = nodeType.getKey;
14770 node.setPhrase = nodeType.setPhrase;
14771 node.key = node.getKey();
14772 allPhrases[defaultLanguage][node.key] = node.key;
14773 els.push(node);
14774 }
14775 return els;
14776 }
14777
14778})();
14779</script>
14780 <script>Translate.loadForeignPhrases("en",
14781{
14782 "<code>m/44'/0'/0'/0</code> generates public addresses": "<code>m/44'/0'/0'/0</code> generates public addresses",
14783 "<code>m/44'/0'/0'/1</code> generates change addresses": "<code>m/44'/0'/0'/1</code> generates change addresses",
14784 "<code>m/44'/0'/0'</code> generates extended keys for import / export": "<code>m/44'/0'/0'</code> generates extended keys for import / export",
14785 "<code>m/44'/0'/1'</code> for the next account. Continue incrementing for more accounts (most use a single account).": "<code>m/44'/0'/1'</code> for the next account. Continue incrementing for more accounts (most use a single account).",
14786 "Accepts binary, base 6, 6-sided dice, base 10, hexadecimal, cards": "Accepts binary, base 6, 6-sided dice, base 10, hexadecimal, cards",
14787 "Account": "Account",
14788 "Address": "Address",
14789 "Alternatively, download the file from the repository": "Alternatively, download the file from the repository",
14790 "BIP32 Derivation Path": "BIP32 Derivation Path",
14791 "BIP32 Extended Key": "BIP32 Extended Key",
14792 "BIP32 Extended Key (addresses only)": "BIP32 Extended Key (addresses only)",
14793 "BIP32 Root Key": "BIP32 Root Key",
14794 "BIP39 Mnemonic": "BIP39 Mnemonic",
14795 "BIP39 Passphrase (optional)": "BIP39 Passphrase (optional)",
14796 "BIP39 Seed": "BIP39 Seed",
14797 "Base 10": "Base 10",
14798 "Base 6": "Base 6",
14799 "Be careful - it can be easy to make mistakes if you don't know what you're doing.": "Be careful - it can be easy to make mistakes if you don't know what you're doing.",
14800 "Binary": "Binary",
14801 "Bitcoin Core": "Bitcoin Core",
14802 "Bits Per Event": "Bits Per Event",
14803 "Block Explorers": "Block Explorers",
14804 "Can be used with": "Can be used with",
14805 "Card": "Card",
14806 "Coin": "Coin",
14807 "Dice": "Dice",
14808 "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 overwhelming it isn't random enough for the needs of this tool.": "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 overwhelming it isn't random enough for the needs of this tool.",
14809 "Double-click that file to open it in a browser on any offline computer.": "Double-click that file to open it in a browser on any offline computer.",
14810 "Entropy": "Entropy",
14811 "Entropy Type": "Entropy Type",
14812 "Entropy is an advanced feature. Your mnemonic may be insecure if this feature is used incorrectly.": "Entropy is an advanced feature. Your mnemonic may be insecure if this feature is used incorrectly.",
14813 "Entropy values must be sourced from a <a href=\"https://en.wikipedia.org/wiki/Random_number_generation\" target=\"_blank\">strong source of randomness</a>.": "Entropy values must be sourced from a <a href=\"https://en.wikipedia.org/wiki/Random_number_generation\" target=\"_blank\">strong source of randomness</a>.",
14814 "Event Count": "Event Count",
14815 "External / Internal": "External / Internal",
14816 "Filtered Entropy": "Filtered Entropy",
14817 "For more info see the <a href=\"http://www.mycelium.com/\" target=\"_blank\">Mycelium Wallet homepage</a>": "For more info see the <a href=\"http://www.mycelium.com/\" target=\"_blank\">Mycelium Wallet homepage</a>",
14818 "For more info see the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\" target=\"_blank\">BIP39 spec</a>.": "For more info see the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\" target=\"_blank\">BIP39 spec</a>.",
14819 "For more info see the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki\" target=\"_blank\">BIP44 spec</a>.": "For more info see the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki\" target=\"_blank\">BIP44 spec</a>.",
14820 "For more info see the <a href=\"https://github.com/bitcoin/bitcoin/pull/8035\" target=\"_blank\">Bitcoin Core BIP32 implementation</a>": "For more info see the <a href=\"https://github.com/bitcoin/bitcoin/pull/8035\" target=\"_blank\">Bitcoin Core BIP32 implementation</a>",
14821 "For more info see the BIP32 spec": "For more info see the BIP32 spec",
14822 "From entropy length (3 words per 32 bits)": "From entropy length (3 words per 32 bits)",
14823 "Generate a random mnemonic, or enter your own below": "Generate a random mnemonic, or enter your own below",
14824 "Get the source code from the repository": "Get the source code from the repository",
14825 "Hex": "Hex",
14826 "Hierarchical Deterministic Wallets": "Hierarchical Deterministic Wallets",
14827 "If cryptographic randomness isn't available in your browser, this page will show a warning and the generate button will not work.": "If cryptographic randomness isn't available in your browser, this page will show a warning and the generate button will not work.",
14828 "In that case you might choose to use your own source of entropy.": "In that case you might choose to use your own source of entropy.",
14829 "In your browser, select file save-as, and save this page as a file.": "In your browser, select file save-as, and save this page as a file.",
14830 "Libraries": "Libraries",
14831 "Mnemonic Language": "Mnemonic Language",
14832 "Mnemonic Length": "Mnemonic Length",
14833 "Mnemonic code for generating deterministic keys": "Mnemonic code for generating deterministic keys",
14834 "More info": "More info",
14835 "Multi-Account Hierarchy for Deterministic Wallets": "Multi-Account Hierarchy for Deterministic Wallets",
14836 "Mycelium Wallet": "Mycelium Wallet",
14837 "Note these addreses are derived from the BIP32 Extended Key": "Note these addreses are derived from the BIP32 Extended Key",
14838 "Offline Usage": "Offline Usage",
14839 "Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xprv</code> key.": "Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xprv</code> key.",
14840 "Path": "Path",
14841 "Private Key": "Private Key",
14842 "Private Keys": "Private Keys",
14843 "Public Key": "Public Key",
14844 "Purpose": "Purpose",
14845 "Raw Binary": "Raw Binary",
14846 "Read more": "Read more",
14847 "Read more at the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki\" target=\"_blank\">official BIP32 spec</a>": "Read more at the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki\" target=\"_blank\">official BIP32 spec</a>",
14848 "Read more at the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\">official BIP39 spec</a>": "Read more at the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\">official BIP39 spec</a>",
14849 "Read more at the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki\" target=\"_blank\">official BIP44 spec</a>": "Read more at the <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki\" target=\"_blank\">official BIP44 spec</a>",
14850 "See the demo at <a href=\"http://bip32.org/\" target=\"_blank\">bip32.org</a>": "See the demo at <a href=\"http://bip32.org/\" target=\"_blank\">bip32.org</a>",
14851 "Show": "Show",
14852 "Show more rows": "Show more rows",
14853 "Strength": "Strength",
14854 "Supply my own source of entropy": "Supply my own source of entropy",
14855 "The built in random generator can generally be trusted more than your own intuition about randomness.": "The built in random generator can generally be trusted more than your own intuition about randomness.",
14856 "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>.": "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>.",
14857 "This means flipping a fair coin, rolling a fair dice, noise measurements etc.": "This means flipping a fair coin, rolling a fair dice, noise measurements etc.",
14858 "This project is 100% open-source code": "This project is 100% open-source code",
14859 "Toggle": "Toggle",
14860 "Total Bits": "Total Bits",
14861 "Use hardened addresses": "Use hardened addresses",
14862 "Use path <code>m/0'/0'</code> with hardened addresses.": "Use path <code>m/0'/0'</code> with hardened addresses.",
14863 "Use path <code>m/44'/0'/0'</code>.": "Use path <code>m/44'/0'/0'</code>.",
14864 "Use private keys at <a href=\"https://web.archive.org/web/20150707020924/https://brainwallet.org/\" target=\"_blank\">brainwallet.org</a>.": "Use private keys at <a href=\"https://web.archive.org/web/20150707020924/https://brainwallet.org/\" target=\"_blank\">brainwallet.org</a>.",
14865 "Valid entropy values include:": "Valid entropy values include:",
14866 "Warning": "Warning",
14867 "Word Count": "Word Count",
14868 "You are not a good source of entropy.": "You are not a good source of entropy.",
14869 "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).": "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).",
14870 "You can use this tool without having to be online.": "You can use this tool without having to be online.",
14871 "words": "words"
14872}
14873);
14874</script>
14611 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS; 14875 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
14612WORDLISTS["english"] = [ 14876WORDLISTS["english"] = [
14613"abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse", 14877"abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse",
@@ -18060,97 +18324,9 @@ window.Entropy = new (function() {
18060 while (entropyBin.length < expectedBits) { 18324 while (entropyBin.length < expectedBits) {
18061 entropyBin = "0" + entropyBin; 18325 entropyBin = "0" + entropyBin;
18062 } 18326 }
18063 // Assume cards are NOT replaced. 18327 // Cards binary must be handled differently, since they're not replaced
18064 // Additional entropy decreases as more cards are used. This means
18065 // total possible entropy is measured using n!, not base^n.
18066 // eg the second last card can be only one of two, not one of fifty two
18067 // so the added entropy for that card is only one bit at most
18068 if (base.asInt == 52) { 18328 if (base.asInt == 52) {
18069 var totalDecks = Math.ceil(base.parts.length / 52); 18329 entropyBin = getCardBinary(base.parts);
18070 var totalCards = totalDecks * 52;
18071 var totalCombos = factorial(52).pow(totalDecks);
18072 var totalRemainingCards = totalCards - base.parts.length;
18073 var remainingDecks = Math.floor(totalRemainingCards / 52);
18074 var remainingCards = totalRemainingCards % 52;
18075 var remainingCombos = factorial(52).pow(remainingDecks).multiply(factorial(remainingCards));
18076 var currentCombos = totalCombos.divide(remainingCombos);
18077 var numberOfBits = Math.log2(currentCombos);
18078 var maxWithoutReplace = BigInteger.pow(2, numberOfBits);
18079 // Use a bunch of sorted decks to measure entropy from, populated
18080 // as needed.
18081 var sortedDecks = [];
18082 // Initialize the final entropy value for these cards
18083 var entropyInt = BigInteger.ZERO;
18084 // Track how many instances of each card have been used, and thus
18085 // how many decks are in use.
18086 var cardCounts = {};
18087 // Track the total bits of entropy that remain, which diminishes as
18088 // each card is drawn.
18089 var totalBitsLeft = numberOfBits;
18090 // Work out entropy contribution of each card drawn
18091 for (var i=0; i<base.parts.length; i++) {
18092 // Get the card that was drawn
18093 var cardLower = base.parts[i];
18094 var card = cardLower.toUpperCase();
18095 // Initialize the deck for this card if needed, to track how
18096 // much entropy it adds.
18097 if (!(card in cardCounts)) {
18098 cardCounts[card] = 0;
18099 }
18100 // Get the deck this card is from
18101 var deckIndex = cardCounts[card];
18102 while (deckIndex > sortedDecks.length-1) {
18103 sortedDecks.push(getSortedDeck());
18104 }
18105 // See how many bits this card contributes (depends on how many
18106 // are left in the deck it's from)
18107 var deckForCard = sortedDecks[deckIndex];
18108 var cardsLeftInDeck = deckForCard.length;
18109 var additionalBits = Math.log2(cardsLeftInDeck);
18110 // Work out the min and max value for this card
18111 var nextTotalBitsLeft = totalBitsLeft - additionalBits;
18112 var minPossibleNewEntropy = TWO.pow(nextTotalBitsLeft).subtract(1);
18113 var maxPossibleNewEntropy = TWO.pow(totalBitsLeft).subtract(1);
18114 var diff = maxPossibleNewEntropy.subtract(minPossibleNewEntropy);
18115 // BigInteger aggresively floors numbers which greatly affects
18116 // the small numbers. In that case, use native Math library
18117 var useBigInt = totalBitsLeft >= 32;
18118 if (!useBigInt) {
18119 minPossibleNewEntropy = Math.round(Math.pow(2, nextTotalBitsLeft)-1);
18120 maxPossibleNewEntropy = Math.round(Math.pow(2, totalBitsLeft)-1);
18121 diff = maxPossibleNewEntropy - minPossibleNewEntropy;
18122 }
18123 // Scale the value between possible min and max depending on
18124 // this card value
18125 var thisCardIndex = deckForCard.indexOf(card);
18126 var toAdd = BigInteger.ZERO;
18127 if (cardsLeftInDeck > 1) {
18128 if (useBigInt) {
18129 toAdd = diff.multiply(thisCardIndex)
18130 .divide(deckForCard.length - 1)
18131 .add(minPossibleNewEntropy);
18132 }
18133 else {
18134 var ratio = thisCardIndex / (deckForCard.length -1);
18135 var f = diff * ratio;
18136 toAdd = new BigInteger(f).add(minPossibleNewEntropy);
18137 }
18138 }
18139 // Add this card entropy to existing entropy
18140 entropyInt = entropyInt.add(toAdd);
18141 // Remove this card from the deck it comes from
18142 deckForCard.splice(thisCardIndex,1);
18143 // Ensure the next insance of this card uses the next deck
18144 cardCounts[card] = cardCounts[card] + 1;
18145 // Next card drawn has less total remaining bits to work with
18146 totalBitsLeft = nextTotalBitsLeft;
18147 }
18148 // Convert to binary
18149 var entropyBin = entropyInt.toString(2);
18150 var numberOfBitsInt = Math.floor(numberOfBits);
18151 while (entropyBin.length < numberOfBitsInt) {
18152 entropyBin = "0" + entropyBin;
18153 }
18154 } 18330 }
18155 // Supply a 'filtered' entropy string for display purposes 18331 // Supply a 'filtered' entropy string for display purposes
18156 var entropyClean = base.parts.join(""); 18332 var entropyClean = base.parts.join("");
@@ -18259,6 +18435,83 @@ window.Entropy = new (function() {
18259 } 18435 }
18260 } 18436 }
18261 18437
18438 // Assume cards are NOT replaced.
18439 // Additional entropy decreases as more cards are used. This means
18440 // total possible entropy is measured using n!, not base^n.
18441 // eg the second last card can be only one of two, not one of fifty two
18442 // so the added entropy for that card is only one bit at most
18443 function getCardBinary(cards) {
18444 // Track how many instances of each card have been used, and thus
18445 // how many decks are in use.
18446 var cardCounts = {};
18447 var numberOfDecks = 0;
18448 // Work out number of decks by max(duplicates)
18449 for (var i=0; i<cards.length; i++) {
18450 // Get the card that was drawn
18451 var cardLower = cards[i];
18452 var card = cardLower.toUpperCase();
18453 // Initialize the count for this card if needed
18454 if (!(card in cardCounts)) {
18455 cardCounts[card] = 0;
18456 }
18457 cardCounts[card] += 1;
18458 // See if this is max(duplicates)
18459 if (cardCounts[card] > numberOfDecks) {
18460 numberOfDecks = cardCounts[card];
18461 }
18462 }
18463 // Work out the total number of bits for this many decks
18464 // See http://crypto.stackexchange.com/q/41886
18465 var gainedBits = Math.log2(factorial(52 * numberOfDecks));
18466 var lostBits = 52 * Math.log2(factorial(numberOfDecks));
18467 var maxBits = gainedBits - lostBits;
18468 // Convert the drawn cards to a binary representation.
18469 // The exact technique for doing this is unclear.
18470 // See
18471 // http://crypto.stackexchange.com/a/41896
18472 // "I even doubt that this is well defined (only the average entropy
18473 // is, I believe)."
18474 // See
18475 // https://github.com/iancoleman/bip39/issues/33#issuecomment-263021856
18476 // "The binary representation can be the first log(permutations,2) bits
18477 // of the sha-2 hash of the normalized deck string."
18478 //
18479 // In this specific implementation, the first N bits of the hash of the
18480 // normalized cards string is being used. Uppercase, no spaces; eg
18481 // sha256("AH8DQSTC2H")
18482 var totalCards = numberOfDecks * 52;
18483 var percentUsed = cards.length / totalCards;
18484 // Calculate the average number of bits of entropy for the number of
18485 // cards drawn.
18486 var numberOfBits = Math.floor(maxBits * percentUsed);
18487 // Create a normalized string of the selected cards
18488 var normalizedCards = cards.join("").toUpperCase();
18489 // Convert to binary using the SHA256 hash of the normalized cards.
18490 // If the number of bits is more than 256, multiple rounds of hashing
18491 // are used until the required number of bits is reached.
18492 var entropyBin = "";
18493 var iterations = 0;
18494 while (entropyBin.length < numberOfBits) {
18495 var hashedCards = sjcl.hash.sha256.hash(normalizedCards);
18496 for (var j=0; j<iterations; j++) {
18497 hashedCards = sjcl.hash.sha256.hash(hashedCards);
18498 }
18499 var hashHex = sjcl.codec.hex.fromBits(hashedCards);
18500 for (var i=0; i<hashHex.length; i++) {
18501 var decimal = parseInt(hashHex[i], 16);
18502 var binary = decimal.toString(2);
18503 while (binary.length < 4) {
18504 binary = "0" + binary;
18505 }
18506 entropyBin = entropyBin + binary;
18507 }
18508 iterations = iterations + 1;
18509 }
18510 // Truncate to the appropriate number of bits.
18511 entropyBin = entropyBin.substring(0, numberOfBits);
18512 return entropyBin;
18513 }
18514
18262 // Polyfill for Math.log2 18515 // Polyfill for Math.log2
18263 // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2#Polyfill 18516 // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2#Polyfill
18264 Math.log2 = Math.log2 || function(x) { 18517 Math.log2 = Math.log2 || function(x) {