<aside> 💡
This total stake inference process is assuming PoLv1 where we could use orphans to count all blocks produced in an epoch. With PoLv2, we no longer can see outside of the single chain so the estimator will have a bias. Some notes on this here:
</aside>
Owners: @David Rusu @Alexander Mozeika
Reviewers:
Given that stake is private in Cryptarchia, and that we want to maintain an approximately constant block rate, we must therefore adjust the difficulty of the slot lottery somehow based on the level of participation.
In Bitcoin, the mining difficulty is adjusted to target a block production rate of 2016 blocks every 2 weeks. Similarly, in Cryptarchia, we observe the block production rate over the course of the past epoch and use that to infer the total stake participating in consensus. This inferred value then becomes the stake relativization constant $D^{ep}$ for the leadership lottery during the following epoch.
We observe the block production rate in the first $\lfloor 6\frac{k}{f} \rfloor$ slots of each epoch, and using that we infer an estimate of the total stake participating in consensus.
Symbol | Value | Name | Description |
---|---|---|---|
$\beta\in(0,1)$ | 0.8 | learning rate | Controls how quickly we adjust to new participation levels, lower value of $\beta$ gives a more stable / gradual adjustment, while higher values give faster convergence but at the cost of less stability. |
$T > 0$ | $\lfloor 6\frac{k}{f} \rfloor$ | observation period | The length of the observation period in slots. |
$f\in(0,1)$ | inherited | slot activation coefficient | The target rate of slots occupied by blocks |
$N_\text{BLOCK}^{ep} \ge0$ | derived at runtime | block count | The number of blocks produced observed during observation period |
$D^{ep+1}$ is derived from the previous epoch as follows
$$ D^{ep+1}=D^{ep}-\beta\frac{D^{ep}}{\log\left(\frac{1}{1-f}\right)}\left(\log\left(\frac{1}{1-f}\right)-\frac{N_\text{BLOCK}^{ep}}{\#slots}\right) $$
Details of where this inference equation is derived from can be found in the following research document