Owners: @David Rusu @Alexander Mozeika @Daniel Kashepava

Reviewers: 🟢@Daniel Sanchez Quiros 🟢@Hong-Sheng Zhou 🟢@Álvaro Castro-Castilla

Introduction

As with any Proof of Stake (PoS) consensus protocol, the probability that an eligible Cryptarchia participant wins the right to propose a block depends on that participant’s stake relative to the total active stake. Because leader selection in Cryptarchia is private, the total active stake is not directly observable. Instead, nodes must infer it from observable chain growth.

Overview

The total active stake can be inferred by observing the slot occupancy rate: a higher fraction of occupied slots implies more stake participating in consensus. By observing the rate of occupied slots from the previous epoch and knowing the total stake estimate used during that period, we can infer a correction to the total stake estimate to compensate for any changes in consensus participation. This inference process is done by each node following the chain. Leaders will use this total stake estimate to calculate their relative stake as part of the leadership lottery without revealing their stake to others.

The stake inference algorithm adjusts the previous total stake estimate based on the difference between the empirical slot activation rate (measured as the growth rate of the honest chain) and the expected slot activation rate. A large difference serves as an indicator that the total stake estimate is not accurate and must be adjusted.

This algorithm has been analyzed and shown to have good accuracy, precision and convergence speed. A caveat to note is that accuracy decreases with increased network delays. The analysis can be found in Total Stake Inference Analysis.

Construction

Definitions

Parameters and variables

Symbol Value Name Description
beta 1.0 learning rate Controls how quickly we adjust to new participation levels.

Lower values for beta give a more stable / gradual adjustment, while higher values give faster convergence but at the cost of less stability. | | PERIOD | $\lfloor 6\frac{k}{f} \rfloor$ | observation period | The length of the observation period in slots. | | f | inherited from ‣ | slot activation coefficient | The target rate of occupied slots. Not all slots contain blocks, many are empty. | | k | inherited from ‣ | security parameter | Block depth finality. Blocks deeper than k on any given chain are considered immutable. |

Functions

Algorithm

For a current epoch’s estimate total_stake_estimate and the epoch’s first slot epoch_slot, the next epoch’s estimate is calculated as shown below:

def total_stake_inference(total_stake_estimate, epoch_slot):
    period_block_density = density_over_slots(epoch_slot, PERIOD)
		slot_activation_error = 1 - period_block_density / (PERIOD * f)
		coefficient = total_stake_estimate * beta
		return total_stake_estimate - coefficient * slot_activation_error

Annex

Total Stake Inference Analysis