← Back to team overview

mimblewimble team mailing list archive

Fwd: On block rewards

 

dear grinners,

The attached plot summarizes how the bitcoin emission compares to that of grin
over the first 200 years, assuming a 2% yearly loss of coins.

It was produced from the C program below.
Use arguments -l 0 for the lossless bitcoin emission,
no arguments for bitcoin with 2% loss, and
-s 37 -p 0 for the grin emission in the plot.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>

int main(int argc, char **argv) {
  double reward = 50, power = 0.25, scale = 6*50, loss = 0.02;
  int years = 200, dy = 4, c;
  while ((c = getopt(argc, argv, "d:p:l:s:y:")) != -1) {
    switch (c) {
      case 'd':
        dy = atoi(optarg); // change reward every dy years
        break;
      case 'p':   // emission is reward * 2^{-year*power}, bitcoin
power is 1/4, halving every 4 years
        power = atof(optarg);
        break;
      case 'l':   // yearly loss as fraction of supply
        loss = atof(optarg);
        break;
      case 's':
        scale = atof(optarg); // scale in hourly reward
        break;
      case 'y':
        years = atoi(optarg);
        break;
    }
  }
  scale *= 24 * 365; // scale in hourly reward
  double base = pow(0.5, power), em = 0, sup = 0.0, oldsup, inf = 0;
  for (int y=0; y<years; y+=dy) {
    printf("year %d emission %lf supply %lf inflation %lf\n", y, em, sup, inf);
    for (int yi=0; yi<dy; yi++) {
      em = scale * pow(base, y);
      oldsup = sup;
      sup += em;
      sup *= 1.0 - loss;
      inf = (sup-oldsup) / sup;
    }
  }
  return 0;
}

regards,
-John


Follow ups

References