Bitcoin Forum
June 08, 2026, 11:55:36 AM *
News: Latest Bitcoin Core release: 31.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 3 »
1  Bitcoin / Pools / Satoshi Radio Block Hunt on: October 28, 2024, 05:37:42 PM
Closed.

Maybe once the pool finds its first block will come back..
2  Bitcoin / Development & Technical Discussion / Hashmap File on: September 18, 2024, 11:17:34 AM
Hey guys.

Interesting to know more about this Bitcoin Bond that was around years ago.

https://en.bitcoin.it/wiki/Distributed_markets

Been looking for some examples of this hashmap file.

Are there any nodes running this still? Why was the project abandoned?

I have had a look over the Jgarzik bitcoin bond lib but I would be keen to know more about this

Rather than wait for specific bonds to become available and then manually evaluate each one by hand, we can construct a kind of distributed investment fund by sending money to a Bitcoin private key that is then encrypted under a policy and uploaded into the financial hashmap:

Code:
"POLICY" <hash of InvestmentFundAdvertisement message> 2DROP <pubkey> CHECKSIG

Policy-locked ciphertexts are potentially quite large, depending on the size of the policy (a comparison against a large number like a date can use over a kilobyte), so it makes sense to use the same hash disassociation used in the bond protocol above in order to minimize block chain size.

The hash would actually identify a data structure containing the ciphered private key:

Code:
message InvestmentFundAdvertisement {
  required bytes owner_pubkey = 1;  // The key that will control the bond once sold.
  required bytes ciphertext = 2;    // Policy is embedded within this.
}

As the bond market client crawls the block chain, it may encounter policy locked coins. By downloading the ciphertext from the hashmap, it can identify what conditions would unlock the coins and advertise that in the client. Somebody who is looking for business opportunities may see a message like this in their GUI.



Thanks in advance.
3  Bitcoin / Armory / Cannot Open Wallet on: August 14, 2024, 04:39:03 PM
Looking for some info why armory would fail with the error.

Is this detecting as a wallet only not for armory maybe? or is this possible some detection to let you know it's part of a MS wallet?

Code:

('Error in unpackHeader:', isMSWallet('Cannot Open MS Wallets',))
(ERROR) Traceback (most recent call last):
  File "/home/BitcoinArmory/qtdialogs.py", line 12226, in clickedOkay
    self.main.execGetImportWltName()
  File "ArmoryQt.py", line 3833, in execGetImportWltName
    wlt = PyBtcWallet().readWalletFile(fn, verifyIntegrity=False)
  File "/home/BitcoinArmory/armoryengine/Timer.py", line 99, in inner
    ret = func(*args, **kwargs)
  File "/home/BitcoinArmory/armoryengine/PyBtcWallet.py", line 2106, in readWalletFile
    self.unpackHeader(wltdata)
  File "/home/BitcoinArmory/armoryengine/PyBtcWallet.py", line 1985, in unpackHeader
    self.unpackWalletFlags(binUnpacker)  # Potential issue here
  File "/home/BitcoinArmory/armoryengine/PyBtcWallet.py", line 1905, in unpackWalletFlags
    raise isMSWallet('Cannot Open MS Wallets')
isMSWallet: Cannot Open MS Wallets



I had a look at the section of code that flags this but still confused about how this detection works and what I can try next?

Code:

   def unpackWalletFlags(self, toUnpack):
      if isinstance(toUnpack, BinaryUnpacker):
         flagData = toUnpack
      else:
         flagData = BinaryUnpacker( toUnpack )

      wltflags = flagData.get(UINT64, 8)
      wltflags = int_to_bitset(wltflags, widthBytes=8)
      self.useEncryption = (wltflags[0]=='1')
      self.watchingOnly  = (wltflags[1]=='1')
      if wltflags[2]=='1':
         raise isMSWallet('Cannot Open MS Wallets')



I presume the wallet file must be MS wallet if so how do I load it correctly?

Could really use some help with this or some more info on what this isMSWallet flag is for.

Best regards!


4  Alternate cryptocurrencies / Mining (Altcoins) / MagicHash - Group Based SOLO Mining - on: September 16, 2023, 12:48:57 AM
GROUP CLOSED.


No interest in the project.
5  Other / Off-topic / If you think you found Satoshi? on: August 08, 2023, 02:32:52 AM
Hey guys.

I wanted to ask what you would do if you thought you found Satoshi..

Let's say you found someone who fits the bill perfectly.  
Every detail even down to a extended hiatus from end of 2008 - 2011. (when Satoshi "moved on" to other thing)

The person is very much alive today and is still working in the technology industry.

My question is this.

Would you reach out?  
What would you say?

Thanks in advance.

6  Alternate cryptocurrencies / Service Announcements (Altcoins) / MaskETH | Transaction Masking CLI Toolkit & Telegram Bot | Privacy Tools on: July 08, 2023, 02:13:20 PM
Closed as per new forum rules.
7  Economy / Digital goods / ETHMask | Transaction Privacy Toolkit | CLI | on: July 06, 2023, 02:06:52 AM
Moved to Project development  Wink

