Cardano rewards

Every slot (i.e. every sec) the block producer runs a lottery. Every ADA that is delegated to your pool represents one ticket in that lottery. The total stake (i.e. 23bn) represents the total number of tickets over all pools. Only five percent of the slots are actually used, which makes 21600 blocks per epoch. So, there is a draw from a jug of lottery tickets 21600 times per epoch. If you divide the 23bn from above by 21600 you get the required stake to mint 1 block per epoch (on average), which would be about 1.1m

Input to the lottery is your pool id, your active stake and the vrf.skey, which is the private key for the verifiable random function (VRF). Only you have that key, so only you can run the lottery, but others can verify wether the result that you present is valid i.e. they have the public vrf key.

This happens in real time every sec on the block producer. However, because all input to that VRF is known (to you) before the epoch begins, you might as well run the lottery for every slot in the epoch (i.e. 432000 times) in advance. The result is the exact time stamps that your block producer is expected to mint a block. You get output like this …

$ cat cardano/leaderlog.json 
{
  "status": "ok",
  "epoch": 301,
  "epochNonce": "c0e8aa015de7703c6fbec6c85a0aafb0974082e1eb4808061ad2e5ef23a2fd62",
  "epochSlots": 15,
  "epochSlotsIdeal": 14.57,
  "maxPerformance": 102.95,
  "poolId": "9e8009b249142d80144dfb681984e08d96d51c2085e8bb6d9d1831d2",
  "sigma": 0.0006744129763041292,
  "activeStake": 16089810845967,
  "totalActiveStake": 23857504839454980,
  "d": 0.0,
  "f": 0.05,
  "assignedSlots": [
    {
      "no": 1,
      "slot": 44673815,
      "slotInEpoch": 5015,
      "at": "2021-11-07T00:08:26+01:00"
    },
    {
      "no": 2,
      "slot": 44712467,
      "slotInEpoch": 43667,
      "at": "2021-11-07T10:52:38+01:00"
    },
    {
      "no": 3,
      "slot": 44766267,
      "slotInEpoch": 97467,
      "at": "2021-11-08T01:49:18+01:00"
    },
...
}

Here is how you can run the leaderlog.

1 Like