Files
rfc-index/nomos/raw/cryptarchia-total-stake-inference.md
Cofson 5eee2fec27 Apply PR review feedback and style improvements
- Add Filip Dimitrijevic as contributor
- Fix first-person language: 'we adjust' → 'the algorithm adjusts'
- Use reference-style links for Cryptarchia v1 Protocol and Stake Analysis
2025-12-25 22:20:20 +01:00

5.5 KiB

title, name, status, category, tags, editor, contributors
title name status category tags editor contributors
CRYPTARCHIA-TOTAL-STAKE-INFERENCE Cryptarchia Total Stake Inference raw Standards Track nomos, cryptarchia, proof-of-stake, stake-inference David Rusu <davidrusu@status.im>
Alexander Mozeika <alexander.mozeika@status.im>
Daniel Kashepava <danielkashepava@status.im>
Filip Dimitrijevic <filip@status.im>

Abstract

This document defines the total stake inference algorithm for Cryptarchia. In proof-of-stake consensus protocols, the probability that an eligible 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.

Semantics

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Background

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, nodes 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

Parameters and Variables

beta (learning rate)

  • Value: 1.0
  • Description: Controls how quickly the algorithm adjusts 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 (observation period)

  • Value: ⌊6k/f⌋
  • Description: The length of the observation period in slots.

f (slot activation coefficient)

  • Value: inherited from Cryptarchia v1 Protocol
  • Description: The target rate of occupied slots. Not all slots contain blocks, many are empty.

k (security parameter)

  • Value: inherited from Cryptarchia v1 Protocol
  • Description: Block depth finality. Blocks deeper than k on any given chain are considered immutable.

Functions

density_over_slots

def density_over_slots(s, p):
    """
    Returns the number of blocks produced in the p slots
    following slot s in the honest chain.
    """

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

Security Considerations

Stake Estimation Accuracy

The accuracy of the total stake inference depends on the observed slot occupancy rate. Implementations SHOULD be aware of the following security considerations:

  • Network delays: Accuracy decreases with increased network delays, as delayed blocks may not be included in density calculations.
  • Adversarial manipulation: An adversary with significant stake could potentially influence the slot occupancy rate by withholding blocks.
  • Convergence period: During periods of rapid stake changes, the estimate may lag behind the actual total stake.

Privacy Considerations

The stake inference algorithm is designed to maintain leader privacy:

  • Leaders calculate their relative stake locally using the shared total stake estimate.
  • Individual stake amounts are never revealed to the network.
  • The algorithm relies only on publicly observable chain growth, not on private stake information.

Copyright and related rights waived via CC0.

References

Normative

Informative