https://bitcointalk.org/index.php?topic=5459067.msg62520584#msg62520584
8  Economy / Long-term offers / Closed on: July 06, 2023, 12:31:07 AM
Closed new forum rules
9  Alternate cryptocurrencies / Altcoin Discussion / goerli testnet ETH on: May 21, 2023, 01:28:01 PM
Looking for some goerli testnet ETH but the faucets are pretty much dry at the moment or do not give a large enough amount.

Has anyone some goerli testnet ETH they can spare.

Will send back after testing is complete looking for around 20-50 if possible.

Anyone?  Wink

0xcA65285aA192DA22364dC0572f598259022390c0
10  Bitcoin / Development & Technical Discussion / Bitcoin Github on: May 08, 2023, 08:37:57 PM
Hello everyone.

I was looking for some early version of Bitcoin before v0.10.0 that seems to be the earlier release on Github.

Why have the earlier version not been archived for clarity?

Can we request that the versions below 0.10.0 are uploaded somewhere?

Is there somewhere these are still available in original format?

Thanks in advance!
11  Alternate cryptocurrencies / Service Announcements (Altcoins) / [BOT] DYDX Trading Script |Auto Trading | Market Making | Grid | Pump | on: May 06, 2023, 12:20:34 PM
Now Closed.
12  Economy / Digital goods / DYDX Trading Script |Auto Trading | Market Making | Grid | Pump | on: May 01, 2023, 01:40:18 PM
Moved To Services Board.
13  Bitcoin / Development & Technical Discussion / Python Mining Process | Visual Mining Learning | Community Updated on: February 18, 2023, 01:21:50 AM
** Update 28/02/2024 - Final code now on Github. https://github.com/DaCryptoRaccoon/BitcoinSoloPy

Looking for some advice on the mining process with python I have added the sections below I am most interested in knowing if they are in the correct order they seem to be working and output looks good.  I would be interested to have the community update maybe add in some features use it for a learning tool to visually see the mining process so I included the full script at the bottom of the post.  

I would also like to know how I can calculate the hashrate of the CPU and display that along size the nonce value that runs on the same line while the script is running I am unsure how to go about calculating the hashrate so this would be something I would be interested in having added.

Any help or updates if anyone is interested in this would be great!

As stated at the start of the post here are some section that I would like to know if they are in the correct sequence.

