Bitcoin Forum
July 15, 2025, 05:50:17 AM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Extranonce in Mining Submit on: March 25, 2025, 04:06:58 AM
I have a question about the last blob in my mining.submit JSON's right after the Nonce (i.e. the "09b66000")

   "1AGf9v4rYBSAnMXi8rvE6nxutC5ZoaVfNa.425" // Miner ID
   "3782626",                                // Job ID
    "ec100000000000",                         // Extranonce2
    "67c28154",                               // Time
    "16384721",                               // Nonce
    "09b66000"                                // Extra nonce (optional, rarely used)
  ],
  "id": 19,                                   // Request ID
  "method": "mining.submit"                   // Method name
}

Is there any chance the the S19 ASIC would ever involve this in the hashing process for any reason at all, and if so, how would it incorporate it? I cannot reconstruct a block header with a decent hash value no matter what I try, so now I'm grasping at straws, wondering if this extra field is somehow used. The pool was cruxpool, in case that matters.
-gt-
2  Bitcoin / Development & Technical Discussion / Looking for a reference to specific examples of BTC mining calculation on: March 05, 2025, 08:18:35 PM
I have spend two weeks now searching the internet for a worked calculation concerning the formulation of the block header to be hashed, but I can't find anything that addresses the WHOLE puzzle, so I thought I'd ask for help here.  I am working on some code for BTC mining on a CPU. Before you get all up in arms about this, I have a fleet of S21 ASIC miners. I know a CPU can't compare, but this is an academic exercise.

I've got my code to communicate to the pool and submit fake or stale shares just to prove that I am able to log in and start mining properly. I'm at the point where I want to fiddle with nonce, etcetera, to find some real shares. I'm on a Ryzen CPU, so I might possibly have enough horse power if I'm lucky to bump into a share before my block expires. But that's not the point ... I want to prove that I fully understand the process by being able to write code to do this.

I managed to get as far as finding an "almost" fully worked example, and tested my code to confirm that I got the same (good) hash as the author did, however I had to manually feed the value for the Merkle root into my code, since there was not enough information in the resource to know how the root was calculated. I know how is SHOULD be calculated, but without this missing information I cannot confirm my understanding. I do have captured traffic from my S21's to test with, but I've never been able to get a hash value that made sense. i.e. no leading or even trailing zeros on it - it always starts (and ends) with a non-zero hex digit. So I temporarily put my captured traffic aside and spent two weeks searching for a fully worked example to confirm that I was doing everything correctly.

As I said, I got as far as finding a source that gave the 80 byte block to be hashed, along with a detailed explanation of most of the bit fields it contained. It works fine, but the portion of the 80 bytes that contains the Merkel root does not have enough information for me to test that my code builds the root correctly. The worked example shows all the transaction hashes in the Merkel Branch, but I also require coinbase1 and coinbase2 along with Extranonce1 in order to include that in the hashing process to build the Merkel root. The example does not include these elements ... I forget just now, but MAYBE the source included an example Extranonce1 in there someplace, but it doesn't matter without coinbase1 and coinbase2, and those are definitely not present.

Now I found many sources that include an actual worked example of JUST this portion, i.e. everything needed find the doubleHash of (coinbase1 + Extranonce + coinbase2), but these examples do not include the rest of what is needed to actually build the 80 byte block header and hash it. So there is no way to verify that it has been done correctly or that an nonce even exists that would correspond to finding a share.  I am looking for a single, fully worked example showing all the steps that includes what the block is supposed to hash to. This is the only way I can confirm my code. Once I can prove my code works, I should be able to plug in my captured S21 data and calculate the hash which had better have a lot of zeros on one side (or the other side).  

Can anyone point me such an example online or even give me some fields that work so I can get my code working? I need all the components that make up the block header including the nonce, and I also need to know what it is supposed to hash to. Can anyone help?
-gt-
3  Bitcoin / Development & Technical Discussion / Hash Rate versus Internet Usage on: December 22, 2018, 06:16:40 AM
I have over 30 GPUs mining various coins, a half dozen Sia coin ASIC miners, another half dozen Dash ASIC's, some BTC ASICs and more than just that. Lets consider ONLY my BTC miners. There are only three ASICs running which together average about 35TH/s. Ignoring all my other equipment, I can't make heads or tails out of my internet usage, which averages about 300GB/month.

Something just doesn't add up.  35 TH/s is 35,000,000,000,000 hashes per second. Multiply that by 3600 seconds in an hour, 24 hours in a day and 30 days in a month, that's 90,720,000,000,000,000,000 hashes per month. Even if each hash only required a single byte to be exchanged in each direction between the miner and the mining pool, this would require 600 million times more internet bandwidth than I am using.

So what exactly is a hash? I thought (apparently naively) that the pool sends you a big 256 bit number and you "hash" it by XORing its bits with a key and with rotated versions of portions of itself, generate a new number and send it back to the pool, and if your miners are generating 35TH/s, then this happens 35 trillion times per second. I guess that's obviously not what's happening.

Just to put my question in context, I'm a computer science professor, but obviously not an expert in this field, however I have had several of my students under my direction implement portions of cryptonightV8 on an FPGA and checked the sub-results against the mining software. I have also developed a complete Keccak implementation on an FPGA for mining Smartcash and I dissected cpuminer to check my hash from my FPGA solution against the hash produced by the software. Right now I'm trying to understand the front-end aspects of mining so I can implement the entire protocol on my FPGA (my FPGA contains a CPU which is C programmable, so I can think more abstractly for some of the front-end tasks, and leave the low-level FPGA stuff for the actual hashing - which is complete). In other words, I think I know what hashing is. However, I can't reconcile the ratings of the miners against the bandwidth of my connection.

So, I need some help understanding what 35 TH/s really means, how it is calculated, and how to relate this to the amount of information exchanged between the miner and the pool. Can anyone help?
-gt-
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!