Пожалуйста, обратите внимание, что пользователь заблокирован
Скрипт работает на CPU, используя максимум возможностей.
1. Устанавливаем Node.js LTS
2. Устанавливаем зависимости:
npm install Solana/web3.js bs58
3. Создаём файл gen.js и вставляем код, приложенный ниже.
Необходимый префикс вставляем в const prefix = "xss" (заместо xss)
5. Запускаем процесс node gen.js
6.Ожидаем получения приват ключа
p.s: Оставшееся время генерации не соответствует правде на 100%, это примерное время исходя из вероятности совпадения.
1. Устанавливаем Node.js LTS
2. Устанавливаем зависимости:
npm install Solana/web3.js bs58
3. Создаём файл gen.js и вставляем код, приложенный ниже.
Необходимый префикс вставляем в const prefix = "xss" (заместо xss)
JavaScript:
const { Keypair } = require("@solana/web3.js");
const bs58 = require("bs58").default || require("bs58");
const { Worker, isMainThread, parentPort, workerData } = require("worker_threads");
const { performance } = require("perf_hooks");
/**
* @returns {Object}
*/
function generateWallet() {
const keypair = Keypair.generate();
const publicKey = keypair.publicKey.toBase58();
const privateKey = bs58.encode(Buffer.from(keypair.secretKey));
return { publicKey, privateKey };
}
/**
* @param {string} prefix
* @param {function} logProgress
* @returns {Object}
*/
function generateWalletWithPrefix(prefix, logProgress) {
if (!prefix || typeof prefix !== "string") {
throw new Error("Prefix must be a non-empty string.");
}
let wallet;
let attempts = 0;
const startTime = performance.now();
const probability = 1 / Math.pow(58, prefix.length);
while (true) {
wallet = generateWallet();
attempts++;
if (attempts % 1000 === 0) {
const elapsed = (performance.now() - startTime) / 1000;
const expectedTotalAttempts = 1 / probability;
const remainingAttempts = Math.max(0, expectedTotalAttempts - attempts);
const avgAttemptsPerSecond = attempts / elapsed;
const estimatedTimeRemaining = avgAttemptsPerSecond > 0 ? remainingAttempts / avgAttemptsPerSecond : Infinity;
logProgress(attempts, elapsed, estimatedTimeRemaining);
}
if (wallet.publicKey.toLowerCase().startsWith(prefix.toLowerCase())) {
const totalTime = (performance.now() - startTime) / 1000;
return { wallet, attempts, totalTime };
}
}
}
if (isMainThread) {
const numThreads = require("os").cpus().length;
const prefix = "xss"; // Укажите желаемый префикс
console.log(`Starting generation with prefix: ${prefix} using ${numThreads} threads`);
const workers = [];
let totalAttempts = 0;
const startTime = performance.now();
const probability = 1 / Math.pow(58, prefix.length);
const expectedTotalAttempts = 1 / probability;
function updateProgress() {
const elapsed = (performance.now() - startTime) / 1000;
const avgAttemptsPerSecond = totalAttempts / elapsed;
const remainingAttempts = Math.max(0, expectedTotalAttempts - totalAttempts);
const estimatedTimeRemaining = avgAttemptsPerSecond > 0 ? remainingAttempts / avgAttemptsPerSecond : Infinity;
process.stdout.write(`\rTotal attempts: ${totalAttempts}, Elapsed time: ${elapsed.toFixed(2)} seconds, Estimated time remaining: ${estimatedTimeRemaining.toFixed(2)} seconds`);
}
for (let i = 0; i < numThreads; i++) {
const worker = new Worker(__filename, { workerData: { prefix } });
workers.push(worker);
worker.on("message", (result) => {
if (result.wallet) {
console.log(`\nWallet found by thread after ${result.attempts} attempts in ${result.totalTime.toFixed(2)} seconds:`, result.wallet);
process.exit(0);
} else if (result.attempts) {
totalAttempts += result.attempts;
updateProgress();
}
});
worker.on("error", (err) => {
console.error(`Worker error: ${err}`);
});
worker.on("exit", (code) => {
if (code !== 0) {
console.error(`Worker stopped with exit code ${code}`);
}
});
}
} else {
const { prefix } = workerData;
const logProgress = (attempts, elapsed, estimatedTimeRemaining) => {
const avgAttemptsPerSecond = elapsed > 0 ? (attempts / elapsed).toFixed(2) : "0.00";
parentPort.postMessage({ attempts });
};
const result = generateWalletWithPrefix(prefix, logProgress);
parentPort.postMessage(result);
}
6.Ожидаем получения приват ключа
p.s: Оставшееся время генерации не соответствует правде на 100%, это примерное время исходя из вероятности совпадения.