TIL - How Much Witnesses and Miners Make Per Block

in #witness-category7 years ago (edited)

Prior to HF 16, the witness pay was simple. Each block mined = 1 STEEM. After HF 16, it got a lot more complicated..

HF 16 made the following changes to the witness pay:

  • The block production pay was reduced.
  • The payout per block became different depending on if you were a top-19 witness, backup witness, or miner.
  • The payout per block became a dynamic calculation based on the current inflation rate and (virtual) supply of STEEM.

Since the amount was no longer easy to determine, GitHub issue 832 was opened to make the witnesses payouts visible. This would be useful, but in the meantime I decided to calculate it by hand.

This is how much STEEM is paid per block, given the current inflation rate and virtual supply of STEEM:

Disclaimer: These numbers were calculated by hand and are subject to error. I did my best to ensure their accuracy, but please double check everything if you plan to use these numbers for anything important. Also, these calculations are made based on the current inflation rate and virtual supply of STEEM. The numbers will change over time as the supply of STEEM and the inflation rate change.

A few other notes:

  • A new block is produced every 3 seconds.
  • Every 21 blocks, each of the top 19 witnesses, one backup witness, and one miner will produce a block.
  • Payments are made as Steem Power.

Ok, now for the nerdy part. Here is all the code/math.

Code:

uint8_t top19_weight = 1;
uint8_t timeshare_weight = 5;
uint8_t miner_weight = 1;

_wso.witness_pay_normalization_factor =
   _wso.top19_weight * num_elected
 + _wso.miner_weight * num_miners
 + _wso.timeshare_weight * num_timeshare;

/**
* At block 7,000,000 have a 9.5% instantaneous inflation rate, decreasing to 0.95% at a rate of 0.01%
* every 250k blocks. This narrowing will take approximately 20.5 years and will complete on block 220,750,000
*/
int64_t start_inflation_rate = int64_t( STEEMIT_INFLATION_RATE_START_PERCENT );
int64_t inflation_rate_adjustment = int64_t( head_block_num() / STEEMIT_INFLATION_NARROWING_PERIOD );
int64_t inflation_rate_floor = int64_t( STEEMIT_INFLATION_RATE_STOP_PERCENT );

// below subtraction cannot underflow int64_t because inflation_rate_adjustment is <2^32
int64_t current_inflation_rate = std::max( start_inflation_rate - inflation_rate_adjustment, inflation_rate_floor );

auto new_steem = ( props.virtual_supply.amount * current_inflation_rate ) / ( int64_t( STEEMIT_100_PERCENT ) * int64_t( STEEMIT_BLOCKS_PER_YEAR ) );
auto content_reward = ( new_steem * STEEMIT_CONTENT_REWARD_PERCENT ) / STEEMIT_100_PERCENT; /// 75% to content creator
auto vesting_reward = ( new_steem * STEEMIT_VESTING_FUND_PERCENT ) / STEEMIT_100_PERCENT; /// 15% to vesting fund
auto witness_reward = new_steem - content_reward - vesting_reward; /// Remaining 10% to witness pay

const auto& cwit = get_witness( props.current_witness );
witness_reward *= STEEMIT_MAX_WITNESSES;

if( cwit.schedule == witness_object::timeshare )
    witness_reward *= wso.timeshare_weight;
else if( cwit.schedule == witness_object::miner )
    witness_reward *= wso.miner_weight;
else if( cwit.schedule == witness_object::top19 )
    witness_reward *= wso.top19_weight;

witness_reward /= wso.witness_pay_normalization_factor;

Based on the code above, here are the calculations:

Pre-weighted per block witness pay:

STEEMIT_BLOCKS_PER_YEAR = 365*24*60*60/3 = 10,512,000
current_virtual_supply = 248,954,830 STEEM
current_inflation_rate = .0942
new_steem = 248,954,830 * .0942 / 10,512,000 = 2.2309
witness_reward = .1 * 2.2309 = .22309

[Edit] Thanks to @abit for pointing out that the current inflation is 9.42% (not 9.5%).

Weighted per block witness pay:

witness_pay_normalization_factor = (1 * 19) + (1 * 1) + (5 * 1) = 25
backup = .22309 * 5 * 21 / 25 = .9370 STEEM
miner = .22309 * 1 * 21 / 25 = .1874 STEEM
top19 = .22309 * 1 * 21 / 25 = .1874 STEEM

Here are the results:

  • Top 19 Witnesses: 0.1874 STEEM per block
  • Backup Witnesses: 0.9370 STEEM per block
  • Miners: 0.1874 STEEM per block

Reminder to read the disclaimer above if you plan to use these numbers for anything important.


Reminder to vote for witnesses!
https://steemit.com/~witnesses
If you aren't sure who to vote for, check out this Witness Voting Guide.

Sort:  

Tremendous amount of information and understanding of the ecosystem. Thanks for your contribution. You have my vote.

Voted you for witness!

Thanks for taking time out and doing these calculations. It gives a better understanding to the new members.

Very interesting read. Thanks for posting. This information is valuable for those looking to become witnesses.

Hey @scottcbusiness did you see this?

You just got my witness vote.
Thanks for the details although it's 6 months old. The gist of the post is still valid.

Thanks. Yes, pretty much if you switch "miner" to "top 20 witness" (instead of 19) and plug in the latest numbers into the formula, everything is still correct :)

Was such a tool to calculate witness payout ever been developed?

For historical information or current block rewards? I believe @someguy123 came up with a tool for historical data.

As of writing, head block is 9103018, according to this comment, current inflation rate is 9.42%

/**
* At block 7,000,000 have a 9.5% instantaneous inflation 
* rate, decreasing to 0.95% at a rate of 0.01%
* every 250k blocks. This narrowing will take approximately 
* 20.5 years and will complete on block 220,750,000
*/

Thank you! I will correct it.

Thank you for doing this. I was wondering about this a few days ago. :)

Yea so I get about 1 steem power ever 50000 blocks.

Sounds about right.

Backup witnesses make more per block than the top 19 because they produce far less blocks I assume ?

Number for every witnesses can be seen here. Here's one example.

https://steemdb.com/@abit/blocks

Coin Marketplace

STEEM 0.30
TRX 0.11
JST 0.033
BTC 64223.84
ETH 3158.34
USDT 1.00
SBD 4.29