Formula to calculate current block reward

rango

Active Member
Jun 19, 2014
158
221
103
Guys, what would be the formulae to calculate current block reward going to the miners? That's what i have currently got. Is this calculation correct?

---
$masternode reward=0.75;
$reward = 2222222/pow((($difficulty+2600)/9),2)*$masternode reward;
if ($reward < 5) {
$reward = 5*$masternode reward;
}
---

Where was the post listing the increasing masternode payments? Is the increase of masternode payments tied to a specific block height?

Thank you,
Rango
 

crowning

Well-known Member
May 29, 2014
1,414
1,997
183
Alpha Centauri Bc
Guys, what would be the formulae to calculate current block reward going to the miners?
[...]
Is the increase of masternode payments tied to a specific block height?
Code:
  nSubsidy = (2222222.0 / (pow((dDiff+2600.0)/9.0,2.0)));
  if (nSubsidy > 25) nSubsidy = 25;
  if (nSubsidy < 5) nSubsidy = 5;
You forgot the ">25" part. This is the block reward.
Subtract from this the amount the Masternodes get and you have what the miners will get (minus the fees of course).

Masternode Payments:
Code:
  int64_t ret = blockValue/5; // start at 20%

  if(nHeight > 158000)  ret += blockValue / 20;  //25.0%  - 2014-10-23
  if(nHeight > 158000+((576*30)*1)) ret += blockValue / 20;  //30.0%  - 2014-11-23
  if(nHeight > 158000+((576*30)*2)) ret += blockValue / 20;  //35.0%  - 2014-12-23
  if(nHeight > 158000+((576*30)*3)) ret += blockValue / 40;  //37.5%  - 2015-01-23
  if(nHeight > 158000+((576*30)*4)) ret += blockValue / 40;  //40.0%  - 2015-02-23
  if(nHeight > 158000+((576*30)*5)) ret += blockValue / 40;  //42.5%  - 2015-03-23
  if(nHeight > 158000+((576*30)*6)) ret += blockValue / 40;  //45.0%  - 2015-04-23
  if(nHeight > 158000+((576*30)*7)) ret += blockValue / 40;  //47.5%  - 2015-05-23
  if(nHeight > 158000+((576*30)*9)) ret += blockValue / 40;  //50.0%  - 2015-07-23
  if(nHeight > 158000+((576*30)*11)) ret += blockValue / 40; //52.5%  - 2015-09-23
  if(nHeight > 158000+((576*30)*13)) ret += blockValue / 40; //55.0%  - 2015-11-23
  if(nHeight > 158000+((576*30)*15)) ret += blockValue / 40; //57.5%  - 2016-01-23
  if(nHeight > 158000+((576*30)*17)) ret += blockValue / 40; //60.0%  - 2016-03-23
 
Last edited by a moderator:

maky

Member
Nov 14, 2014
71
32
58
OK, what is this 'pow' and how big is 'dDiff' today?

pow(x, y) = x^y ?

And how is max number of coins restricted if production changes daily? ;)
 

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
  • Like
Reactions: maky

wsmithston

New Member
Aug 4, 2015
19
8
3
Looking at block http://explorer.darkcoin.io/block/00000000000b7ca7c2b5b1e902a6579a46fdccdc478ae6549edf5338cc703c01
which has a difficulty of 2796.435, the block reward should be 2222222/((2796.435+2600)/9)^2 = 6.18099740 Dash. http://www.wolframalpha.com/input/?i=2222222/((2796.435+2600)/9)^2

Instead the block reward is 4.64285715 Dash. Can someone elaborate? Which difficulty is used to calculate the Block Reward if not the current difficulty?

Also, the block reward mentioned on www.reddit.com/r/dashpay is:

Block reward is controlled by Moore's law: 2222222/(((Difficulty+2600)/9)2)

There is a ^ missing there.

*edit: added wolframalpha link
 
  • Like
Reactions: flare

flare

Grizzled Member
May 18, 2014
2,286
2,404
1,183
Germany
Looking at block http://explorer.darkcoin.io/block/00000000000b7ca7c2b5b1e902a6579a46fdccdc478ae6549edf5338cc703c01
which has a difficulty of 2796.435, the block reward should be 2222222/((2796.435+2600)/9)^2 = 6.18099740 Dash. http://www.wolframalpha.com/input/?i=2222222/((2796.435+2600)/9)^2

Instead the block reward is 4.64285715 Dash. Can someone elaborate? Which difficulty is used to calculate the Block Reward if not the current difficulty?

Also, the block reward mentioned on www.reddit.com/r/dashpay is:

