<p>You do not need to specify the difficulty to determine the hashrate:
It is independent from difficulty:</p>

<p>Maybe you mean the probability to find a Block?</p>

<p>There are a number of profitability calculators out there, try this one for example:
<a href="http://www.bitcoinx.com/profit/" rel="nofollow">http://www.bitcoinx.com/profit/</a></p>

CC BY-SA 3.0
2013-03-01T12:51:48.993Z
Thank you, yes, for example I'd like to find the probability of finding a block within 10 minutes at 100 GH/s and a relatively easy target.
makerofthings7
CC BY-SA 3.0
2013-03-01T11:34:03.107Z
2013-03-02T08:30:50.557Z
2013-03-02T08:30:50.557Z
Peter Parker
<p>As I understand your question it has two parts. One is how to calculate an approximation of someone's hash rate externally, like from a server or proxy that can see their mining results but not their actual hashing process or hash rate. The other part is how to calculate the probability that a block would be found after a given amount of work, or a given amount of time and hash rate.</p>

<p>I will write the formulas as javascript code, with X to the power of Y written as Math.pow(X, Y). You could run them in your browser by typing them into the address bar like for example <code>javascript:alert((Math.pow(2, 32) * 27939) / 600)</code>.</p>

<p><strong>Approximation of hash rate:</strong></p>

<p>With an arbitrary target, count one share at difficulty X the same as X shares at difficulty 1. That's how pools deal with variable difficulty.</p>

<blockquote>
  <p>hashrate = (Math.pow(2, 32) * <em>shares</em>) / <em>seconds-elapsed</em></p>
</blockquote>

<p>An average of one share (at difficulty 1) is found for every Math.pow(2,32) hashes. This is only an average and that is why the hash rates displayed at pool web sites are only approximations.</p>

<p><strong>Block solution probability:</strong></p>

<p>The probability of one or more blocks being generated from a given number of shares (proofs of work):</p>

<blockquote>
  <p>prob = 1 - Math.pow(1 - 1.0 / <em>difficulty</em>, <em>shares</em>)</p>
</blockquote>

<p>That's from 0 to 1. Multiply by 100 if you want a percentage.</p>

<p>Let's say the difficulty is 4367876 and someone has been mining with a hashrate of 200 Ghps for 10 minutes. That's 200 * Math.pow(10, 9) hashes per second for 600 seconds, with an average of one share (at difficulty 1) found for every Math.pow(2,32) hashes. This gives us the following:</p>

<blockquote>
  <p>shares = (200 * Math.pow(10, 9) * 600) / Math.pow(2,32) = 27939
  shares</p>
  
  <p>prob = 1 - Math.pow(1 - 1.0 / difficulty, shares) = 1 - Math.pow(1 -
  1.0 / 4367876, 27939) = 0.00637...</p>
</blockquote>

<p>In other words the chance that someone would make one or more blocks with the given hash rate and difficulty within 10 minutes is about 0.64%</p>

<p>Note: if you see how many shares (proofs of work) they send in, of course you don't first calculate their hash rate only to calculate it back into a number of shares. Just plug it into the formula.</p>

CC BY-SA 3.0
2013-03-24T19:21:49.793Z
I've read this several times over, but I don't understand where each instance of `9`, or `32` appears.  Would you elaborate on the selection of those numbers?
makerofthings7
CC BY-SA 3.0
2013-03-25T11:05:11.583Z
Math.pow(10,9) is 1000000000. That's 9 zeroes for the giga in Ghps. I thought it would be more readable to write 200 Ghps this way instead of 200000000000.
Dr.Haribo
CC BY-SA 3.0
2013-03-25T11:10:20.710Z
Math.pow(2,32) hashes will on average yield 1 proof-of-work at difficulty 1. It's actually difficulty 0.999-something, but it's close enough. At this diff you want the first 32 bits in the hash to be zero. This is one outcome out of a possible 2^32 values from those 32 bits. So a hash has a 1 in 2^32 chance.
Dr.Haribo
CC BY-SA 3.0
2013-12-16T21:32:53.150Z
Where did the 32 come from? I thought bitcoin uses sha256? isn't it supposed to be pow(2, 256)?
Timo Huovinen
CC BY-SA 3.0
2013-12-17T14:33:40.683Z
2 to the power of 32 is the average number of hashes to find a difficulty 1 proof of work. There's 2 to the power of 32 possible permutations of 1 and 0 in the 32 first bits of the sha-256 hash. All need to be zero.
Dr.Haribo
CC BY-SA 3.0
2013-03-02T21:26:25.323Z
2013-03-02T21:26:25.323Z
Dr.Haribo
<p>I'm trying to externally calculate the hashrate of a given miner based only on an arbitrarily defined target that I assign, then calculate probability it will be found.  Once this probability is calculated I want to estimate how long it should (on average) take to find a block.</p>

<p>Is this a feasible thing to do?</p>

<p>What is the math required to determine hashrate? </p>

<p>Example: Given that target is 1, and the miner submitted the block in 10 minutes.</p>

<hash><difficulty><hashpower>
Given the probability of finding a block, and time taken, can I infer hashrate?
makerofthings7
# Given the probability of finding a block, and time taken, can I infer hashrate?

(Asked by: username_0 on 2013-02-28)

I'm trying to externally calculate the hashrate of a given miner based only on an arbitrarily defined target that I assign, then calculate probability it will be found. Once this probability is calculated I want to estimate how long it should (on average) take to find a block.

Is this a feasible thing to do?

What is the math required to determine hashrate?

Example: Given that target is 1, and the miner submitted the block in 10 minutes.

**Tags:** hash, difficulty, hashpower


---

## 2 answers

### Answer by username_2 on 2013-03-02. Score: 5 | Accepted answer

As I understand your question it has two parts. One is how to calculate an approximation of someone's hash rate externally, like from a server or proxy that can see their mining results but not their actual hashing process or hash rate. The other part is how to calculate the probability that a block would be found after a given amount of work, or a given amount of time and hash rate.

I will write the formulas as javascript code, with X to the power of Y written as Math.pow(X, Y). You could run them in your browser by typing them into the address bar like for example `javascript:alert((Math.pow(2, 32) * 27939) / 600)`.

**Approximation of hash rate:**

With an arbitrary target, count one share at difficulty X the same as X shares at difficulty 1. That's how pools deal with variable difficulty.

> hashrate = (Math.pow(2, 32) \* *shares*) / *seconds-elapsed*

An average of one share (at difficulty 1) is found for every Math.pow(2,32) hashes. This is only an average and that is why the hash rates displayed at pool web sites are only approximations.

**Block solution probability:**

The probability of one or more blocks being generated from a given number of shares (proofs of work):

> prob = 1 - Math.pow(1 - 1.0 / *difficulty*, *shares*)

That's from 0 to 1. Multiply by 100 if you want a percentage.

Let's say the difficulty is 4367876 and someone has been mining with a hashrate of 200 Ghps for 10 minutes. That's 200 \* Math.pow(10, 9) hashes per second for 600 seconds, with an average of one share (at difficulty 1) found for every Math.pow(2,32) hashes. This gives us the following:

> shares = (200 \* Math.pow(10, 9) \* 600) / Math.pow(2,32) = 27939
> shares
>
> prob = 1 - Math.pow(1 - 1.0 / difficulty, shares) = 1 - Math.pow(1 -
> 1.0 / 4367876, 27939) = 0.00637...

In other words the chance that someone would make one or more blocks with the given hash rate and difficulty within 10 minutes is about 0.64%

Note: if you see how many shares (proofs of work) they send in, of course you don't first calculate their hash rate only to calculate it back into a number of shares. Just plug it into the formula.

> **Comments:**
> **username_0**: I've read this several times over, but I don't understand where each instance of `9`, or `32` appears.  Would you elaborate on the selection of those numbers?  
> **username_2**: Math.pow(10,9) is 1000000000. That's 9 zeroes for the giga in Ghps. I thought it would be more readable to write 200 Ghps this way instead of 200000000000.  
> **username_2**: Math.pow(2,32) hashes will on average yield 1 proof-of-work at difficulty 1. It's actually difficulty 0.999-something, but it's close enough. At this diff you want the first 32 bits in the hash to be zero. This is one outcome out of a possible 2^32 values from those 32 bits. So a hash has a 1 in 2^32 chance.  
> **username_3**: Where did the 32 come from? I thought bitcoin uses sha256? isn't it supposed to be pow(2, 256)?  
> **username_2**: 2 to the power of 32 is the average number of hashes to find a difficulty 1 proof of work. There's 2 to the power of 32 possible permutations of 1 and 0 in the 32 first bits of the sha-256 hash. All need to be zero.  

---

### Answer by username_1 on 2013-03-01. Score: 1

You do not need to specify the difficulty to determine the hashrate:
It is independent from difficulty:

Maybe you mean the probability to find a Block?

There are a number of profitability calculators out there, try this one for example:
<http://www.bitcoinx.com/profit/>

> **Comments:**
> **username_0**: Thank you, yes, for example I'd like to find the probability of finding a block within 10 minutes at 100 GH/s and a relatively easy target.  

---

