0

Interested in validating algorithm for calculating hashrate from stratum messages.

From my understanding following data is needed:
start_time , time when miner started calculating
end_time, time when share from miner was found
difficulty, set by the mining pool

Formula for calculating hashrate(found online) is:
hashrate = difficulty * 2**32 / (end_time - start_time)

Example:
difficulty is 131072 from {"id":null,"method":"mining.set_difficulty","params":[131072]}
(end_time - start_time) is 8.844114780426025 from one real test example

Calculation:
131072 * 2**32 / 8.844114780426025
131072 * 4294967296 / 8.844114780426025
562949953421312 / 8.844114780426025
Hashrate: 63652492917351.58 or around 63 Th/s

Questions:

  1. Is this correct ?
  2. What is 2**32 ? (suspect that it is connected to nonce in block header)
0

1 Answer 1

0

After 2 months, I know more.

Formula is correct for calculating hashrate of one share.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.