Mining reward where in docs?

Hi,

I can’t find anywhere in the docs or on the forum. How do I get the amount of reward a miner receives for discovering a block?

For example, on block #8943429,

0x04668ec2f57cc15c381b461b9fedab5d451c8f7f

received 2.02613327763 ETH

Thanks,
Lorne

Hi @lornestar this is a slightly tricky one based on how the rewards work because there is the gas they receive, the block reward, but then there is also uncles to account for.

The easiest way to do this may be to get the miner address from eth_getBlockByNumber than to do an eth_getBalance on that address for that block and the previous block, however this isn’t perfect because you would have to account for any transfers that address made, and additionally, the miner can assign the reward to any address not necessarily the miner address.

What are you trying to do?

Thanks for the info Mike. yeah it’s a bit tricky. My solution for now is I’m just giving 2 ETH to the miner. I guess when the mining reward changes I will change that value in the backend.

I’m building a blockchain analytics tool.