The proof-of-stake system we model is one where rewards given out at every round is a constant amount. For the a chosen number of rounds, we calculate the probability of any validator reaching the 1/3 threshold. We also calculate the expected distribution of all the validators after n rounds.
- Clone the repository
- Run
python threshold.py
- Input the parameters as shown.
The number of rounds you want to run the simulation for
100
Type of reward scheme -
Type 1 for reward evenly distributed amongst all the validators
Type 2 for a skewed distribution
1
Ratio of stake to rewards of each validator
10
Number of validators
64
The number of rounds you want to run the simulation for
100
Type of reward scheme -
Type 1 for reward evenly distributed amongst all the validators
Type 2 for a skewed distribution
2
Proportion of stake the highest stakeholder has
0.4
Number of validators
64
- In
distribution.py
set thevalidators[]
array to be the desired initial distribution of stake. - Run
python distribution.py