3

I want to know how I can calculate the profit of bitcoin mining in bitcoins. I am interested in the formula that is used by calculators. For example lets say I have 700mh/s hashrate, current difficulty is 908350862,437. The calculator says I will mine 0.00038755 BTC per day. What algorithm is used to calculate these figures?

5

I want to give an extended answer as I found the pre-existing here or elsewhere in need of a bit more clarification, specifically for newcomers.

Formula

In order to calculate the approximated total bitcoin earnings value per month from a mining operation (not taking into consideration mining costs [electricity, hardware maintenance etc...]) the following formula can be used:

H = Hashrate (hashes / second)
D = Difficulty (Reference for values below)
B = Reward per Block (Reference for value below)
N = Number of days per month (default = 30)
S = Number of seconds per day (S = 60 * 60 * 24 = 86400)

Mining Earnings Formula

Example

H = 21,990,232,555,520 h/s (~= 20TH/s)
D = 47,427,554,950.648
B = 25
N = 30
S = 86400

Mining Earnings Formula

The total number of bitcoins earned per month as per the defined variables above will be ~6.995. Dismiss N from the numerator and you'll get the daily value.

Python

A quick python statement as an example implementation (you can type this directly in the terminal)

$ python -c "print (30*21990232555520*25*86400)/(47427554950.648*2**32)"
$ 6.99542703277

Some References:

Difficulty (Current Value | Wiki)

Reward per Block (Current and Future values)

  • 1
    Does this logic apply for all coins? – Vivek Sancheti Aug 21 '17 at 12:33
  • Where does the 2**32 come from? Is this BTC specific? – domdambrogia Feb 25 '18 at 7:32
  • 1
    @domdambrogia yes, read more about it in the Difficulty wiki reference – Bassem Feb 25 '18 at 21:24
1

The average time to find a block can be approximated by calculating:

time = difficulty * 2**32 / hashrate

Where difficulty is the current difficulty, hashrate is the number of hashes your miner calculates per second, and time is the average in seconds between the blocks you find.

  • Why is this formula just an approximation? I don't see any other parameters which could possibly have an effect on the result (at least if both difficulty and hashrate are constant, of course). – jnnk Dec 13 '13 at 14:49
  • It is an approximation because mining is a game of variance and luck. There are times that you could get lucky and generate more blocks than predicted and there will surely be dry spells when blocks do not occur. This can be seen by watching large mining pools as they solve blocks, blocks are not created on a set schedule by any means the network adjusts such that one block should be generated every 10 minutes, but we know that this will need to be adjusted regularly based on new miners coming online all the time. The network hashrate and thus the difficulty will be regularly changing. – Mark S. Dec 14 '13 at 2:46
  • That's why the formula can only give an average time. Still, even formulas for averages can be approximated, but I think here we have an exact formula for an average value (this may sound a little nitpicky, but in my opinion it's still a not too unimportant distinction). – jnnk Dec 14 '13 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.