Bitcoin

Mining Pool – Calculate hashrate from Stratum messages

I am interested in verifying an algorithm for calculating hashrate from stratum messages.

According to my understanding I need the following data:
start_time Time when the miner started calculating
end_timeThe time the miner’s share was discovered
difficultySet by mining pool

The hashrate calculation formula (available online) is:
hashrate = difficulty * 2**32 / (end_time - start_time)

yes:
difficulty is 131072 from "id":null,"method":"mining.set_difficulty","params":(131072)
(end_time - start_time) is 8.844114780426025 One of the real test examples

calculate:
131072 * 2**32 / 8.844114780426025
131072 * 4294967296 / 8.844114780426025
562949953421312 / 8.844114780426025
Hash rate: 63652492917351.58 Or around 63 Th/s

question:

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

Related Articles

Back to top button