It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
def send_and_receive_line(host, port, message):
# Create a TCP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
# Connect to the server
sock.connect((host, port))
# Send the message
start_time = time.time()
sock.sendall(message.encode())
# Receive the reply
reply = sock.recv(1024).decode()
end_time = time.time()
# Calculate the elapsed time
elapsed_time = end_time - start_time
sock.close()
return reply, elapsed_time
except ConnectionResetError:
print("Server closed the connection without replying.")
return None, None
except ConnectionRefusedError:
print("Connection refused. Make sure the server is running and the host/port are correct.")
return None, None
except AttributeError:
return None, None
def keyhunt_client(target):
host = 'localhost' # Change this to the server's hostname or IP address
port = 8080 # Change this to the server's port number
message = "{} {}:{}".format(target["publickey"],target["start"],target["end"])
reply, elapsed_time = send_and_receive_line(host, port, message)
if( reply != "404 Not Found"):
return reply
else:
return None
import requests
import time
import subprocess
import os
import re
from datetime import datetime
import secp256k1 as ice
import json
import logging
# Setup logging
logging.basicConfig(level=logging.INFO)
def get_exact_public_key(address):
url = f'https://mempool.space/api/address/{address}/txs/chain'
response = requests.get(url)
if response.status_code != 200:
raise Exception(f"Error fetching transactions: {response.status_code}")
transactions = response.json()
for tx in transactions:
for vin in tx['vin']:
if 'scriptsig' in vin:
scriptsig = vin['scriptsig']
# Extract the public key from the scriptSig
# This assumes a standard P2PKH transaction where the scriptSig is in the format:
#
pubkey = scriptsig[-66:] # The public key is typically 66 characters long in hex
return pubkey
return None
def save_public_key(pubkey):
with open("66.txt", "w") as f:
f.write(pubkey)
def run_keyhunt(pubkey):
command = f"echo '{pubkey} 20000000000000000:3ffffffffffffffff' | nc -v localhost 8080"
logging.info(f"Running command: {command}")
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
logging.info(f"Keyhunt stdout: {result.stdout}")
logging.error(f"Keyhunt stderr: {result.stderr}")
return result.stdout
def extract_private_key():
try:
with open("KEYFOUNDKEYFOUND.txt", "r") as f:
for line in f:
if "Key found privkey" in line:
privkey = line.split("Key found privkey")[1].strip()
return privkey
except FileNotFoundError:
logging.error("KEYFOUNDKEYFOUND.txt not found")
return None
def convert_to_wif(privkey):
return ice.btc_pvk_to_wif(privkey)
def start_electrum_daemon():
command = "electrum daemon -d"
subprocess.run(command, shell=True)
time.sleep(1)
def stop_electrum_daemon():
command = "electrum stop"
subprocess.run(command, shell=True)
time.sleep(1)
def restore_wallet(wif_key, password):
command = f"electrum -w /root/.electrum/wallets/66 restore {wif_key} --password {password}"
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
logging.info(f"restore_wallet output: {result.stdout} {result.stderr}")
def load_wallet(password):
command = f"electrum load_wallet -w /root/.electrum/wallets/66 --password {password}"
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
logging.info(f"load_wallet output: {result.stdout} {result.stderr}")
def list_transactions():
command = "electrum onchain_history -w /root/.electrum/wallets/66"
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
logging.info(f"history output: {result.stdout} {result.stderr}")
try:
transactions = json.loads(result.stdout)
return transactions
except json.JSONDecodeError:
logging.error("Failed to decode JSON from electrum history output")
return []
def bump_fee_and_redirect(txid, new_address, new_fee_rate, max_attempts, bump_interval):
attempts = 0
while attempts < max_attempts:
attempts += 1
command = f"electrum bumpfee {txid} {new_fee_rate} --destination {new_address}"
logging.info(f"Running bumpfee command: {command}")
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
logging.info(f"bumpfee stdout: {result.stdout}")
logging.error(f"bumpfee stderr: {result.stderr}")
logging.info(f"Waiting for {bump_interval} seconds before next bump...")
time.sleep(bump_interval)
if attempts == max_attempts:
logging.error(f"Max fee bump attempts reached for transaction {txid}.")
def main():
wallet_path = "/root/.electrum/wallets/66"
password = "Satoshi"
new_address = "new_address_here"
initial_fee_rate = 0.00018
max_attempts = 20 # Maximum number of fee bumps
bump_interval = 2 # Time to wait between bumps in seconds
address = "197kFKvMHoRJPXktc8xJwMjeTuE9xijBQ"
while True:
logging.info("Running scan...")
pubkey = get_exact_public_key(address)
if pubkey:
logging.info(f"Extracted Public Key: {pubkey}")
save_public_key(pubkey)
# Uncomment to run Keyhunt (ensure you have the keyhunt tool and the correct parameters)
run_keyhunt(pubkey)
if os.path.exists("KEYFOUNDKEYFOUND.txt"):
privkey = extract_private_key()
if privkey:
logging.info(f"Private Key: {privkey}")
wif_key = convert_to_wif(privkey)
logging.info(f"WIF Key: {wif_key}")
stop_electrum_daemon()
start_electrum_daemon()
restore_wallet(wif_key, password)
load_wallet(password)
transactions_data = list_transactions()
transactions = transactions_data.get('transactions', [])
# Check if there are unconfirmed transactions
unconfirmed_transactions = [tx for tx in transactions if tx.get('confirmations') == 0]
if unconfirmed_transactions:
for tx in unconfirmed_transactions:
bump_fee_and_redirect(tx['txid'], new_address, initial_fee_rate, max_attempts, bump_interval)
else:
logging.info("No unconfirmed transactions to bump fee.")
stop_electrum_daemon()
break
time.sleep(1)
if __name__ == "__main__":
main()
def bump_fee_and_redirect(txid, new_address, new_fee_rate, max_attempts, bump_interval):
attempts = 0
while attempts < max_attempts:
attempts += 1
command = f"electrum bumpfee {txid} {new_fee_rate} --destination {new_address}"
logging.info(f"Running bumpfee command: {command}")
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
logging.info(f"bumpfee stdout: {result.stdout}")
logging.error(f"bumpfee stderr: {result.stderr}")
if "Transaction successfully rebroadcast" in result.stdout:
logging.info(f"Fee bump attempt {attempts} successful.")
break
else:
logging.warning(f"Fee bump attempt {attempts} failed. Trying again...")
new_fee_rate *= 1.5 # Increase fee rate for next attempt
if attempts == max_attempts:
logging.error(f"Max fee bump attempts reached for transaction {txid}.")