but it is excellent, even better than C for testing. of new ideas,
I agree with this, personally i think that testing and proof of concept are the only thing that python is good for. But once that the proof of concept is proven to be useful or good then is time to move to another language. If speed is determining for the algorithm
the fact that you think that there are no new things is simply the result of your own mental fatigue
What F.. mental Fatigue? I already shared here a lot of programs, ideas, users share with me their ideas on telegram and there is nothing new...
What i am tryting to said is if you have a vague idea without math background or without enough testing, then OPEN a new thread discuss their idea there and if the idea was proven to be good, then link that new topic here sharing a brief sumary of it and how to use.
I have this code already which is not an idea for now but a work in progress but we might be needing to know if it's a good idea
#include "SECP256k1.h"
#include "Point.h"
#include "sha256.h"
#include "Int.h"
#include "ripemd160.h"
#include <iostream>
#include <iomanip>
#include <cstring>
#include <chrono>
#include <thread>
#include <mutex>
#include <atomic>
#include <vector>
#include <fstream>
#include <sstream>
#include <ctime>
#include <boost/multiprecision/cpp_int.hpp>
#include <gmpxx.h>
constexpr uint64_t START_VALUE = 576565752303423488ULL;
constexpr uint64_t END_VALUE = 900'000'000'000'000'000ULL;
constexpr uint64_t INCREMENT = 1ULL;
// Define a range of factors
constexpr double MIN_FACTOR = 64.0;
constexpr double MAX_FACTOR = 1028.0;
constexpr double FACTOR_INCREMENT = 1.00;
std::atomic<uint64_t> currentValue(START_VALUE);
std::atomic<uint64_t> totalKeys(0);
std::mutex printMutex;
std::mutex resultMutex;
std::vector<std::array<uint8_t, 20>> ripemd160Hashes;
std::chrono::time_point<std::chrono::system_clock> startTime;
std::atomic<bool> matchFound(false);
std::string currentHexPrivateKey;
void loadRIPEMD160Hashes() {
std::ifstream file("wallets.txt");
if (file.is_open()) {
std::string hexHash;
while (file >> hexHash) {
if (hexHash.length() != 40) {
std::cerr << "Invalid RIPEMD160 hash length: " << hexHash.length() << std::endl;
continue;/ Skip invalid hashes
}
std::array<uint8_t, 20> hash;
for (int i = 0; i < 20; ++i) {
std::string byteHex = hexHash.substr(2 * i, 2);
hash[i] = static_cast<uint8_t>(std::stoi(byteHex, nullptr, 16));
}
ripemd160Hashes.push_back(hash);
}
file.close();
std::cout << "Loaded " << ripemd160Hashes.size() << " RIPEMD160 hashes from file." << std::endl;
}
}
std::string hexBytesToHexString(const uint8_t* bytes, size_t length) {
std::stringstream ss;
ss << std::hex << std::setfill('0');
for (size_t i = 0; i < length; ++i) {
ss << std::setw(2) << static_cast<int>(bytes[i]);
}
return ss.str();
}
bool hasMinimumMatchingCharacters(const uint8_t (&hash)[20]) {
for (const std::array<uint8_t, 20>& loadedHash : ripemd160Hashes) {
bool isMatch = true;
for (int j = 0; j < 19; ++j) { // Loop through the first 5 bytes (40 bits)
if (hash[j] != loadedHash[j]) {
isMatch = false;
break;/ If any character doesn't match, stop checking
}
}
if (isMatch) {
return true;
}
}
return false;
}
void printProgress() {
startTime = std::chrono::system_clock::now();
while (!matchFound.load(std::memory_order_relaxed)) {
{
std::lock_guard<std::mutex> lock(resultMutex);
auto now = std::chrono::system_clock::now();
auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(now - startTime);
double keysPerSecond = static_cast<double>(totalKeys.load()) elapsed.count();
std::cout << "\rTime: " << elapsed.count() << "s, Keys: " << totalKeys.load()
<< ", Keys/s: " << std::fixed << std::setprecision(5) << keysPerSecond
<< ", Current: " << currentValue.load()
<< ", Priv Key: " << currentHexPrivateKey << std::flush;
}
std::this_thread::sleep_for(std::chrono::seconds(5));
}
}
void counterWorker(int threadId, Secp256K1& secp256k1, int numThreads) {
mpz_class current(START_VALUE + threadId * INCREMENT);
while (current <= END_VALUE) {
for (double factor = MIN_FACTOR; factor <= MAX_FACTOR; factor += FACTOR_INCREMENT) {
mpz_class result = current * static_cast<uint64_t>(factor);
std::string hexPrivateKey = result.get_str(16);/ Get hex representation directly
currentHexPrivateKey = hexPrivateKey;
Int privateKey;
privateKey.SetBase16(hexPrivateKey.c_str());
Point publicKey = secp256k1.ComputePublicKey(&privateKey);
uint8_t compressedPublicKey[33];
secp256k1.GetPublicKeyRaw(true, publicKey, reinterpret_cast<char*>(compressedPublicKey));
uint8_t publicKeyHash[32];
sha256_33(compressedPublicKey, publicKeyHash);
uint8_t ripemd160Hash[20];
ripemd160(publicKeyHash, 32, ripemd160Hash);
if (hasMinimumMatchingCharacters(ripemd160Hash)) {
std::string matchedPrivateKey = hexPrivateKey;/ Store the private key for printing
std::string matchedRipemd160 = hexBytesToHexString(ripemd160Hash, 20);/ Convert RIPEMD160 to hex string
{
std::lock_guard<std::mutex> lock(printMutex);
std::cout << "\nMatching RIPEMD160 hash found. Private Key: " << matchedPrivateKey << ", RIPEMD160: " << matchedRipemd160 << std::endl;
}
{
std::ofstream foundFile("found.txt", std::ios::app);/ Append mode
if (foundFile.is_open()) {
foundFile << "Matched Private Key: " << matchedPrivateKey << ", RIPEMD160: " << matchedRipemd160 << std::endl;
foundFile.close();
}
}
}
}
totalKeys.fetch_add(1);
// Convert the mpz_class to uint64_t and update the currentValue atomically
currentValue.store(static_cast<uint64_t>(current.get_ui()), std::memory_order_relaxed);
current += INCREMENT * numThreads;
}
// Signal that this thread has completed its work
matchFound.store(true, std::memory_order_relaxed);
}
int main() {
loadRIPEMD160Hashes();
Secp256K1 secp256k1;
secp256k1.Init();
std::vector<std::thread> threads;
// Start the progress printing thread
std::thread progressThread(printProgress);
const int numThreads = std::thread::hardware_concurrency();
for (int i = 0; i < numThreads; ++i) {
threads.emplace_back(counterWorker, i, std::ref(secp256k1), numThreads);
}
for (auto& thread : threads) {
thread.join();
}
// Wait for the progress thread to complete
progressThread.join();
std::cout << std::endl;
return 0;
}
now I get 1.5million/s if I have 1 factor on my 16 threaded pc which I normally get nothing less than 55 million/s on keyhunt compress and exhomorphism
the more the factor to be multiplied the less the keys/s
and come to think of it, so many private keys are just numbers and these numbers have factors except it's a prime number
Now I can solve puzzle 65 without the public key in just a few seconds if you have the right factors in place
we need to see if we can get this code working on GPU which will also make so much momentum and also if we can get it faster on cpu
it's just an idea in progress and I don't know if it's a good idea that's why I have decided to put it on here