-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
92 lines (79 loc) · 3.37 KB
/
index.js
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
console.clear();
/*************************************************/
/*************** Declaring Consts ****************/
/*************************************************/
const bip39 = require('bip39');
const ecc = require('tiny-secp256k1')
const { BIP32Factory } = require('bip32')
const bip32 = BIP32Factory(ecc)
const fs = require('fs');
const chalk = require('chalk');
var bitcoin = require('bitcoinjs-lib');
var request = require('request');
const process1 = require('process');
var iterations = 0;
var threads = 100;
var cpm = 0;
var totalbalance = 0;
/*************************************************/
/*************** Declaring Functs ****************/
/*************************************************/
function getAddress (node) {
return bitcoin.payments.p2pkh({ pubkey: node.publicKey }).address
}
function saveHit (addy, balance) {
fs.appendFile("hits.txt", "\n"+addy + ": " + balance, function(err) {/**/});
}
function thread() {
iterations++;
var mnemonic = bip39.generateMnemonic();
if(bip39.validateMnemonic(mnemonic) != true) {
console.log(chalk.red(mnemonic + " : INVALID"));
return;
}
else {
var seed = bip39.mnemonicToSeedSync(mnemonic);
const root = bip32.fromSeed(seed);
const path = "m/44'/0'/0'/0/0";
const child1 = root.derivePath(path);
const path2 = "m/44'/0'/0'/0/1"
const child2 = root.derivePath(path2);
var address1 = getAddress(child1);
var address2 = getAddress(child2);
request('https://blockchain.info/q/addressbalance/' + address1, { json: true }, (err, res, body) => {
if (err) { return console.log(err); }
var accbalance = body*1;
request('https://blockchain.info/q/addressbalance/' + address2, { json: true }, (err, res, bodyy) => {
if (err) { return console.log(err); }
accbalance = accbalance + (bodyy*1);
if(accbalance > 0) {
cpm = iterations/(Math.floor(Date.now() / 1000)-startTime);
totalbalance = (accbalance*1) + totalbalance;
process1.title = "Threads: " + threads + " | Checked " + iterations + " | CPS " + parseFloat(cpm).toFixed(2) + " | Balance " + totalbalance/100000000;
console.log(chalk.green("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"+"Mnemonic: "+mnemonic+"\n"+"Balance: "+accbalance+ "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"));
saveHit(mnemonic, accbalance);
loop();
}
else {
cpm = iterations/(Math.floor(Date.now() / 1000)-startTime);
totalbalance = (accbalance*1) + totalbalance;
process1.title = "Threads: " + threads + " | Checked " + iterations + " | CPS " + parseFloat(cpm).toFixed(2) + " | Balance " + totalbalance/100000000;
console.log(chalk.red("Mnemonic: "+mnemonic));
loop();
}
});
});
}
}
function loop() {
thread();
}
/*************************************************/
/***************** Program Code ******************/
/*************************************************/
console.clear();
var startTime = Math.floor(Date.now() / 1000);
for(i=1; i<=threads; i++) {
process1.title = "Threads: " + i + " | Checked " + iterations + " | CPS " + parseFloat(cpm).toFixed(2) + " | Balance " + totalbalance/100000000;
loop();
}