# How to calculate network hasrate from current difficulty?

**URL:** <https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577>\
**Category:** Mining\
**Created:** [April 28, 2017, 4:07pm UTC](https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577 "2017-04-28T16:07:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![valericus](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/valericus/32/4505_2.png) [@valericus](https://forum.zcashcommunity.com/u/valericus)\
**Post date:** [April 28, 2017, 4:07pm UTC](https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577/1 "2017-04-28T16:07:15Z")

</div>

Hi all,

As far as I know difficulty is some abstract value that affects number of calculations required to get new block.

Is there any formula that can be used to calculate actual (or actual for some custom point in past) hashrate of whole network? As far as I know for Monero it can be done with formula difficulty \* 120 / seconds\_for\_block (120 here is hard coded value, estimated time for single block). Is there something similar for ZCash?

---

<div class="post-metadata">

**Author:** ![zij](https://avatars.discourse-cdn.com/v4/letter/z/4af34b/32.png) [@zij](https://forum.zcashcommunity.com/u/zij)\
**Post date:** [April 28, 2017, 4:54pm UTC](https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577/2 "2017-04-28T16:54:50Z")

</div>

Not really as a block cannot be found in a set time - it could be pretty much immediately or take hours depending on the network hash rate.

If you are trying to calculate it to “do” something, why not look it up at: [https://explorer.zcha.in/](https://explorer.zcha.in/) - there is also an api at [API - Zchain](https://explorer.zcha.in/api) which you can use to return JSON with all the data.

---

<div class="post-metadata">

**Author:** ![valericus](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/valericus/32/4505_2.png) [@valericus](https://forum.zcashcommunity.com/u/valericus)\
**Post date:** [May 2, 2017, 8:51am UTC](https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577/3 "2017-05-02T08:51:20Z")

</div>

Sure, I understand that time required for one block depends on number of active miners and network hash rate.

My aim is to calculate average network hash rate during calculating custom block in past and, probably, to build chart of historical hash rate.

---

<div class="post-metadata">

**Author:** ![bit](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@bit](https://forum.zcashcommunity.com/u/bit)\
**Post date:** [May 2, 2017, 2:03pm UTC](https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577/4 "2017-05-02T14:03:23Z")

</div>

Take a look at this:  
[https://en.bitcoin.it/wiki/Difficulty](https://en.bitcoin.it/wiki/Difficulty)

---

<div class="post-metadata">

**Author:** ![valericus](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/valericus/32/4505_2.png) [@valericus](https://forum.zcashcommunity.com/u/valericus)\
**Post date:** [May 15, 2017, 8:10pm UTC](https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577/5 "2017-05-15T20:10:35Z")

</div>

Thank you for link, that helped a lot in understanding of theory. Seems now I have to ensure that length of equihash result is same as for SHA-256 and find somewhere that magic “offset for difficulty 1” to calculate required number of hashes from current difficulty.

---

<div class="post-metadata">

**Author:** ![dallase](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@dallase](https://forum.zcashcommunity.com/u/dallase)\
**Post date:** [May 16, 2017, 2:11pm UTC](https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577/6 "2017-05-16T14:11:29Z")

</div>

In case this helps, Here is how I calculate eth and etc…

My hashrate = 512M  
Block Reward = 4.85  
Eth Difficulty = 409407704069617  
Eth price = 0.05083501  
Etc Difficulty = 29302047027583  
Etc price = 0.00340628  
BTC price = 1700  
Pool Take = 1%

ETH $/day  
$44.83 = (512000000 \* 4.85 ) / ( 409407704069617) \* 0.99 \* 86400 \* (0.05083501\*1700)

ETC $/day  
$41.97 = (512000000 \* 4.85 ) / ( 29302047027583 ) \* 0.99 \* 86400 \* (0.00340628\*1700)

---

<div class="post-metadata">

**Author:** ![valericus](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/valericus/32/4505_2.png) [@valericus](https://forum.zcashcommunity.com/u/valericus)\
**Post date:** [May 16, 2017, 3:27pm UTC](https://forum.zcashcommunity.com/t/how-to-calculate-network-hasrate-from-current-difficulty/15577/7 "2017-05-16T15:27:03Z")

</div>

From your formulas I can see that in case of ETH/ETC difficulty is just estimated number of hashes that should be calculated by network to find next block.

So to find hash rate of whole network during generation of custom block N, I should get difference between time stamp block N and block N-1 and divide it with difficulty of block N, should I?

If yes, what’s the rule for Zcash? I’ve found that for Bitcoin I should multiple result of that division with 2^32 and for Monero with 120. Seems for ETH/ETC we don’t need that coefficient (if your formula is correct). And what about Zcash?
