Bitcoin Forum
July 13, 2024, 09:27:05 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to make a bitcoin miner using PYTHON?  (Read 60 times)
julia335 (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
July 12, 2024, 10:12:06 AM
 #1

I want to get python code that will work for real life bitcoin mining. Is there anybody who could help me? I have gotten the following script which works as simulator only.

import hashlib
import time

def calculate_hash(block_header):
    return hashlib.sha256(block_header.encode()).hexdigest()

def mine_block(previous_hash, transactions, difficulty):
    nonce = 0
    start_time = time.time()

    while True:
        block_header = f"{previous_hash}{transactions}{nonce}"
        block_hash = calculate_hash(block_header)
       
        if block_hash[:difficulty] == '0' * difficulty:
            end_time = time.time()
            print(f"Block mined!")
            print(f"Hash: {block_hash}")
            print(f"Nonce: {nonce}")
            print(f"Time taken: {end_time - start_time:.2f} seconds")
            print(block_header)
            return block_hash, nonce
       
       
        nonce += 1

# Example usage
previous_hash = '0000000000000000000000000000000000000000000000000000000000000000'
transactions = 'tx1->tx2->tx3'
difficulty = 4  # Number of leading zeros required in the hash

mine_block(previous_hash, transactions, difficulty)
ABCbits
Legendary
*
Offline Offline

Activity: 2940
Merit: 7650


Crypto Swap Exchange


View Profile
Today at 08:30:16 AM
 #2

I want to get python code that will work for real life bitcoin mining. Is there anybody who could help me? I have gotten the following script which works as simulator only.
--snip--

To get? You could find that easily from quick google search. For example, i found these,
https://bitcointalk.org/index.php?topic=3546.0
https://github.com/muimota/miniminer

Note that i haven't tried any of those, where I'm not responsible if those doesn't work or do anything malicious. And please stop performing SEO spam.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
julia335 (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
Today at 09:19:24 AM
 #3

I am not doing any seo spam. I only want to sell my website.

I have developed a website:
 
https://englishact.com/
 
 
Function:
 
Go to the link:
https://englishact.com/login.php
Email:   
a@gmail.com
Password:
123456
 
Click on Trading Signal
 
Now you will see all binance pairs and correct feature trading chart. Chart will update every after 15 minutes.
 
 
It has also a nice admin panel to see the registerred users. Screenshot attached
 
https://englishact.com/admin.jpg
 
All fuctions at a glance
1. Crypto trading signal provider for the all pairs of binance feature trading
2. Payment/ Subscription system for registered users.  For trading in All pair
3. Free trading - Only one pair for demonstration
4. Admin Panel - For checking payment and approving paid members
 
 
Future of this system
1. You can simply buy a domain name cryptotrading...com
2. Use this system
3. Advertise in appropriate forum.
4. Traders will subscribe here and you will earn money
 
 
My offer
1. I want to sell this complete system
2. I will upload it in your server
3. Customize code according to your requirement
 
My telegram:  @tradingviiew
Pages: [1]
  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!