aboutsummaryrefslogtreecommitdiff
path: root/src/index.html
blob: f771fbf5e588aa7add9522949d22e70cf6ca60cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="utf-8" />
        <title>BIP39 - Mnemonic Code</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/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" />

        <style>
            body {
                padding-bottom: 32px;
            }
            .form-control[readonly] {
                cursor: text;
            }
            .feedback-container {
                position: fixed;
                top: 0;
                width: 100%;
                text-align: center;
                z-index: 4;
            }
            .feedback {
                display: table;
                padding: 0.5em 1em;
                background-color: orange;
                margin: 0 auto;
                font-size: 2em;
                color: #444;
                border: 2px solid #555;
                border-top: 0;
                border-bottom-left-radius: 20px 20px;
                border-bottom-right-radius: 20px 20px;
            }
        </style>
    </head>
    <body>
        <div class="container">

            <h1 class="text-center">Mnemonic Code Converter</h1>
            <hr>
            <div class="row">
                <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>
                        <div class="form-group">
                            <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
                            <div class="col-sm-10">
                                <textarea id="phrase" class="phrase form-control"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="strength" class="col-sm-2 control-label">Number of words</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>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
                            <div class="col-sm-10">
                                <textarea id="passphrase" class="passphrase form-control"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="network-phrase" class="col-sm-2 control-label">Coin</label>
                            <div class="col-sm-10">
                                <select id="network-phrase" class="network form-control">
                                    <option value="bitcoin">Bitcoin</option>
                                    <option value="bitcoin-testnet">Bitcoin Testnet</option>
                                    <option value="litecoin">Litecoin</option>
                                    <option value="dogecoin">Dogecoin</option>
                                </select>
                            </div>
                        </div>
                        <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>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

            <hr>

            <div class="row">
                <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="bip44-tab">
                            <a href="#bip44" role="tab" data-toggle="tab">BIP44</a>
                        </li>
                        <li id="bip32-tab">
                            <a href="#bip32" role="tab" data-toggle="tab">BIP32</a>
                        </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="bip44" 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="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a></p>
                                </div>
                                <div class="form-group">
                                    <label for="purpose" class="col-sm-2 control-label">
                                        <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
                                    </label>
                                    <div class="col-sm-10">
                                        <input id="purpose" type="text" class="purpose form-control" value="44">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="coin" class="col-sm-2 control-label">
                                        <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
                                    </label>
                                    <div class="col-sm-10">
                                        <input id="coin" type="text" class="coin form-control" value="0">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="account" class="col-sm-2 control-label">
                                        <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
                                    </label>
                                    <div class="col-sm-10">
                                        <input id="account" type="text" class="account form-control" value="0">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="change" class="col-sm-2 control-label">
                                        <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
                                    </label>
                                    <div class="col-sm-10">
                                        <input id="change" type="text" class="change form-control" value="0">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
                                    <div class="col-sm-10">
                                        <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly">
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div id="bip32" 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="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a></p>
                                </div>
                                <div class="form-group">
                                    <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
                                    <div class="col-sm-10">
                                        <input id="bip32-path" type="text" class="path form-control" value="m/0">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Key</label>
                            <div class="col-sm-10">
                                <textarea id="extended-priv-key" class="extended-priv-key form-control" readonly="readonly"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Key (addresses only)</label>
                            <div class="col-sm-10">
                                <textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

            <hr>

            <div class="row">
                <div class="col-md-12">
                    <h2>Derived Addresses</h2>
                    <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p>
                    <table class="table table-striped">
                        <thead>
                            <th>
                                <div class="input-group">
                                    Index&nbsp;&nbsp;
                                    <button class="index-toggle">Toggle</button>
                                </div>
                            </th>
                            <th>
                                <div class="input-group">
                                    Address&nbsp;&nbsp;
                                    <button class="address-toggle">Toggle</button>
                                </div>
                            </th>
                            <th>
                                <div class="input-group">
                                    Private Key&nbsp;&nbsp;
                                    <button class="private-key-toggle">Toggle</button>
                                </div>
                            </th>
                        </thead>
                        <tbody class="addresses">
                            <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>
                            <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
                            <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <span>Show next </button>
            <input type="number" class="rows-to-add" value="20">
            <button class="more">Show</button>

            <hr>

            <div class="row">
                <div class="col-md-12">
                    <h2>More info</h2>
                    <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
                    <p>
                        Read more at the
                        <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
                    </p>
                    <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
                    <p>
                        Read more at the
                        <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
                        and see the demo at
                        <a href="http://bip32.org/" target="_blank">bip32.org</a>
                    </p>
                    <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
                    <p>
                        Read more at the
                        <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
                    </p>
                    <h3>Private Keys</h3>
                    <p>
                        Use private keys at
                        <a href="https://brainwallet.github.io/" target="_blank">brainwallet.org</a>,
                        but be careful - it can be easy to make mistakes if you
                        don't know what you're doing
                    </p>
                </div>
            </div>

            <hr>

            <div class="row">
                <div class="col-md-12">

                    <h2>Offline Usage</h2>

                    <p>
                    You can use this tool without having to be online.
                    </p>
                    <p>
                    In your browser, select file save-as, and save this page
                    as a file.
                    </p>
                    <p>
                    Double-click that file to open it in a browser
                    on any offline computer.
                    </p>
                    <p>
                    Alternatively, download it from
                    <a href="https://github.com/dcpos/bip39">
                        https://github.com/dcpos/bip39
                    </a>

                </div>
            </div>

            <hr>

            <div class="row">
                <div class="col-md-12">

                    <h2>This project is 100% open-source code</h2>

                    <p>
                        <span>Get the source code at - </span>
                        <a href="https://github.com/dcpos/bip39" target="_blank">
                            https://github.com/dcpos/bip39
                        </a>
                    </p>

                    <h3>Libraries</h3>

                    <p>
                        <span>BitcoinJS - </span>
                        <a href="https://github.com/bitcoinjs/bitcoinjs-lib" target="_blank">
                            https://github.com/bitcoinjs/bitcoinjs-lib
                        </a>
                    </p>

                    <p>
                        <span>jsBIP39 - </span>
                        <a href="https://github.com/iancoleman/jsbip39" target="_blank">
                            https://github.com/iancoleman/jsbip39
                        </a>
                    </p>

                    <p>
                        <span>sjcl - </span>
                        <a href="https://github.com/bitwiseshiftleft/sjcl" target="_blank">
                            https://github.com/bitwiseshiftleft/sjcl
                        </a>
                    </p>

                    <p>
                        <span>jQuery - </span>
                        <a href="https://jquery.com/" target="_blank">
                            https://jquery.com/
                        </a>
                    </p>

                    <p>
                        <span>Twitter Bootstrap - </span>
                        <a href="http://getbootstrap.com/" target="_blank">
                            http://getbootstrap.com/
                        </a>
                    </p>

                </div>
            </div>

        </div>

        <div class="feedback-container">
            <div class="feedback">Loading...</div>
        </div>

        <script type="text/template" id="address-row-template">
            <tr>
                <td class="index"><span></span></td>
                <td class="address"><span></span></td>
                <td class="privkey"><span></span></td>
            </tr>
        </script>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
        <script src="/js/bitcoinjs-1-0-0.js"></script>
        <script src="/js/sjcl-bip39.js"></script>
        <script src="/js/wordlists.js"></script>
        <script src="/js/wordlist_english.js"></script>
        <script src="/js/jsbip39.js"></script>
        <script src="/js/index.js"></script>
    </body>
</html>