Bitcoin Forum
July 23, 2024, 10:26:58 AM *
News: Help 1Dq create 15th anniversary forum artwork.
 
   Home   Help Search Login Register More  
Pages: « 1 ... 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 [274] 275 »
  Print  
Author Topic: Bitcoin puzzle transaction ~32 BTC prize to who solves it  (Read 196583 times)
pbies
Full Member
***
Offline Offline

Activity: 273
Merit: 128



View Profile
July 21, 2024, 12:33:47 PM
 #5461


If this is possible with puzzle 66 address, then any address with tx in mempool is possible to be taken. Just the range is a little bigger but still computing the pvk should be the same easy as is for puzzle 66.

Then all BTC is in danger. You may want to try steal any other tx in mempool when there is pubkey available.

No. 

Properly generated bitcoin private key is insanely hard to crack  (it's 256 bit). Whole bitcoin strength is based on a fact that cracking 256bit is generally considered as impossible.

This can change when quantum machines will be introduced but currently you will not crack it even having PK available.

Yes, it is possible. Just dividing pubkey by some values. Hitting the pvk is matter of even 2 seconds as other fella said here.

BTC: bc1qmrexlspd24kevspp42uvjg7sjwm8xcf9w86h5k
AlanJohnson
Member
**
Offline Offline

Activity: 103
Merit: 11


View Profile
July 21, 2024, 12:38:51 PM
 #5462


If this is possible with puzzle 66 address, then any address with tx in mempool is possible to be taken. Just the range is a little bigger but still computing the pvk should be the same easy as is for puzzle 66.

Then all BTC is in danger. You may want to try steal any other tx in mempool when there is pubkey available.

No. 

Properly generated bitcoin private key is insanely hard to crack  (it's 256 bit). Whole bitcoin strength is based on a fact that cracking 256bit is generally considered as impossible.

This can change when quantum machines will be introduced but currently you will not crack it even having PK available.

Yes, it is possible. Just dividing pubkey by some values. Hitting the pvk is matter of even 2 seconds as other fella said here.

Ok ... So why all the puzzles with lower ranges are still sitting there ?   Why nobody can crack puzzle 130 ? If that would be possilble all the puzzles would be empty now and every day we would be hearing about stolen bitcoins after making transactions (and releasing public key).
sssergy2705
Copper Member
Jr. Member
*
Offline Offline

Activity: 196
Merit: 1


View Profile
July 21, 2024, 01:51:24 PM
Last edit: July 21, 2024, 03:19:58 PM by sssergy2705
Merited by WanderingPhilospher (1)
 #5463


If this is possible with puzzle 66 address, then any address with tx in mempool is possible to be taken. Just the range is a little bigger but still computing the pvk should be the same easy as is for puzzle 66.

Then all BTC is in danger. You may want to try steal any other tx in mempool when there is pubkey available.

No.  

Properly generated bitcoin private key is insanely hard to crack  (it's 256 bit). Whole bitcoin strength is based on a fact that cracking 256bit is generally considered as impossible.

This can change when quantum machines will be introduced but currently you will not crack it even having PK available.

Yes, it is possible. Just dividing pubkey by some values. Hitting the pvk is matter of even 2 seconds as other fella said here.

Ok ... So why all the puzzles with lower ranges are still sitting there ?   Why nobody can crack puzzle 130 ? If that would be possilble all the puzzles would be empty now and every day we would be hearing about stolen bitcoins after making transactions (and releasing public key).

Yes, we can divide any public key by any number, but we will never know in what range to look for it.
We can't even divide by 2 with 100 confidence that the division was done correctly, since the parity of the public key is unknown.
albert0bsd
Hero Member
*****
Offline Offline

Activity: 888
Merit: 675



View Profile
July 21, 2024, 03:40:26 PM
Merited by pbies (1)
 #5464

Alberto, there is a tool on the Binance website that allows you to pay a higher fee and have the transaction mined quickly, doing this transaction through Binance runs the risk of losing the BTC too, or it's the same, regardless of the place, it would only be safe directly with a miner?

It is NOT safe, most of those services only works with Transactions already stuck on mempool.

I don't know, maybe I'm wrong, but what I noticed is that your transaction was not broadcast from the Mempool route. I think you know a way.


The history here has two networks, one is the main one and the other is the main Mempool route, the transaction was not confirmed on the Mempool route, although it was sent earlier, but it was not approved, and maybe the Mempool policy behaved like this. but your transaction did not pass through the Mempol route, am I wrong? ?


https://blockchair.com/bitcoin/address/197kFKvMHoRJPXktc8xJwMjeTuE9xijBQ


Thank you for sharing your research, I think that once the TX Is mined then that page move it from mempool to main, most pages discard all other TX once that the block is mined and those transactions are market as invalid or with conflicts ( because the utxo is already mined )

I already share how to I do it. I don't do anything special or different.


use API broadcasts to blockchain

response = requests.post(
    'https://blockchain.info/pushtx',
    data={'tx': raw_tx}
)
print(response.text)


thank you i didn't know this API i will add to my script as backup method


The question is why didn't the bot work as expected, ideally the experiment should have resulted in all the BTC being burned into the fee (or at least a lot more TX than 3 or 4).

It seems the mempool rejects some TX even if the fee is substantially higher. There's something alberto does not tell us, or he was just very lucky. Or maybe the mempool push TX api was the secret sauce that worked.

Some ideas:
- spam the mempool with multiple TX with different output addresses and fees
- broadcast the TX to multiple destinations

I don't do anything special.

- spam the mempool with multiple TX with different output addresses and fees

each time that the transaction fail I increment the fee by 10% and resend it until it was accepted by the mempool API, then my bot sleep for 30 seconds just to recheck if my previous TX is still the higher transaction fee if no, then it repeat the process again



Ok ... So why all the puzzles with lower ranges are still sitting there ?   Why nobody can crack puzzle 130 ? If that would be possilble all the puzzles would be empty now and every day we would be hearing about stolen bitcoins after making transactions (and releasing public key).

Beacuase we don't know the public key of those, the public key is only know if the address made a outgoing transaction. Until that those address are “safe”
AlanJohnson
Member
**
Offline Offline

Activity: 103
Merit: 11


View Profile
July 21, 2024, 04:25:24 PM
 #5465



Ok ... So why all the puzzles with lower ranges are still sitting there ?   Why nobody can crack puzzle 130 ? If that would be possilble all the puzzles would be empty now and every day we would be hearing about stolen bitcoins after making transactions (and releasing public key).

Beacuase we don't know the public key of those, the public key is only know if the address made a outgoing transaction. Until that those address are “safe”


I know that !   But i was refering to a guy that suggest that ALL bitcoin transactions are unsafe and can be cracked which is untrue in my opinion (and that's why i said about all the puzzles like 130 that wasn't cracked to this time even when their public keys are known).

Once again:  You can't crack a proper 256bit private key even when i tell you the public key to it.  I guess at some point it will be possible but not with currently available hardware.
nomachine
Member
**
Online Online

Activity: 361
Merit: 20


View Profile
July 21, 2024, 04:47:00 PM
Last edit: July 21, 2024, 06:56:50 PM by nomachine
Merited by albert0bsd (2)
 #5466

Several people asked me via private message to send them the script I used.

Here is the script.

Code:
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:
                # <signature> <pubkey>
                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()



I don't have an automatic fee increase like Alberto does. My fee was static at about $12 (0.00018 BTC), while Alberto raised his to $17 and won. In addition to Electrum, these other codes can also be used as a backup.

You need to install the BSGS server to work with this one.


p.s.
You can edit def bump_fee_and_redirect to have an automatic fee increase:
Code:
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}.")
antibiotic1
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 21, 2024, 04:53:03 PM
 #5467

13zb1hQbWV 50 pieces.
13zb1hQbWVs 2 pieces.

13zb1hQbWV  10 char match in ripemd160 hash will be  little reference significance
#0x20000000000000000 ~ 0x40000000000000000 have  10000+  private key has  10 char match compressed address

13zb1hQbWVs  11 char match
#0x20000000000000000 ~ 0x40000000000000000 have  200~250  private key has  11 char match compressed address

13zb1hQbWVsc  12 char match  
#0x20000000000000000 ~ 0x40000000000000000 have 3~4  private key has  12 char match compressed address

I found 13zb1hQbWVsSAaNvpKfmc43NsuAj33LyRM in range 0x20000000000000000 ~ 0x40000000000000000  last month
But I still don't know which range I should jump and keep search

Are you sure about this? Where did you get this information from? Will you share the source of this information?

Hi all. In principle, I didn’t plan to write here, I’ll just write as a participant.
You are welcome bro Smiley

13zb1hQbWV 11 char practice  2*66-2.67/58
13zb1hQbWVs 12 char practice  V*58=1 Vs
wilspen
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
July 21, 2024, 05:45:43 PM
 #5468


They've made opt-in Replace-By-Fee (RBF) the default in Electrum version 4.4.0. If you want to use the old version without this feature by default, you can install version 4.3.0 using the following steps:


git clone https://github.com/spesmilo/electrum.git
cd electrum/
git checkout 4.3.0
pip3 install -r contrib/deterministic-build/requirements.txt
pip3 install .

You can use old version of Electrum but every transaction will automatically have RBF enabled on the node.
Only option is to change node in Electrum to your own full-RBF-disabled node.
And mine in secret this transaction.

However, once the transaction is broadcasted using any (API) method, it is at risk of being replaced.

Even if you share it privately with a third-party miner, that miner could still replace it..

So friend, the entire test was done with an old version of electrum, where it was possible to deactivate the RBF option, as you can confirm in the transaction itself that it was deactivated, perhaps electrum removed this option from the wallet in the most recent updates because miners did not they were respecting it, in other words, it doesn't make sense to have the tool and it not work as it should.
JavaSandcrawler
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
July 21, 2024, 05:53:21 PM
 #5469

13zb1hQbWV 50 pieces.
13zb1hQbWVs 2 pieces.

13zb1hQbWV  10 char match in ripemd160 hash will be  little reference significance
#0x20000000000000000 ~ 0x40000000000000000 have  10000+  private key has  10 char match compressed address

13zb1hQbWVs  11 char match
#0x20000000000000000 ~ 0x40000000000000000 have  200~250  private key has  11 char match compressed address

13zb1hQbWVsc  12 char match  
#0x20000000000000000 ~ 0x40000000000000000 have 3~4  private key has  12 char match compressed address

I found 13zb1hQbWVsSAaNvpKfmc43NsuAj33LyRM in range 0x20000000000000000 ~ 0x40000000000000000  last month
But I still don't know which range I should jump and keep search

Are you sure about this? Where did you get this information from? Will you share the source of this information?

Hi all. In principle, I didn’t plan to write here, I’ll just write as a participant.
You are welcome bro Smiley

13zb1hQbWV 11 char practice  2*66-2.67/58
13zb1hQbWVs 12 char practice  V*58=1 Vs


What do you have in mind? i have 13zb1hQbW 3000pcs, 65 WV pcs, 3 WVs pcs. This is all very pointless, I repeat, I collected this as a log of passed ranges. I disabled some of my GPUs today and was disappointed with some of the forum posts. Most likely tomorrow I will turn off the GPUs that are still in use,maybe. I also took part in a bot battle on stream with a Portuguese guy. Sry i use transalter.
nomachine
Member
**
Online Online

Activity: 361
Merit: 20


View Profile
July 21, 2024, 05:59:32 PM
 #5470

So friend, the entire test was done with an old version of electrum, where it was possible to deactivate the RBF option, as you can confirm in the transaction itself that it was deactivated, perhaps electrum removed this option from the wallet in the most recent updates because miners did not they were respecting it, in other words, it doesn't make sense to have the tool and it not work as it should.

I usually only use terminal commands to send and receive crypto. I used it for the bot, and even there it is not used through the GUI, only as an Electrum daemon.

Which tool can bypass RBF, if any?
dextronomous
Full Member
***
Offline Offline

Activity: 434
Merit: 105


View Profile
July 21, 2024, 06:15:31 PM
 #5471

does anyone use blockchain.com, or knows if their account can import privatekeys there,
the coins inside are instantly visible right? then wait, why not instantly sell the coins to usdt?
this seemed the option for me i guess, without caring for forks, greets dex, will it works?
citb0in
Hero Member
*****
Offline Offline

Activity: 728
Merit: 721


Bitcoin g33k


View Profile
July 21, 2024, 06:20:08 PM
 #5472

you still don't understand it or you don't want to admit it --> it doesn't matter if you use an old Electrum version where feature xyz was present or non-existent. It doesn't matter if you use Electrum, or gizmo, or altair, or foo, it doesn't matter. RBF is implemented in the Bitcoin protocol and it doesn't give a f*** what wallet software you used. The main thing is that the specification is adhered to, otherwise the transaction will be rejected, quite simply.

easonkm
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 21, 2024, 06:22:16 PM
 #5473

Just after I calmed down after being excited about finding the 66-puzzle private key and thinking about how to transfer these Bitcoins safely, I discovered that someone had successfully cracked the private key before me, and more people would be monitoring and  Stealing it, ok, I stopped trying to get this reward, I didn't want the thief to get it too. This is my first and last time posting here to say goodbye to the past year and I will leave this world. I have learned a lot of new knowledge. Best wish to the bounty hunters here successfully crack the puzzle and get the reward safely, good luck.
albert0bsd
Hero Member
*****
Offline Offline

Activity: 888
Merit: 675



View Profile
July 21, 2024, 06:48:33 PM
Merited by nomachine (1)
 #5474

Here is the script.

Nice script i really like it, i may learn something from you Smiley

Here there is a function that I use for my keyhunt bsgsd server:

Code:
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

This function only send a message to a IP:port and wait for the reply returning it also the time elapsed (For speed calculation)

I call the previous function with this one that format the publickey with range_A:range_B

Code:
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

I use some target because i have a list of all puzzles with their respective ranks

With those codes you don't depend of Netcat  or shell commands.

Akito S. M. Hosana
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
July 21, 2024, 07:20:54 PM
Last edit: July 21, 2024, 07:49:27 PM by Akito S. M. Hosana
 #5475

you still don't understand it or you don't want to admit it --> it doesn't matter if you use an old Electrum version where feature xyz was present or non-existent. It doesn't matter if you use Electrum, or gizmo, or altair, or foo, it doesn't matter. RBF is implemented in the Bitcoin protocol and it doesn't give a f*** what wallet software you used. The main thing is that the specification is adhered to, otherwise the transaction will be rejected, quite simply.


Exactly.
Bitcoin devs can change RBF (BIP 125) rules if they want. I didn't know they could do that.

Example
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-June/016998.html
wilspen
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
July 21, 2024, 07:58:10 PM
 #5476

There is one more test that we can do to collect more information, the test at https://www.youtube.com/watch?v=CjxjkDEE43s&t=723s was done using the lowest possible rate as you can see in the video, this took a lot of time , almost 6 minutes for the first replace to appear, perhaps by placing the highest available rate we can have a confirmation in the first 1 minutes, of course you cannot compare 0.004BTC with 6.6BTC, however we can have another result, so we would have to monitor exchange transactions 6.6BTC and see the average confirmation time and fees added to get a better idea of ​​what we can expect.
JavaSandcrawler
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
July 21, 2024, 08:20:38 PM
 #5477


Here is the script.


I can also share but without tx

Code:
import requests
import time
import winsound
import os

address = 'ADDRESS'

def get_public_key(address):
    url = f'https://blockchain.info/q/pubkeyaddr/{address}'
    response = requests.get(url)
    if response.status_code == 200:
        public_key = response.text
        print(f'PUBLIC {address}: {public_key}')
        
        f = open('666.txt', 'w')
        f.write(f'20000000000000000\n3ffffffffffffffff\n{public_key}')
        f.close()
        return 1
    else:
        print(f'ERR {address}. CODE: {response.status_code}')
        return 0
        
        

while True:
    output = get_public_key(address)
    if output == 1:
        os.system('Kangaroo.exe -t 0 -gpu 666.txt')
        winsound.PlaySound('halflife_alarm.WAV', winsound.SND_FILENAME)
        break
    else:
        time.sleep(30)

Probably mine is not as effective as yours, but it works too
sssergy2705
Copper Member
Jr. Member
*
Offline Offline

Activity: 196
Merit: 1


View Profile
July 21, 2024, 08:41:24 PM
Last edit: July 22, 2024, 10:30:16 PM by Mr. Big
 #5478

Several people asked me via private message to send them the script I used.

Here is the script.


Apparently you used chatgpt, since I got an almost identical script. There are some minor differences, but the structure is the same.



Here is the script.

Nice script i really like it, i may learn something from you Smiley

Here there is a function that I use for my keyhunt bsgsd server:

Code:
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

This function only send a message to a IP:port and wait for the reply returning it also the time elapsed (For speed calculation)

I call the previous function with this one that format the publickey with range_A:range_B

Code:
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

I use some target because i have a list of all puzzles with their respective ranks

With those codes you don't depend of Netcat  or shell commands.



Here's my option.

Code:
    def send_request(self, pub_key, range):
        global key_found
        request_str = f"{pub_key} {range}"
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        try:
            s.connect((self.server_address, 8181))
            s.sendall(request_str.encode())
            response = s.recv(1024)
            response_str = response.decode().strip()
            if response_str not in ("404 Not Found", "400 Bad Request"):
                print(f"\nThe private key for {pub_key} is: {response_str}")
                with open('Found.txt', 'a') as f:
                    f.write(f"Public key: {pub_key}, Private key: {response_str}\n")
                key_found = True
        except ConnectionRefusedError:
            print(f"Connection refused by {self.server_address}")
            self.connected = False
        finally:
            s.close()

    def check_server(self):
        self.connected = check_server(self.server_address)

def check_server(server_address):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.settimeout(5)
    try:
        s.connect((server_address, 8181))
        return True
    except socket.error:
        return False
    finally:
        s.close()
Akito S. M. Hosana
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
July 21, 2024, 09:08:02 PM
Last edit: July 21, 2024, 09:19:24 PM by Akito S. M. Hosana
 #5479

There is one more test that we can do to collect more information, the test at https://www.youtube.com/watch?v=CjxjkDEE43s&t=723s was done using the lowest possible rate as you can see in the video, this took a lot of time , almost 6 minutes for the first replace to appear, perhaps by placing the highest available rate we can have a confirmation in the first 1 minutes, of course you cannot compare 0.004BTC with 6.6BTC, however we can have another result, so we would have to monitor exchange transactions 6.6BTC and see the average confirmation time and fees added to get a better idea of ​​what we can expect.

It's frustrating and hopeless situation.. Miners will take the entire reward for themselves.
The more I watch this YouTube video, the worse it gets.. This is a bot war.
Anything under Puzzle 85 is a waste of electricity.
albert0bsd
Hero Member
*****
Offline Offline

Activity: 888
Merit: 675



View Profile
July 21, 2024, 09:59:51 PM
 #5480

... almost 6 minutes for the first replace to appear...

That is not correct, it was only two minutes between your TX and the first replacement:

13 sat/vB
First replacement



If you look the imagen carefully



You will see there is two minutes between the 5 sat/vB and the second One of 13 sat/vB

Pages: « 1 ... 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 [274] 275 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!