<p>The hashing power is estimated from the number of blocks being mined in the last 24h and the current block difficulty. More specifically, given the average time T between mined blocks and a difficulty D, the estimated hash rate per second H is given by the formula <code>H = 2exp32 D / T</code></p>

CC BY-SA 4.0
2021-11-28T11:28:04.163Z
2021-11-28T11:28:04.163Z
Hamita
<p>The call <code>bitcoin-cli getmininginfo</code> returns a metric <code>networkhashps</code> among others. It shows how many hashes the entire Bitcoin network generates per second.</p>
<p>This metric however, is not directly stored within the Blockchain, resp. it is not communicated over the gossip network.
Consequently it must be derived; I assume that it takes the difficulty and also checks the time it took between blocks.</p>
<p>But how does the algorithm behind this <em>exactly</em> look like?</p>

<bitcoin-core><difficulty><bitcoin-cli><hashpower>
Algorithm behind Bitcoin Core's hashes/s metric
Dalit Sairio
# Algorithm behind Bitcoin Core's hashes/s metric

(Asked by: username_0 on 2021-11-27)

The call `bitcoin-cli getmininginfo` returns a metric `networkhashps` among others. It shows how many hashes the entire Bitcoin network generates per second.

This metric however, is not directly stored within the Blockchain, resp. it is not communicated over the gossip network.
Consequently it must be derived; I assume that it takes the difficulty and also checks the time it took between blocks.

But how does the algorithm behind this *exactly* look like?

**Tags:** bitcoin-core, difficulty, bitcoin-cli, hashpower


---

## 1 answers

### Answer by username_1 on 2021-11-28. Score: 1

The hashing power is estimated from the number of blocks being mined in the last 24h and the current block difficulty. More specifically, given the average time T between mined blocks and a difficulty D, the estimated hash rate per second H is given by the formula `H = 2exp32 D / T`


---

