-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex_template.html
executable file
·307 lines (282 loc) · 12.7 KB
/
index_template.html
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
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-112413074-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-112413074-1');
</script>
<meta charset="UTF-8" />
<title>MindWallet - deterministic bitcoin wallet generator for Ethereum, Monero, Litecoin and Bitcoin using argon2</title>
<style>
body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: #f5f5f5;
margin: 0;
font-size: 17px;
}
p {
line-height: 24px;
}
.content {
max-width: 800px;
width: 800px;
margin: 0 auto;
}
.form {
border: 1px solid #ccc;
padding: 20px;
border-radius: 4px;
background-color: #fff;
}
.alert {
background-color: #f2dede;
border-radius: 4px;
border: solid 0.75px #ebcccc;
color: #a94442;
padding: 12px 20px;
}
.info {
background-color: #d9edf7;
color: #31708f;
border-radius: 4px;
border: solid 0.75px #bcdff1;
padding: 12px 20px;
}
h2 {
text-align: center;
font-size:
}
h1 {
font-size: 40px;
letter-spacing: 2px;
margin: 20px 0;
}
.header {
margin: 0 0 50px 0;
text-align: center;
background-color: #222;
color: #fff;
padding: 20px;
}
.header h2 {
margin: 0 0 10px 0;
font-size: 20px;
}
.header h3 {
margin-top: 0;
font-size: 18px;
}
.form-label {
width: 300px;
float: left;
text-align: right;
padding-right: 10px;
}
.form-field {
width: 400px;
float: left;
}
.form-group {
padding-bottom: 15px;
overflow: hidden;
}
.form {
overflow: hidden;
}
input[type="email"], input[type="text"], input[type="password"] {
color:#464a4c;
border-radius:4px;
width: 300px;
border: .75px solid #0003;
margin:0;
padding:8px 12px
}
input:focus {
border-color: #5cb3fd;
}
.currency-selector {
text-align: center;
margin-bottom: 20px;
}
a {
text-decoration: none;
color: #0275d8;
}
a:hover {
background-color: #ccc;
}
.progress {
display: flex;
overflow: hidden;
font-size: .75rem;
line-height: 1rem;
text-align: center;
background-color: #eceeef;
border-radius: 4px;
}
.progress-bar {
height: 1rem;
background-color: #0275d8;
background-image: -webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);
background-image: -o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);
background-image: linear-gradient(45deg,#fff3 25%,transparent 25%,transparent 50%,#fff3 50%,#fff3 75%,transparent 75%,transparent);
-webkit-background-size: 1rem 1rem;
background-size: 1rem 1rem;
}
.btn {
color: #fff;
background-color: #0275d8;
border-color: #0275d8;
display: block;
font-weight: 400;
line-height: 1.25;
text-align: center;
vertical-align: middle;
border: 1px solid transparent;
padding: .5rem 1rem;
font-size: 1rem;
border-radius: 4px;
margin: 10px auto;
cursor: pointer;
}
.btn:disabled {
background-color: #0275d8;
border-color: #0275d8;
cursor: not-allowed;
opacity: .65;
}
.brand {
font-size: 1.1em;
}
@media (min-width: 992px){
.lead {
width: 50%;
margin: auto;
}
}
</style>
</head>
<body>
<div class="header">
<h1>MindWallet</h1>
<div class=lead>
<h2>Have your mind on your wallet and your wallet on your mind.</h2>
<h4 id="lead">MindWallet allows you to store your bitcoin, ethereum, monero or litecoin wallet's private key in your mind easily and securely,
the only way to lose your wallet would be to either lose your mind or if <a href="https://xkcd.com/538/" target=_blank>someone spends $5 on a wrench to hurt you</a> but this one applies to other wallets as well.</h2>
<h4>MindWallet is heavily based on the great <a href="https://dvdbng.github.io/memwallet">MemWallet</a> project itself inspired by <a href="https://keybase.io/warp/">WarpWallet</a> whose authors are of keybase.io and okcupid fame.</h2>
<h4>MindWallet makes use of the argon2 hash function to generate your private keys, argon2 is harder to hack than scrypt which is also pretty secure.</h2>
<h4>To use offline just <a href="https://github.com/patcito/mindwallet#readme" target=_blank>clone</a> this page.</h3>
</div>
</div>
<div class="content">
<form class="form" autocomplete="off" onsubmit="return false;">
<div class="form-group currency-selector">
<label> <input name="coin" onclick="resetState()" checked value="bitcoin" type="radio"/> Bitcoin </label>
<label> <input name="coin" onclick="resetState()" value="ethereum" type="radio"/> Ethereum </label>
<label> <input name="coin" onclick="resetState()" value="litecoin" type="radio"/> Litecoin </label>
<label> <input name="coin" onclick="resetState()" value="monero" type="radio"/> Monero </label>
</div>
<div class="form-group">
<div class="form-label">Passphrase </div>
<div class="form-field">
<input type="password" id="passphrase" oninput="updateButton()" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
</div>
</div>
<div class="form-group">
<div class="form-label">Email: <a href="#" onclick="toggle('info')">[?]</a></div>
<div class="form-field">
<input type="email" id="salt" placeholder="use at least 8 character" required minlength="8" oninput="updateButton();" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
</div>
</div>
<div class="info" id="info" style="display: none">
<span class="brand">MindWallet</span> can use your email as salt to make your wallet stronger.
This forces bruteforce attackers to target only one user per hash (unless other users use the same email).
<a href="#" onclick="toggle('info')">[Close]</a>
</div>
<div id="progress" style="display: none">
<center>Running argon2... This may take up to 1 or 2 minutes. Use the Golang version for a faster version.</center>
<div class="progress">
<div id="progress-bar" class="progress-bar" style="width: 50%"> </div>
</div>
</div>
<button id="btn" class="btn" disabled="" onclick="generate()">Generate</button>
<h2 style="display: none" id="wallet-title"></h2>
<div class="form-group" id="cnt-public" style="display: none">
<div class="form-label" id="label-public" ></div>
<div class="form-field"><input type="text" id="result-public" /></div>
</div>
<div class="form-group" id="cnt-private" style="display: none">
<div class="form-label" id="label-private"></div>
<div class="form-field"><input type="text" id="result-private" /></div>
</div>
<div class="form-group" id="cnt-public-view" style="display: none">
<div class="form-label" id="label-public-view" ></div>
<div class="form-field"><input type="text" id="result-public-view" /></div>
</div>
<div class="form-group" id="cnt-private-view" style="display: none">
<div class="form-label" id="label-private-view" ></div>
<div class="form-field"><input type="text" id="result-private-view" /></div>
</div>
<div class="form-group" id="cnt-public-spend" style="display: none">
<div class="form-label" id="label-public-spend" ></div>
<div class="form-field"><input type="text" id="result-public-spend" /></div>
</div>
<div class="form-group" id="cnt-private-spend" style="display: none">
<div class="form-label" id="label-private-spend" ></div>
<div class="form-field"><input type="text" id="result-private-spend" /></div>
</div>
</form>
<p id="online-alert" class="alert"><strong>You are online.</strong> For maximum security is better that you <a href="https://github.com/patcito/mindwallet#readme" target=_blank>clone</a> this page and generate the address in a computer disconnected from the internet.</p>
<p id="js-alert" class="alert">Javascript is disabled. <span class="brand">MindWallet</span> needs javascript to work </p>
<script> document.getElementById('js-alert').style.display = 'none'; </script>
<p>
<span class="brand">MindWallet</span> is a deterministic cryptocurrency address generator, it is a fork of <a href="https://dvdbng.github.io/memwallet">MemWallet</a> which itself is inspired by
<a href="https://keybase.io/warp/">WarpWallet</a>, but it uses the Argon2 hashing function instead of scrypt.
You never have to save or store your private key anywhere. Just pick a really good password - many random words, for example - and never use it for anything else.
</p>
<p>Given the same Passphrase and Salt, <span class="brand">MindWallet</span> will always generate the same address and private key, so you only need to remember your password to access your funds.</p>
<p>
For more information on why this is safer than a regular brainwallet, see <a href="https://keybase.io/warp/">WarpWallet</a>'s help,
<span class="brand">MindWallet</span> uses MemWallet's re-implementation of WarpWallet, but with a different hash function algorithm.
MemWallet and <span class="brand">MindWallet</span> use the same algorithm, so MemWallet and <span class="brand">MindWallet</span> will generate
the same Bitcoin address for a given Passphrase and salt. However, because MindWallet uses a different algorithm, it will generate a different Bitcoin address.
MindWallet comes with a golang implementation largely based on MemWallet so you can double check that the JS version works, it is also much faster to run.
Have Fun!
</p>
<p>
Why a different algorithm? While scrypt is still pretty secure, there are
<a href="https://blog.ircmaxell.com/2014/03/why-i-dont-recommend-scrypt.html"
target=_blank>known issues</a> a
<a href="https://password-hashing.net/" target=_blank>
password hashing competition</a> was held to fix these known issues and the declared winner was
<a href="https://github.com/p-h-c/phc-winner-argon2" target=_blank>argon2</a> which has been out for more than 4 years now and
has been implemented in most languages including the <a href="https://github.com/golang/crypto/blob/master/argon2/argon2.go">golang standard crypto library</a>
used here. The JS version used here is the C version compiled to asm.js and wasm.js thanks to <a href="https://github.com/antelle/argon2-browser"
target=_blank>@antelle</a>.
</p>
The algorithm behind <span class="brand">MindWallet</span>:
<table class="table table-condensed" style="font-size: 0.7em; font-family: mono;">
<tr><td valign="top" align="right">b</td><td align="center" valign="top" width="20">=</td><td valign="top" align="left">1 for Bitcoin, 2 for Litecoin, 3 for Ethereum and 4 for Monero</td></tr>
<tr><td valign="top" align="right">seed<sub>1</sub></td><td align="center" valign="top" width="20">=</td><td valign="top" align="left">argon2(key=(passphrase||b), salt=(salt||b), N=2<sup>18</sup>, r=8, p=1, dkLen=32)</td></tr>
<tr><td valign="top" align="right">seed<sub>2</sub></td><td align="center" valign="top">=</td><td valign="top" align="left">pbkdf2(key=(passphrase||(b+1)), salt=(salt||(b+1)), c=2<sup>16</sup>, dkLen=32, prf=SHA256)</td></tr>
<tr><td valign="top" align="right">wallet</td><td align="center" valign="top">=</td><td valign="top" align="left">generate_wallet(seed=(seed<sub>1</sub> ⊕ seed<sub>2</sub>))</td></tr>
</table>
<p> </p>
<hr/>
<p> </p>
<center>
<p><span class="brand">MindWallet</span> was made with ♥ By <a href="https://twitter.com/patcito">Patrick Aljord</a> shamelessly re-using awesome code by
<a href="https://github.com/dvdbng">David Bengoa</a></p>
<p>Source code is in <a href="https://github.com/patcito/mindwallet">Github</a>, and so is a go implementation of the same algorithm.</p>
</center>
<p> </p>
<!--
Javascript is left un-minimized so it's easy to audit it offline
-->
<!-- INLINE_SCRIPT_HERE --><script src="ui.js"></script><script src="dist/bundle.js"></script>
</div>
</body>
</html>