Search content
Sort by

Showing 7 of 7 results by dwarf_racoon
Post
Topic
Board Bitcoin Technical Support
Topic OP
Reindexing download issue
by
dwarf_racoon
on 28/05/2024, 16:08:59 UTC
On a standard btc node, I had a problem akin to that of https://bitcointalk.org/index.php?topic=5319613.0 so went to reindex with a './bitcoind --reindex' and the daemon seems unable to download 100% of the blockchain. I started the command about a week ago, and for the past ~4 days it has been stuck right around 90.8%. Not that the daemon does not continue to attempt, but the percentage downloaded fluctuates between ~90.65 and 90.90%.

I have found a few related issues on the stackexhange that say this could be due to faulty peers or even a storage issue, but neither of these seem immediately apparent. Beyond this, several answers report that the reindex cannot be cancelled, so I am unsure of how to solve this issue. Is my node fried? Is there a way to change my 'dbcache' mid download (as https://bitcoin.stackexchange.com/questions/38422/possible-to-speed-up-reindex gives this as a potential alleviation, though without specifying the location of dbcache)?

Any info on the above would be significantly appreciated as I attempt to re-activate my node.
Post
Topic
Board Bitcoin Technical Support
Issue with Blockheader from Stratum Data
by
dwarf_racoon
on 25/01/2023, 20:37:55 UTC
Hey hey

I'm writing a python script to take stratum tcp messages recorded through a mining proxy to reconstruct blockheaders and verify the miners' work. Documentation seems fairly sparse and at times conflicting.

From an initial 'mining.subscribe' response, we can gather the ExtraNonce1 (or from a later 'mining.set_extranonce')

From a 'mining.notify' job specification, we can gather the version, previous hash, time, and nBits towards the blockheader, additionally we can gather both the coinbase bits and the merkle branches.

From a 'mining.submission', we can gather the extraNonce2 and the nonce.


We can build the merkle root applying the following by first constructing the coinbase_hash:
Code:
coinbase=trans1+extraNonce1+extraNonce2+trans2
coinbase_hash_bin = hashlib.sha256(hashlib.sha256(binascii.unhexlify(coinbase)).digest()).digest()

and then the following:
Code:
def build_merkle_root(merkle_branch, coinbase_hash_bin):
        merkle_root = coinbase_hash_bin
        for h in merkle_branch:
                #merkle_root = doublesha(merkle_root + binascii.unhexlify(h))
                merkle_root = hashlib.sha256(hashlib.sha256(merkle_root + binascii.unhexlify(h)).digest()).digest()
        return binascii.hexlify(merkle_root)

From here is where things seem to get fuzzy, as https://github.com/ricmoo/nightminer/ gives a different order for the blockheader than say https://braiins.com/stratum-v1/docs where ricmoo has the nbits before the ntime, whilst the latter (and most other documentation) has nbits after ntime.

I can build a simple byte reversal and swap for the merkel_root via:
Code:
def swap_order(s):
    a=list(s[::-1])
    a2=list(s[::-1])
    for i in range(0,len(s),2):
        a[i]=a2[i+1]
        a[i+1]=a2[i]
    return ''.join(a)

and get towards the following:
Code:
padding='000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'
blockHeader=btcVersion+prevHash+swap_order(str(mk_root,'utf-8'))+nTime+nBits+nOnce+padding
hexlify(hashlib.sha256(hashlib.sha256(binascii.unhexlify(blockHeader)).digest()).digest())

but this does not seem to result in hashes that are below the target difficulty.

I've struggled to find a straightforward version of this kind of a script and would appreciate any tips, insights, or links to related projects  Huh
Post
Topic
Board Mining support
Topic OP
Issue with Blockheader from Stratum Data
by
dwarf_racoon
on 25/01/2023, 19:24:02 UTC
Hey hey

I'm writing a python script to take stratum tcp messages recorded through a mining proxy to reconstruct blockheaders and verify the miners' work. Documentation seems fairly sparse and at times conflicting.

From an initial 'mining.subscribe' response, we can gather the ExtraNonce1 (or from a later 'mining.set_extranonce')

From a 'mining.notify' job specification, we can gather the version, previous hash, time, and nBits towards the blockheader, additionally we can gather both the coinbase bits and the merkle branches.

From a 'mining.submission', we can gather the extraNonce2 and the nonce.


We can build the merkle root applying the following by first constructing the coinbase_hash:
Code:
coinbase=trans1+extraNonce1+extraNonce2+trans2
coinbase_hash_bin = hashlib.sha256(hashlib.sha256(binascii.unhexlify(coinbase)).digest()).digest()

and then the following:
Code:
def build_merkle_root(merkle_branch, coinbase_hash_bin):
        merkle_root = coinbase_hash_bin
        for h in merkle_branch:
                #merkle_root = doublesha(merkle_root + binascii.unhexlify(h))
                merkle_root = hashlib.sha256(hashlib.sha256(merkle_root + binascii.unhexlify(h)).digest()).digest()
        return binascii.hexlify(merkle_root)

From here is where things seem to get fuzzy, as https://github.com/ricmoo/nightminer/ gives a different order for the blockheader than say https://braiins.com/stratum-v1/docs where ricmoo has the nbits before the ntime, whilst the latter (and most other documentation) has nbits after ntime.

I can build a simple byte reversal and swap for the merkel_root via:
Code:
def swap_order(s):
    a=list(s[::-1])
    a2=list(s[::-1])
    for i in range(0,len(s),2):
        a[i]=a2[i+1]
        a[i+1]=a2[i]
    return ''.join(a)

and get towards the following:
Code:
padding='000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'
blockHeader=btcVersion+prevHash+swap_order(str(mk_root,'utf-8'))+nTime+nBits+nOnce+padding
hexlify(hashlib.sha256(hashlib.sha256(binascii.unhexlify(blockHeader)).digest()).digest())

but this does not seem to result in hashes that are below the target difficulty.

I've struggled to find a straightforward version of this kind of a script and would appreciate any tips, insights, or links to related projects  Huh
Post
Topic
Board Mining
Re: Pool mining view outgoing mining status
by
dwarf_racoon
on 06/12/2022, 17:35:05 UTC
following barrysty1e a proxy between the miner and pool seems to be working just fine and well. there is a multitude of stratum proxies and simple tcp proxies out there that seem able to do this
Post
Topic
Board Mining
Topic OP
Pool mining view outgoing mining status
by
dwarf_racoon
on 09/11/2022, 16:12:46 UTC
This is probably a very newbie question, but is there a way that I can monitor the hashes and or candidate blockheaders that my BTC Antminer is sending back and forth to a pool? Can this be done just by observing the communication traffic on my subnet or would I have to go through the pool to view this?

In the paper 'Hardening Stratum, the Bitcoin Pool Mining Protocol', it seems like they are able to view this traffic, eg Figure 4. How would one set this kind of a view up? I'm good with dealing with the data side, it's the networking aspect. I'm interested in observing the difficulty of hashes that my miners are outputting, but with more depth than most mining pools I have been on provide.
Post
Topic
Board Mining software (miners)
Re: BraiinsOS S9 SD Card Access
by
dwarf_racoon
on 04/10/2022, 17:02:01 UTC
Okay thank you for the rec, seems I may need to dive into the heavy bits of the OS.

I have been thinking of either trying to get Doom to run whilst mining or even trying to get two instances of the miner OS on a single card to have them switch back and forth. Mostly a fun project with some old mining gear
Post
Topic
Board Mining software (miners)
Topic OP
BraiinsOS S9 SD Card Access
by
dwarf_racoon
on 03/10/2022, 20:18:12 UTC
While running BraiinsOS from SD card on an S9, can the spare storage space on the SD card (in the case where the card storage space is larger than the OS firmware) be accessed, eg from a custom modification of the BraiinsOS?