Skip to content

Proof of Stake (PoS) is a category of consensus algorithms for public blockchains that depend on a validator's economic stake in the network. We model a general proof-of-stake system as a Plóya urn distribution.

Notifications You must be signed in to change notification settings

aparnakr/pos-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pólya's urn simulations

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.

Calculating the probability that any validator reaches the 1/3 stake threshold:

  1. Clone the repository
  2. Run python threshold.py
  3. Input the parameters as shown.

Case 1: Initial stake is evenly distributed amongst validators

Example:

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

Case 2: Initial stake distributed amongst validators is skewed

Example:

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

Calculating the expected distirbution of all the validators after n rounds:

  1. In distribution.py set the validators[] array to be the desired initial distribution of stake.
  2. Run python distribution.py

About

Proof of Stake (PoS) is a category of consensus algorithms for public blockchains that depend on a validator's economic stake in the network. We model a general proof-of-stake system as a Plóya urn distribution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •