diff --git a/.gitignore b/.gitignore index 34c248d..dfbbdc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ node_modules/ js/bundle.js css/stylesheet.css + +#!node_modules/vue/dist/vue.min.js +#!node_modules/bootstrap/dist/css/bootstrap.min.css diff --git a/README.md b/README.md index 0a09e08..23eeaeb 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,7 @@ Just type [`git.io/veth`](https://git.io/veth) to use it ⚡️ ## Local usage -If for any reason you don't want to use the version hosted by Github pages, download / clone the project and open `index.html` with your web browser. - -⚠ For some reason, some browsers such as chrome disallow multi-thread computation when run from a local file. +Check out the [wiki page](https://github.com/bokub/vanity-eth/wiki/Download-Vanity-ETH) ## Local development @@ -23,8 +21,10 @@ npm i npm i -g gulp ``` -Run the watcher to compile while you code +Run the watcher to compile CSS/JS while you code ```sh gulp watch # or npm run-script watch ``` + +The Travis CI bot is in charge of building and deploying Vanity-ETH to Github pages. diff --git a/gulpfile.js b/gulpfile.js index 144916e..91f32ed 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -58,6 +58,7 @@ gulp.task('build', ['build-js', 'build-css'], cb => { gulp.src('.gitignore'), replace('js/bundle.js', ''), replace('css/stylesheet.css', ''), + replace('#', ''), gulp.dest('./') ], cb); }); diff --git a/index.html b/index.html index 8b76bd4..e9f315b 100644 --- a/index.html +++ b/index.html @@ -7,15 +7,12 @@ Vanity ETH + + - + - - -
@@ -47,8 +44,9 @@

As explained above, everything is computed in your browser. Nothing ever leaves your machine, or even your browser tab.
- Once the page is loaded, you can turn off your internet connection and everything will work - perfectly fine.
+ You can download the latest build of Vantiy-ETH from + Github and use it + completely offline.
Vanity-ETH uses a cryptographically secure pseudorandom number generator (CSPRNG) to generate Ethereum addresses.

@@ -105,7 +103,8 @@
Difficulty: 1
Generated: 0 addresses
-
Speed: 0 addr/s
+
50% probability: 0 addresses
+
Speed: 0 addr/s
Status: Waiting
@@ -129,7 +128,7 @@
- + \ No newline at end of file diff --git a/js/index.js b/js/index.js index 9073134..6e4d6b8 100644 --- a/js/index.js +++ b/js/index.js @@ -16,7 +16,7 @@ const computeDifficulty = function (pattern, isChecksum) { }; const computeProbability = function (difficulty, attempts) { - return 1 - Math.pow((difficulty - 1) / difficulty, attempts); + return 1 - Math.pow(1 - (1 / difficulty), attempts); }; new Vue({ @@ -25,7 +25,7 @@ new Vue({ count: 0, firstTick: null, running: false, - speed: '0 addr/s', + speed: 0, status: 'Waiting', workers: [], threads: 4, @@ -48,6 +48,9 @@ new Vue({ difficulty: function () { return this.inputError ? 'N/A' : computeDifficulty(this.input.prefix, this.input.checksum); }, + probability50: function () { + return this.inputError ? 'N/A' : Math.floor(Math.log(0.5) / Math.log(1 - (1 / this.difficulty))) + ' addresses'; + }, probability: function () { return Math.round(10000 * computeProbability(this.difficulty, this.count)) / 100; } @@ -62,7 +65,7 @@ new Vue({ methods: { incrementCounter: function (incr) { this.count += incr; - this.speed = incr > 0 ? Math.floor(1000 * this.count / (performance.now() - this.firstTick)) + ' addr/s' : '0 addr/s'; + this.speed = incr > 0 ? Math.floor(1000 * this.count / (performance.now() - this.firstTick)) : 0; }, displayResult: function (result) { diff --git a/js/vanity.js b/js/vanity.js index 2c0cda6..711143d 100644 --- a/js/vanity.js +++ b/js/vanity.js @@ -63,8 +63,7 @@ const getVanityWallet = (input, isChecksum, cb) => { wallet = getRandomWallet(); attempts++; } - - cb({address: ethUtils.toChecksumAddress(wallet.address), attempts}); + cb({address: ethUtils.toChecksumAddress(wallet.address), privKey: wallet.privKey, attempts}); }; onmessage = function (event) { diff --git a/package-lock.json b/package-lock.json index e04b89b..6f74883 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1036,6 +1036,15 @@ "hoek": "2.16.3" } }, + "bootstrap": { + "version": "4.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.0.0-alpha.6.tgz", + "integrity": "sha1-T1TdM6wN6sOyhAe8LffsYIhpycg=", + "requires": { + "jquery": "3.2.1", + "tether": "1.4.3" + } + }, "boxen": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", @@ -3939,6 +3948,11 @@ "textextensions": "1.0.2" } }, + "jquery": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz", + "integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=" + }, "js-base64": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.0.tgz", @@ -6709,6 +6723,11 @@ "execa": "0.7.0" } }, + "tether": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/tether/-/tether-1.4.3.tgz", + "integrity": "sha512-YCfE/Ym9MpZpzUmzbek7MiLEyTofxx2YS0rJfSOUXX0aZtfQgxcgw7/Re2oGJUsREWZtEF0DzBKCjqH+DzgL6A==" + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7337,6 +7356,11 @@ "indexof": "0.0.1" } }, + "vue": { + "version": "2.5.13", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.5.13.tgz", + "integrity": "sha512-3D+lY7HTkKbtswDM4BBHgqyq+qo8IAEE8lz8va1dz3LLmttjgo0FxairO4r1iN2OBqk8o1FyL4hvzzTFEdQSEw==" + }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", diff --git a/package.json b/package.json index 1116b64..e6c8974 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "dependencies": { "@babel/plugin-transform-object-assign": "^7.0.0-beta.37", "babel-preset-env": "^1.6.1", + "bootstrap": "^4.0.0-alpha.6", "browserify": "^14.5.0", "ethereumjs-util": "^5.1.2", "gulp": "^3.9.1", @@ -17,6 +18,7 @@ "pump": "^2.0.0", "randombytes": "^2.0.6", "vinyl-source-stream": "^1.1.0", + "vue": "^2.5.13", "xo": "^0.18.2" }, "license": "ISC",