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?
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/ - there is also an api at API - Zchain which you can use to return JSON with all the data.
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.
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?