Consensus/proof_of_stake library

Proof of Stake (PoS) - staking and slot selection primitives

A production-minded PoS helper that demonstrates the core selection mechanics used by modern PoS chains: weighted validator sampling by stake, epoch/slot scheduling, deterministic pseudo-random selection (seeded RNG), and slashing checks (simple examples). This is a toolkit for simulations and protocol experiments rather than a full node implementation.

Contract:

  • Input: list of validators with stake amounts, epoch/slot info, randomness
  • Output: proposer/attester selections and basic slashing decisions
  • Errors: throws on invalid stake distributions or empty validator set

Classes

PoS
PoS toolkit with a registry and deterministic, reproducible selection.
Validator