Block reward is controlled by Moore's law: 2222222/(((Difficulty+2600)/9)2)

There is a ^ missing there.

*edit: added wolframalpha link
Short answer: -the miner destroyed some reward-

EDIT: The difficulty of the previous block is used, see below :)

Long answer:

Like you pointed out the formula is 2222222/((2796.435+2600)/9)^2 = 6.18099740 DASH

As we are using int64_t for the calculation only the integer value is used --> 6 DASH

Now we are in 2nd year of Dash, which means this is reduced by 1/14 ~= 7.1% --> 6 * (1-(1/14)) = 5.57142857 DASH

So the matching reward for difficulty 2796.435 is 5.57142858 DASH, which will be mined in the next block.

Which means
whoever mined this block left out 0.91857142 DASH, which may appear weird, but still makes
up a valid block.
The formula does only calculate the maximum amount ("ceiling function") to
be mined, the miner is free to claim everything below. The unclaimed coins from the coinbase are lost/destroyed.

Btw: The next block http://explorer.darkcoin.io/block/0000000000076a1a29de640d7f16f962a271c967aaae1dec3f0f1b0ac40b4366
with difficulty 2723.625 generated the maximum number of coins: 5.57142858 DASH


Hope that helps
 
Last edited by a moderator:
  • Like
Reactions: wsmithston

UdjinM6

Official Dash Dev
Dash Core Group
May 20, 2014
3,639
3,537
1,183
Short answer: this block destroyed some reward :)

Long answer:

Like you pointed out the formula is 2222222/((2796.435+2600)/9)^2 = 6.18099740 DASH

As we are using int64_t for the calculation only the integer value is used --> 6 DASH

Now we are in 2nd year of Dash, which means this is reduced by 1/14 ~= 7.1% --> 6 * (1-(1/14)) = 5.57142857 DASH

So the matching reward for difficulty 2796.435 is 5.57142857 DASH, which means
whoever mined this block left out 0.91857142 DASH, which may appear weird, but still makes
up a valid block - the formula does only calculate the maximum amount ("ceiling function") to
be mined, the miner can claim everything below.

Btw: The next block http://explorer.darkcoin.io/block/0000000000076a1a29de640d7f16f962a271c967aaae1dec3f0f1b0ac40b4366
with difficulty 2723.625 generated the maximum number of coins: 5.57142858 DASH

Hope that helps
When you calculate reward you should use difficulty of previous block:
Code:
2222222/((3036.93+2600)/9)^2 = 5,6648338721 = 5 (int)
5 * (1 - 1/14) = 4,6428571429
Generation: 4.64285715 + 0 total fees
 

Sub-Ether

Well-known Member
Mar 31, 2014
1,516
1,256
183
Looking at block http://explorer.darkcoin.io/block/00000000000b7ca7c2b5b1e902a6579a46fdccdc478ae6549edf5338cc703c01
which has a difficulty of 2796.435, the block reward should be 2222222/((2796.435+2600)/9)^2 = 6.18099740 Dash. http://www.wolframalpha.com/input/?i=2222222/((2796.435+2600)/9)^2
Instead the block reward is 4.64285715 Dash. Can someone elaborate? Which difficulty is used to calculate the Block Reward if not the current difficulty?
Lol, was still working this out, I took off the 7% per year deduction, and I tried previous block difficulty, but I didn't try previous block and -7% :rolleyes:
 

pille

Active Member
Feb 18, 2015
276
306
123
Example block: 376191 payout 4.17857144, previous block 376190 had a difficulty of 4748.128

2222222/((4748.128+2600)/9)^2 = 3.33364259018 = 3 (int)
3 * (1 - 1/14) = 2.78571428571

Why?

And, is there any API where I get the current masternode count without hosting my own deamon?
If not would you mind crowning, when I grab from your site, lets say once every hour for a little project (simple monitor showing the value of all your Dash addresses, daily and monthly interest in your local currency)? 'Estimated Payment per Masternode / day' is what I need.
 

UdjinM6

Official Dash Dev
Dash Core Group
May 20, 2014
3,639
3,537
1,183
Example block: 376191 payout 4.17857144, previous block 376190 had a difficulty of 4748.128

2222222/((4748.128+2600)/9)^2 = 3.33364259018 = 3 (int)
3 * (1 - 1/14) = 2.78571428571

Why?

....
Because there is a limit for minimum reward
Code:
if (nSubsidy < 5) nSubsidy = 5;
and there is also 10% reduction because of DGBB
 
  • Like
Reactions: pille