TIL - How Much Witnesses and Miners Make Per Block

in witness-category •  2 years ago

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.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

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

·

Thanks :)

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.

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

·

Sounds about right.

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

·

Welcome!

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

·

Yes, the change was made to close the gap in financial incentives between backup witnesses (especially those near 19) and the top 19. It was changed with the other inflation changes on December 6th with the 16th hardfork.

·
·

Cool, thanks for sharing @pfunk!

·

Correct.

·
·
·
·
·

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

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

This post has been ranked within the top 10 most undervalued posts in the first half of Feb 05. We estimate that this post is undervalued by $14.20 as compared to a scenario in which every voter had an equal say.

See the full rankings and details in The Daily Tribune: Feb 05 - Part I. You can also read about some of our methodology, data analysis and technical details in our initial post.

If you are the author and would prefer not to receive these comments, simply reply "Stop" to this comment.

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.

@timcliff thanks for this. I've been trying to find historical data for the 3 day average steem/usd price held by witnesses. So far I can only get the current average. Is this historical data kept anywhere?

·

I’m not aware of anywhere this data is stored for historical values.

·
·

Thanks for the quick reply. I've just noticed that it the price gets listed regularly on steemd for witnesses so I'm figuring it's on the BC so I'm going to see if there's a way to query for it with curl. I presume there's a call for the current price feed but not sure how to get to previous entries.

Best

·
·
·

Thank you for the kind vote @timcliff.

I have decided to use to javascript to parse the info from steemd instead as that will be quicker given my little knowledge of querying the steem bc.