I'd like to understand how uncles reward is calculated.
We have two calculated blocks, both of them have 2 uncles, but one block has 8.125 Ether, which other has 6.25 Ether. What have I missed?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
The uncle reward calc is:
(U_n + 8 - B_n) * R / 8
In the first example, there are two uncles, U1 and U2. The uncle number of U1 is 4445, and the uncle number of U2 is 4446. The block number is 4447 and R is 5.
The uncle reward for the first example is the sum of the rewards for each uncle:
U1: (4445 + 8 - 4447) * 5 / 8 = 3.75 U2: (4446 + 8 - 4447) * 5 / 8 = 4.375 = 8.125
One block is the parent's generation, the other one is the grandparent's generation. An uncle loses basically 20% for each generation it is lower than the current block.
For the second example, the uncles are in the same generation but the generation is further away (three blocks lower), so the overall uncle reward is lower:
U1: (2557 + 8 - 2560) * 5 / 8 = 3.125 U2: (2557 + 8 - 2560) * 5 / 8 = 3.125 = 6.250