Code:
   ## This code is used to create a target (difficulty) and extranonce2 value for a mining context (ctx).
    ## The target is created by taking the last 3 bits of the nbits field from the context and appending '00' to the end of it ctx.nbits[2:] times.
    ## The extranonce2 value is a random number between 0 and 2^32-1, which is converted to hex and padded with zeros to match the length of the ctx.extranonce2_size.

    target = (ctx.nbits[2 :] + '00' * (int(ctx.nbits[:2] , 16) - 3)).zfill(64)
    extranonce2 = hex(random.randint(0 , 2 ** 32 - 1))[2 :].zfill(2 * ctx.extranonce2_size)  # create random

    ## This code is used to create a coinbase hash from the mining context (ctx) and the extranonce2 value generated in the previous code.
    ## The coinbase is created by combining the ctx.coinb1, ctx.extranonce1, extranonce2 and ctx.coinb2 fields.
    ## The coinbase hash is then generated by taking the SHA-256 hash of the coinbase twice and getting the binary digest.

    coinbase = ctx.coinb1 + ctx.extranonce1 + extranonce2 + ctx.coinb2
    coinbase_hash_bin = hashlib.sha256(hashlib.sha256(binascii.unhexlify(coinbase)).digest()).digest()

    ## This code is used to generate a Merkle root from the mining context (ctx) and the coinbase hash generated in the previous code.
    ## The Merkle root is generated by looping through the ctx.merkle_branch list and combining the merkle_root and the current branch element in each iteration.
    ## The combined values are then hashed twice with SHA-256 to generate the new merkle_root.

    merkle_root = coinbase_hash_bin
    for h in ctx.merkle_branch :
        merkle_root = hashlib.sha256(hashlib.sha256(merkle_root + binascii.unhexlify(h)).digest()).digest()

   ## This code is used to convert the binary Merkle root generated in the previous code to a hexadecimal string.
   ## The binary merkle_root is converted to a hexadecimal string using the binascii.hexlify() function,
   ## and then the result is decoded to a string using the decode() method.

    merkle_root = binascii.hexlify(merkle_root).decode()

    ## This code is used to format the Merkle root generated in the previous code. The string is split into two-character substrings,
    ## and the result is reversed using the [::-1] slice notation.
    ## The work_on variable is used to get the current block height,
    ## and the ctx.nHeightDiff dictionary is updated with the new block height and a value of 0.

    merkle_root = ''.join([merkle_root[i] + merkle_root[i + 1] for i in range(0 , len(merkle_root) , 2)][: :-1])
    work_on = get_current_block_height()
    ctx.nHeightDiff[work_on + 1] = 0

    ## This code is used to calculate the difficulty for the current block.
    ## The difficulty is calculated by taking the hex string "00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
    ## and dividing it by the target value which is also in hex format. The result is the difficulty for the current block.

    _diff = int("00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" , 16)

     ## This code is used to generate a blockheader from the mining context (ctx), the Merkle root,
     ## a random nonce, and the hash of the blockheader. The blockheader is created by combining the
     ## ctx.version, ctx.prevhash, merkle_root, ctx.ntime, ctx.nbits, nonce and,
     ## '000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'.
     ## The hash of the blockheader is then generated by taking the SHA-256 hash of the blockheader twice and getting the binary digest.
     ## The result is then converted to a hexadecimal string using the binascii.hexlify() function.

        nonce = hex(random.randint(0 , 2 ** 32 - 1))[2 :].zfill(8)  # nNonce   #hex(int(nonce,16)+1)[2:]
        blockheader = ctx.version + ctx.prevhash + merkle_root + ctx.ntime + ctx.nbits + nonce + \
                      '000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'
        hash = hashlib.sha256(hashlib.sha256(binascii.hexlify()



Running Output In Terminal :

Code:
[ 00:52:13.570480 ]  Solo Miner Active
[ 00:52:13.570503 ]  [*] Bitcoin Miner Restarted
[*] Target:  [ 0000000000000000000730390000000000000000000000000000000000000000
[*] Extranonce2:  [ 0000000081c85ef1
[*] Coinbase Hash:  [ 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff35037fdb0b00043d21f06304a91445120c663eb5880000000081c85ef10a636b706f6f6c112f736f6c6f2e636b706f6f6c2e6f72672fffffffff035da99424000000001976a914de7065b31fad6c0f9c66b81f1958ebb356af9fb888ac941dbf00000000001976a914f4cbe6c6bb3a8535c963169c22963d3a20e7686988ac0000000000000000266a24aa21a9ed120b0cd349e61ea31bd80040ca4e6a2daae782690bd6c70c597f6f00f43bf3ec00000000
[*] Merkle Root:  [ 7132975fd8b01f54806294db489ff4628474e43d5486680692a7c4186aae2d99
[*] Diff:  [ 26959946667150639794667015087019630673637144422540572481103610249215 ]
[*] Nonce: d501c71560





UPDATED CODE READ DOWN TOPIC


The code connects to CK Solo pool for work and pulls the block height from blockchain.info you can change the address in the script you might get lucky! but probably not!

If anyone can work out how I can calculate the hashrate of the CPU and have it output in the same terminal line as the nonce value would be great!

SoloMine.py


Code:

# Bitcoin Solo Miner
import requests
import socket
import threading
import json
import hashlib
import binascii
import logging
import random
import time
import traceback
import context as ctx
from datetime import datetime
from signal import SIGINT , signal
from colorama import Back , Fore , Style


sock = None

def timer() :
    tcx = datetime.now().time()
    return tcx

## Lucky BTC Address! May Satoshi Be With You!
address = '1MH9f5wc5phwL2KzqjzAdriERHPawmaRjy'

print(Back.BLUE , Fore.WHITE , 'SOLO ADDRESS:' , Fore.GREEN, str(address) , Style.RESET_ALL)

def handler(signal_received , frame) :
    ## Handle Cleanup ##
    ctx.fShutdown = True
    print(Fore.MAGENTA , '[' , timer() , ']' , Fore.YELLOW , 'Force Close, Please Wait..')

## Start Logging to file miner.log
## Include Timestamps

def logg(msg) :
    # basic logging
    logging.basicConfig(level = logging.INFO , filename = "miner.log" ,
                        format = '%(asctime)s %(message)s')
    logging.info(msg)

 ## This code is used to get the current block height of the Bitcoin network.
 ## The request is made to the blockchain.info API and the response is parsed to get the height field.
 ## The height is then converted to an integer and returned.

def get_current_block_height() :
    # returns the current network height
    r = requests.get('https://blockchain.info/latestblock')
    return int(r.json()['height'])

## This code is used to check if the mining context (ctx) is in shutdown mode.
## If the ctx.fShutdown flag is set to True, the ctx.listfThreadRunning list is updated with the current thread's index (n) and set to False.
## The thread's exit flag is also set to True to signal the thread to exit.

def check_for_shutdown(t) :
    ## handle shutdown ##
    n = t.n
    if ctx.fShutdown :
        if n != -1 :
            ctx.listfThreadRunning[n] = False
            t.exit = True

## This code is defining a custom thread class called ExitedThread which is a subclass of threading.Thread.
## The class has two attributes, exit and arg, and four methods,
## __init__, run, thread_handler and thread_handler2. The __init__ method is used to initialize the class and set the exit,
## arg and n attributes. The run method is used to call the thread_handler method with the arg and n attributes as parameters.
## The thread_handler method is used to check for shutdown and if the exit flag is set to True, the thread exits.
## The thread_handler2 method is used to be implemented by subclasses and is not implemented in this class.
## The check_self_shutdown and try_exit methods are used to check for shutdown and try to exit the thread, respectively.


class ExitedThread(threading.Thread) :
    def __init__(self , arg , n) :
        super(ExitedThread , self).__init__()
        self.exit = False
        self.arg = arg
        self.n = n

    def run(self) :
        self.thread_handler(self.arg , self.n)
        pass

    def thread_handler(self , arg , n) :
        while True :
            check_for_shutdown(self)
            if self.exit :
                break
            ctx.listfThreadRunning[n] = True
            try :
                self.thread_handler2(arg)
            except Exception as e :
                logg("ThreadHandler()")
                print(Fore.MAGENTA , '[' , timer() , ']' , Fore.WHITE , 'ThreadHandler()')
                logg(e)
                print(Fore.RED , e)
            ctx.listfThreadRunning[n] = False

            time.sleep(2)
            pass

    def thread_handler2(self , arg) :
        raise NotImplementedError("must impl this func")

    def check_self_shutdown(self) :
        check_for_shutdown(self)

    def try_exit(self) :
        self.exit = True
        ctx.listfThreadRunning[self.n] = False
        pass

 ## This code is defining a function called bitcoin_miner which is used to start and restart the bitcoin miner.
 ## If the miner is restarted, it will log and print that it has been restarted and sleep for 5 seconds.
 ## It will then log and print that the miner has started. It then runs a loop which checks if the miner thread is still alive and if the subscribe thread is running.
 ## If either of these conditions are not true, the loop will break. Otherwise,
 ## it will set the miner thread to be running, call the mining method on the miner thread, and set the miner thread to be not running.
 ## If an exception occurs, it is logged and the traceback is printed, and the loop breaks.

def bitcoin_miner(t , restarted = False) :
    if restarted :
        logg('\n[*] Bitcoin Miner restarted')
        print(Fore.MAGENTA , '[' , timer() , ']' , Fore.YELLOW , 'Solo Miner Active')
        print(Fore.MAGENTA , '[' , timer() , ']' , Fore.BLUE , '[*] Bitcoin Miner Restarted')
        time.sleep(5)

    ## This code is used to create a target (difficulty) and extranonce2 value for a mining context (ctx).
    ## The target is created by taking the last 3 bits of the nbits field from the context and appending '00' to the end of it ctx.nbits[2:] times.
    ## The extranonce2 value is a random number between 0 and 2^32-1, which is converted to hex and padded with zeros to match the length of the ctx.extranonce2_size.

    target = (ctx.nbits[2 :] + '00' * (int(ctx.nbits[:2] , 16) - 3)).zfill(64)
    extranonce2 = hex(random.randint(0 , 2 ** 32 - 1))[2 :].zfill(2 * ctx.extranonce2_size)  # create random
    print( Fore.YELLOW , '[*] Target:' ,Fore.GREEN, '[' , target) , ']'
    print( Fore.YELLOW , '[*] Extranonce2:' ,Fore.GREEN , '[' , extranonce2) , ']'

    ## This code is used to create a coinbase hash from the mining context (ctx) and the extranonce2 value generated in the previous code.
    ## The coinbase is created by combining the ctx.coinb1, ctx.extranonce1, extranonce2 and ctx.coinb2 fields.
    ## The coinbase hash is then generated by taking the SHA-256 hash of the coinbase twice and getting the binary digest.

    coinbase = ctx.coinb1 + ctx.extranonce1 + extranonce2 + ctx.coinb2
    coinbase_hash_bin = hashlib.sha256(hashlib.sha256(binascii.unhexlify(coinbase)).digest()).digest()
    print( Fore.YELLOW , '[*] Coinbase Hash:' ,Fore.GREEN , '[' , coinbase) , ']'

    ## This code is used to generate a Merkle root from the mining context (ctx) and the coinbase hash generated in the previous code.
    ## The Merkle root is generated by looping through the ctx.merkle_branch list and combining the merkle_root and the current branch element in each iteration.
    ## The combined values are then hashed twice with SHA-256 to generate the new merkle_root.

    merkle_root = coinbase_hash_bin
    for h in ctx.merkle_branch :
        merkle_root = hashlib.sha256(hashlib.sha256(merkle_root + binascii.unhexlify(h)).digest()).digest()

        ## This code is used to convert the binary Merkle root generated in the previous code to a hexadecimal string.
        ## The binary merkle_root is converted to a hexadecimal string using the binascii.hexlify() function,
        ## and then the result is decoded to a string using the decode() method.

    merkle_root = binascii.hexlify(merkle_root).decode()
    print( Fore.YELLOW , '[*] Merkle Root:' ,Fore.YELLOW , '[' , merkle_root) , ']'

    # This code is used to format the Merkle root generated in the previous code. The string is split into two-character substrings,
    ## and the result is reversed using the [::-1] slice notation.
    ## The work_on variable is used to get the current block height,
    ## and the ctx.nHeightDiff dictionary is updated with the new block height and a value of 0.

    merkle_root = ''.join([merkle_root[i] + merkle_root[i + 1] for i in range(0 , len(merkle_root) , 2)][: :-1])
    work_on = get_current_block_height()
    ctx.nHeightDiff[work_on + 1] = 0

    ## This code is used to calculate the difficulty for the current block.
    ## The difficulty is calculated by taking the hex string "00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
    ## and dividing it by the target value which is also in hex format. The result is the difficulty for the current block.

    _diff = int("00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" , 16)
    print( Fore.YELLOW , '[*] Diff:' ,Fore.YELLOW , '[' , int(_diff) , ']')
    logg('[*] Working to solve block at block height {}'.format(work_on + 1))
    print(Fore.MAGENTA , '[' , timer() , ']' , Fore.YELLOW , '[*] Working to solve block at ' , Fore.RED , 'height {}'.format(work_on + 1))

    ## Start Mining Loop ##

    ## This code is a while loop which checks if the thread should be shut down and if so, it breaks out of the loop.
    ## It then checks if a new block has been detected and if so, it logs and prints that a new block has been detected,
    ## logs and prints the difficulty of the block, restarts the bitcoin miner, and continues the loop.

    while True :
        t.check_self_shutdown()
        if t.exit :
            break

        if ctx.prevhash != ctx.updatedPrevHash :
            logg('[*] NEW BLOCK {} DETECTED ON NETWORK'.format(ctx.prevhash))
            print(Fore.YELLOW , '[' , timer() , ']' , Fore.MAGENTA , '[*] New block {} detected on' , Fore.BLUE , ' network '.format(ctx.prevhash))
            logg('[*] Best difficulty previous block {} was {}'.format(work_on + 1 ,ctx.nHeightDiff[work_on + 1]))
            print(Fore.MAGENTA , '[' , timer() , ']' , Fore.GREEN , '[*] Best Diff Trying Block' , Fore.YELLOW , ' {} ' , Fore.BLUE , 'was {}'.format(work_on + 1 ,ctx.nHeightDiff[work_on + 1]))
            ctx.updatedPrevHash = ctx.prevhash
            bitcoin_miner(t , restarted = True)
            print(Back.YELLOW , Fore.MAGENTA , '[' , timer() , ']' , Fore.BLUE , 'NEW BLOCK DETECTED - RESTARTING MINER...' ,
                  Style.RESET_ALL)
            continue

            ## This code is used to generate a blockheader from the mining context (ctx), the Merkle root,
            ## a random nonce, and the hash of the blockheader. The blockheader is created by combining the
            ## ctx.version, ctx.prevhash, merkle_root, ctx.ntime, ctx.nbits, nonce and,
            ## '000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'.
            ## The hash of the blockheader is then generated by taking the SHA-256 hash of the blockheader twice and getting the binary digest.
            ## The result is then converted to a hexadecimal string using the binascii.hexlify() function.

        nonce = hex(random.randint(0 , 2 ** 32 - 1))[2 :].zfill(8)  # nNonce   #hex(int(nonce,16)+1)[2:]
        blockheader = ctx.version + ctx.prevhash + merkle_root + ctx.ntime + ctx.nbits + nonce + \
                      '000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'
        hash = hashlib.sha256(hashlib.sha256(binascii.unhexlify(blockheader)).digest()).digest()
        hash = binascii.hexlify(hash).decode()

        ## Print Functions for terminal output
        ## Print Rolling Nonce
        ## Print Rolling Nonce + Block Header
        ## Print Block Header

        print( Fore.YELLOW + '[*] Nonce: ' + Fore.GREEN + str(nonce) , end="\r")
        ## Print Nonce Rolling + Rolling Block Header ##
        #print( Fore.YELLOW + '[*] Nonce: ' + Fore.GREEN + str(nonce) + Fore.YELLOW , '[*] Block Header:' ,Fore.GREEN , '[' , str(blockheader) , end="\r")
        ## Print Block Header ##
        #print( Fore.YELLOW , '[*] Block Header:' ,Fore.GREEN , '[' , str(blockheader) ,  end="\r")


        ##Log all hashes that start with 7 zeros or more ##
        if hash.startswith('000000') :
            logg('[*] New hash: {} for block {}'.format(hash , work_on + 1))
            print(Fore.MAGENTA , '[' , timer() , ']' , Fore.GREEN, '[*] New hash:' , Fore.GREEN , ' {} for block' , Fore.YELLOW ,' {}'.format(hash , work_on + 1))
            print(Fore.MAGENTA , '[' , timer() , ']' , Fore.YELLOW , 'Hash:' , str(hash).format(work_on + 1))

            ## This code is used to check if the difficulty of the current block is greater than the difficulty of the previous block.
            ## The difficulty of the current block is calculated by dividing the predetermined difficulty value _diff by the hash of the blockheader this_hash.
            ## If the current difficulty is greater than the previous difficulty stored in the ctx.nHeightDiff dictionary,
            ## the new difficulty is set as the value for the current block.

        this_hash = int(hash , 16)
        difficulty = _diff / this_hash

        if ctx.nHeightDiff[work_on + 1] < difficulty :
            # new best difficulty for block at x height
            ctx.nHeightDiff[work_on + 1] = difficulty

            ## This code is used to check if the hash of the blockheader is less than the target value.
            ## If the hash is less than the target, it means the block has been successfully solved and the ctx.solved flag is set to True.

        if hash < target :
            logg('[*] Block {} solved.'.format(work_on + 1))

            print(Fore.MAGENTA , '[' , timer() , ']' , Fore.YELLOW , '[*] Block {} solved.'.format(work_on + 1))
            logg('[*] Block hash: {}'.format(hash))
            print(Fore.YELLOW)
            print(Fore.MAGENTA , '[' , timer() , ']' , Fore.YELLOW , '[*] Block hash: {}'.format(hash))
            logg('[*] Blockheader: {}'.format(blockheader))
            print(Fore.BLUE , '--------------~~( ' , Fore.GREEN  , 'BLOCK SOLVED CHECK WALLET!' , Fore.ORANGE , ' )~~--------------')

            print(Fore.YELLOW , '[*] Blockheader: {}'.format(blockheader))
            payload = bytes('{"params": ["' + address + '", "' + ctx.job_id + '", "' + ctx.extranonce2 \
                            + '", "' + ctx.ntime + '", "' + nonce + '"], "id": 1, "method": "mining.submit"}\n' ,
                            'utf-8')
            logg('[*] Payload: {}'.format(payload))
            print(Fore.MAGENTA , '[' , timer() , ']' , Fore.BLUE , '[*] Payload:' , Fore.GREEN , ' {}'.format(payload))
            sock.sendall(payload)
            ret = sock.recv(1024)
            logg('[*] Pool response: {}'.format(ret))
            print(Fore.MAGENTA , '[' , timer() , ']' , Fore.GREEN , '[*] Pool Response:' , Fore.CYAN ,
                  ' {}'.format(ret))
            print(payload)
            return True

         ## This code is used to set up a connection to the ckpool server and send a handle subscribe message.
         ## The response is parsed to get the ctx.sub_details, ctx.extranonce1 and ctx.extranonce2_size fields.
         ## Then an authorize message is sent with the address and password, and the response is read until the mining.notify message is received.

def block_listener(t) :
    # init a connection to ckpool
    sock = socket.socket(socket.AF_INET , socket.SOCK_STREAM)
    sock.connect(('solo.ckpool.org' , 3333))
    # send a handle subscribe message
    sock.sendall(b'{"id": 1, "method": "mining.subscribe", "params": []}\n')
    lines = sock.recv(1024).decode().split('\n')
    response = json.loads(lines[0])
    ctx.sub_details , ctx.extranonce1 , ctx.extranonce2_size = response['result']
    # send and handle authorize message
    sock.sendall(b'{"params": ["' + address.encode() + b'", "password"], "id": 2, "method": "mining.authorize"}\n')
    response = b''
    while response.count(b'\n') < 4 and not (b'mining.notify' in response) : response += sock.recv(1024)
    print(response)

    ## This code is used to parse the response from the ckpool server and get the necessary fields for the mining context (ctx).
    ## The response is split into individual lines and only lines that contain the 'mining.notify' string are parsed.
    ## The parsed results are then stored in the,
    ## ctx.job_id, ctx.prevhash, ctx.coinb1, ctx.coinb2, ctx.merkle_branch, ctx.version, ctx.nbits, ctx.ntime and ctx.clean_jobs fields.

    responses = [json.loads(res) for res in response.decode().split('\n') if
                 len(res.strip()) > 0 and 'mining.notify' in res]
    ctx.job_id , ctx.prevhash , ctx.coinb1 , ctx.coinb2 , ctx.merkle_branch , ctx.version , ctx.nbits , ctx.ntime , ctx.clean_jobs = \
        responses[0]['params']

    ## Do this one time, will be overwriten by mining loop when new block is detected

    ctx.updatedPrevHash = ctx.prevhash

    while True :
        t.check_self_shutdown()
        if t.exit :
            break

        ## This code is used to check if the previous hash in the response from the ckpool server is different from the previous hash,
        ## in the mining context (ctx). If the hashes are different, the response is parsed to get the necessary fields
        ## for the mining context and the fields are updated with the new values.

        response = b''
        while response.count(b'\n') < 4 and not (b'mining.notify' in response) : response += sock.recv(1024)
        responses = [json.loads(res) for res in response.decode().split('\n') if
                     len(res.strip()) > 0 and 'mining.notify' in res]

        if responses[0]['params'][1] != ctx.prevhash :

            ## New block detected on network
            ## update context job data

            ctx.job_id , ctx.prevhash , ctx.coinb1 , ctx.coinb2 , ctx.merkle_branch , ctx.version , ctx.nbits , ctx.ntime , ctx.clean_jobs = \
                responses[0]['params']

    ## This code is defining a custom thread class called CoinMinerThread which is a subclass of ExitedThread.
    ## The class has two methods, __init__ and thread_handler2. The __init__ method is used to initialize the class and set the n attribute to 0.
    ## The thread_handler2 method calls the thread_bitcoin_miner method with the arg parameter. The thread_bitcoin_miner method is used to check for shutdown,
    ## and then calls the bitcoin_miner function with the current thread object as the parameter. The result of the bitcoin_miner function is logged to the console.

class CoinMinerThread(ExitedThread) :
    def __init__(self , arg = None) :
        super(CoinMinerThread , self).__init__(arg , n = 0)

    def thread_handler2(self , arg) :
        self.thread_bitcoin_miner(arg)

    def thread_bitcoin_miner(self , arg) :
        ctx.listfThreadRunning[self.n] = True
        check_for_shutdown(self)
        try :
            ret = bitcoin_miner(self)
            logg(Fore.MAGENTA , "[" , timer() , "] [*] Miner returned %s\n\n" % "true" if ret else "false")
            print(Fore.LIGHTCYAN_EX , "[*] Miner returned %s\n\n" % "true" if ret else "false")
        except Exception as e :
            logg("[*] Miner()")
            print(Back.WHITE , Fore.MAGENTA , "[" , timer() , "]" , Fore.BLUE , "[*] Miner()")
            logg(e)
            traceback.print_exc()
        ctx.listfThreadRunning[self.n] = False

    pass

## This code is defining a new class called NewSubscribeThread which is a subclass of ExitedThread. It has two methods,
## __init__ and thread_handler2. The __init__ method sets up the thread with the specified argument and sets the number of threads to 1.
## The thread_handler2 method calls the thread_new_block method with the specified argument.
## The thread_new_block method sets the thread to be running, checks for shutdown, and then calls the block_listener function. If an exception occurs,
## it is logged and the traceback is printed. Finally, the thread is set to be not running.

class NewSubscribeThread(ExitedThread) :
    def __init__(self , arg = None) :
        super(NewSubscribeThread , self).__init__(arg , n = 1)

    def thread_handler2(self , arg) :
        self.thread_new_block(arg)

    def thread_new_block(self , arg) :
        ctx.listfThreadRunning[self.n] = True
        check_for_shutdown(self)
        try :
            ret = block_listener(self)
        except Exception as e :
            logg("[*] Subscribe thread()")
            print(Fore.MAGENTA , "[" , timer() , "]" , Fore.YELLOW , "[*] Subscribe thread()")
            logg(e)
            traceback.print_exc()
        ctx.listfThreadRunning[self.n] = False

    pass

    ## This code is defining a function called StartMining which creates a thread for subscribing and one for mining.
    ## It first creates a new thread called subscribe_t which uses the NewSubscribeThread class.
    ## It then starts the thread and logs that the subscribe thread has been started.
    ## It then sleeps for 4 seconds and creates a new thread called miner_t which uses the CoinMinerThread class.
    ## It then starts the thread and logs that the Bitcoin solo miner has been started.

def StartMining() :
    subscribe_t = NewSubscribeThread(None)
    subscribe_t.start()
    logg("[*] Subscribe thread started.")
    print(Fore.MAGENTA , "[" , timer() , "]" , Fore.GREEN , "[*] Subscribe thread started.")

    time.sleep(4)

    miner_t = CoinMinerThread(None)
    miner_t.start()
    logg("[*]£££ Bitcoin Solo Miner Started £££")
    print(Fore.MAGENTA , "[" , timer() , '(', Fore.GREEN  , 'SOLO MINER STARTED' , Fore.BLUE , ' )~~--------------')
    print(Fore.BLUE , '--------------~~( ' , Fore.YELLOW , 'IN SATOSHI WE TRUST' , Fore.BLUE , ' )~~--------------')
    print(Fore.BLUE , '--------------~~( ' , Fore.GREEN  , 'DO NOT TRUST VERIFY' , Fore.BLUE , ' )~~--------------')


if __name__ == '__main__' :
    signal(SIGINT , handler)
    StartMining()



Context.py

Code:
fShutdown = False
listfThreadRunning = [False] * 2
local_height = 0
nHeightDiff = {}
updatedPrevHash = None
job_id = None
prevhash = None
coinb1 = None
coinb2 = None
merkle_branch = None
version = None
nbits = None
ntime = None
clean_jobs = None
sub_details = None
extranonce1 = None
extranonce2_size = None




14  Economy / Collectibles / [A U C T I O N ] Litecoin MoonChikun Silver + NFTs + Display Case on: February 12, 2023, 12:07:19 PM
Litecoin MoonChikun Silver + NFTs + Display Case

Hello guys I am back once again with another custom silver product to auction off!

This is a unique opportunity to purchase custom hand poured silver bars from Scotland that represent digital Non-Fungible Tokens (NFTs). There are four bars available for sale in as a single unit, and they come with a beautiful antique rosewood case for display purposes. This is a great collectible item for any investor, collector or enthusiast. The bars are made from .999 fine Scottish silver, and each one is individually numbered and authenticated by the Edinburgh Assay Office each one has been hallmarked . This is a rare chance to own a piece of history and an asset that will increase in value over time.

In addition, three of the bars come with Moonchikun NFTs. This provides on-chain authentication of the silver and provides additional assurance of the silver's origin and authenticity. Furthermore, each bar is individually numbered and authenticated, giving the buyer even more peace of mind. Finally, the antique rosewood case makes a great display piece and adds an extra layer of style and sophistication.

The 4th round is the Litecoin wreath, it has no NFT with it and is a limited one off pour but is hallmarked by the Edinburgh assay office.

x3 of the bars weight 45g and the LTC round weighs 35g giving the whole package a total weight of 170g of .999 Fine Scottish Silver.

You are bidding for all x4 bars + the display case!

DISPLAY CASE








The display case is antique made of RoseWood and has Mother Or Pearl inlay designs on all sides it comes with 4 nice storage compartments to hold your physical wealth MoonChikuns and LTC wreath in one fantastic case!

MOONCHIKUN SILVER

MoonChikun#84




MoonChikun#84
https://liteverse.io/nft-details/Qmbnx4DyAwB8puzZEEk6oxUpDYTH3aXb74b2jYQVvQHNpv

MoonChikun#888




MoonChikun#888
https://liteverse.io/nft-details/QmdNyTVUJesQvmQNRAvaGfDqhwofngtSq1EqbCQ13ACSVc

MoonChikun#7957




MoonChikun#7957
https://liteverse.io/nft-details/QmTj7KvMEwpq6wf2DwSBh3SUy4Dj7E26omzTrUqNbADNPn

Litecoin Wreath 1/1 NO NFT


HALLMARKS

Each item is hallmarked on the back by the Edinburgh Assay Office
https://www.edinburghassayoffice.co.uk/



Starting price 0.05 BTC - Bids in 0.01 Increments

You are bidding on ALL silver items + Display case

Sale Ends: FEBRUARY 19th, 2023, 12PM GMT

Payment within 24 hours of auction close

All bid made in last 10 minutes will extend the auction 10 minutes beyond the end time

PAYMENT: BTC

SHIPPING: Buyer pays postage cost and cost is based on location and postage preference

NFT's: Buyer MUST have a Litecoin Omni wallet to accept the NFT's standard LTC addresses won't accept NFT's from the omni-layer wallets can be downloaded from the official website https://omnilite.org/


Thank you for looking bids are OPEN!

15  Alternate cryptocurrencies / Marketplace (Altcoins) / [AUCTION] LITECOIN MOONCHIKUN SILVER + NFTs + DISPLAY CASE (ULTRA RARE) on: February 01, 2023, 06:22:33 PM
[/b]
16  Economy / Digital goods / Two Unique ENS Names on: November 08, 2022, 12:53:57 PM
Sold
17  Bitcoin / Development & Technical Discussion / Tor Network & Bitcoin Nodes on: February 18, 2022, 10:52:03 AM
Noticed a massive jump in Bitcoin nodes on the network Tor network 7818 (52.11%)

Would this be anything to be concerned about? being that it seems they are ramping very quickly?

Could this be some form of attack coming or someone just trying to mess with the network by syncing loads of nodes?

18  Bitcoin / Mining software (miners) / Unable to flash controller board on: November 11, 2021, 10:45:34 PM
I have been trying to reset a bunch of controller boards that I can't seem to access at the moment and the reset button is not working on them so I downloaded the flash tool and firmware from Bitmain site and followed the guide.

After inserting the SD card to the miner the green status light flashes for around 2 min then turns solid for 1 Min then goes off for 30 seconds only to comes back on for 1 min in a never ending cycle of on-off (Green LED)

The site says that the green light will stop flashing once the flash is complete and to wait 1 min before power down.  but the green light never goes off for more than 30 sec even after 1 hour of waiting it seems to be in a loop.

Has anyone come across this issue in the past and if so how did you get round the issue.

Thanks in advance.
19  Bitcoin / Mining support / Antminer Hashboard Testing Software ? on: September 26, 2021, 12:21:37 AM
Would anyone know where I can find myself a copy of the Antminer hashboard testing program?

I noticed a lot of devices coming out that claim to be able to test the boards and give accurate info on the chips that may be down or require attention.

I have been unable to find the software used in the demo that is loaded onto the devices it seems now their is a few sellers on Ebay selling these device now so I would assume the software is in the wild somewhere.

I have a number of boards down at the moment and would rather just poke about myself than send them off for repair.

If anyone has any info on where I can source this software it would be great!



20  Bitcoin / Development & Technical Discussion / Generating Address From 78 Bit Number on: September 12, 2021, 05:17:13 PM
So I was looking for a way to convert a decimal number 78 bit into the compressed and uncompressed addresses.

I would like to feed a specific set of numbers into a small program that will then generate the related compressed and uncompressed addressing for that decimal number.

What is the exact process to go from something like :

158458943549846849875450169348572156946031654895118510018735188216379120187838

Into the address format?

Has anyone got a small python or C# program that I can pipe in the numbers like this and output the address.

I do not mind coding something up but what is the exact process to go from the above to a public key.

Best regards.
Pages: [1] 2 3 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!