Last active
October 1, 2019 10:25
-
-
Save mangadul/0227d6f236291f558bde15420225917c to your computer and use it in GitHub Desktop.
Bitcoin segwit vanity address generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bitcoin = require("bitcoinjs-lib") | |
const axios = require("axios") | |
var find_str = "3BMEX"; // find 5 first char or string | |
var is_bmex = false | |
while(is_bmex === false){ | |
var NETWORK = bitcoin.networks.bitcoin | |
var privatekey = bitcoin.ECPair.makeRandom().toWIF(); | |
var keyPair = bitcoin.ECPair.fromWIF(privatekey); | |
var pubKey = keyPair.publicKey | |
const { address } = bitcoin.payments.p2sh({ | |
redeem: bitcoin.payments.p2wpkh({ pubkey: keyPair.publicKey }), | |
}); | |
axios.get('https://blockchain.info/rawaddr/' + address) | |
.then(function (response) { | |
console.log(privatekey, address) | |
console.log(response.data); | |
}); | |
var str_3bmex = address.substring(0, 5); | |
if(str_3bmex === find_str) { | |
is_bmex = true | |
console.log(privatekey,address); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "segwit", | |
"version": "1.0.0", | |
"description": "Bitcoin vanity address generator", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "MIT", | |
"dependencies": { | |
"axios": "^0.19.0", | |
"bitcoinjs-lib": "^5.1.6" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment