<p>Suppose your hashrate is H hashes per second.</p>

<p>There are 86400 seconds in a day, so every day you will generate 86400H hashes.</p>

<p>Every hash has roughly 1 in 2^32 chance to be a share, so you'll find 86400 H / 2^32 shares.</p>

<p>Every share has a chance of 1/D to be a block, so you'll find on average 86400 H / (2^32 D) blocks per day (currently D = 267731249).</p>

<p>Every block gives a reward of B, so you'll get on average (86400 H B) / (2^32 D) per day. (Currently B = 25 bitcoins).</p>

<p>Then you can take into account additional factors such as the exchange rate, power costs, difficulty going up over time (requires computing an integral), and so on.</p>

CC BY-SA 3.0
2013-10-22T18:03:52.540Z
Shouldn't you take into account total network hashrate?  You are competing against that for each block reward right?  And block rewards are throttled towards 1 every ten minutes?
user2130126
CC BY-SA 3.0
2013-10-22T19:34:21.510Z
@user2130126: The network hashrate is manifested in the difficulty D. And yes, D is adjusted so that in equilibrium, a block is found every 10 minutes.
Meni Rosenfeld
CC BY-SA 3.0
2013-11-21T01:33:57.423Z
so lets do an experiment. Lets say I have a 100 GHash/s machine. Right now the Difficulty is 609,480,000.
Christopher Rucinski
CC BY-SA 3.0
2016-05-22T13:22:03.590Z
Can you explain or reference where the 2^32 number comes from and how it's calculated?
nallenscott
CC BY-SA 3.0
2016-05-22T19:29:47.490Z
@nallenscott: It comes from the definition of MAX_TARGET, which is 0x00000000FFFF0000000000000000000000000000000000000000000000000000, meaning 2^{224}-2^{208}. The number of possible values of a 256-bit number is meaning 2^{256}. The ratio between those is very close to 2^{32}. A share is defined as a hash which is lower than the max_target (where a block needs to be lower than the current target, which is much lower).
Meni Rosenfeld
CC BY-SA 3.0
2013-10-22T07:18:32.380Z
2014-02-12T21:44:59.413Z
2014-02-12T21:44:59.413Z
Meni Rosenfeld
<p>Can anyone explain the math behind the mining calculators like:</p>

<p><a href="http://www.bitcoinx.com/profit/" rel="nofollow">http://www.bitcoinx.com/profit/</a></p>

<p>I'm trying to build a Google spreadsheet that does the same thing.</p>

<mining-profitability>
Explain the math behind mining profitability calculators
user2130126
# Explain the math behind mining profitability calculators

(Asked by: username_0 on 2013-10-21)

Can anyone explain the math behind the mining calculators like:

<http://www.bitcoinx.com/profit/>

I'm trying to build a Google spreadsheet that does the same thing.

**Tags:** mining-profitability


---

## 1 answers

### Answer by username_1 on 2013-10-22. Score: 8 | Accepted answer

Suppose your hashrate is H hashes per second.

There are 86400 seconds in a day, so every day you will generate 86400H hashes.

Every hash has roughly 1 in 2^32 chance to be a share, so you'll find 86400 H / 2^32 shares.

Every share has a chance of 1/D to be a block, so you'll find on average 86400 H / (2^32 D) blocks per day (currently D = 267731249).

Every block gives a reward of B, so you'll get on average (86400 H B) / (2^32 D) per day. (Currently B = 25 bitcoins).

Then you can take into account additional factors such as the exchange rate, power costs, difficulty going up over time (requires computing an integral), and so on.

> **Comments:**
> **username_0**: Shouldn't you take into account total network hashrate?  You are competing against that for each block reward right?  And block rewards are throttled towards 1 every ten minutes?  
> **username_1**: @username_0: The network hashrate is manifested in the difficulty D. And yes, D is adjusted so that in equilibrium, a block is found every 10 minutes.  
> **username_2**: so lets do an experiment. Lets say I have a 100 GHash/s machine. Right now the Difficulty is 609,480,000.  
> **username_3**: Can you explain or reference where the 2^32 number comes from and how it's calculated?  
> **username_1**: @username_3: It comes from the definition of MAX_TARGET, which is 0x00000000FFFF0000000000000000000000000000000000000000000000000000, meaning 2^{224}-2^{208}. The number of possible values of a 256-bit number is meaning 2^{256}. The ratio between those is very close to 2^{32}. A share is defined as a hash which is lower than the max_target (where a block needs to be lower than the current target, which is much lower).  

---

