Algorand how is round membership computed from the output of a VRF

30 Views Asked by At

How does Algorand determine if an account/node is selected for participation in each round? To my knowledge, the VRF outputs a float [0,1]. How does the system use this to decide participation in each round?

1

There are 1 best solutions below

0
Fabrice On

At high-level, you can indeed see the VRF output as a random variable sampled uniformly from [0,1]. Algorand converts this uniform random variable into a binomial random variable of parameters:

  • number of trials n = stakeOfTheAccount
  • p = expectedSizeOfCommittee / totalOnlineStake

This random variable indicates the number of seats in the committee the account gets (i.e., the number of time the key was selected).

Since a binomial random variable with parameters (n,p) is the sum of independent Bernouilli random variables with parameter p, this computation yields the same result as if each Algo was individually selected with probability p (which ensures it is the same to have 1 big account with n Algos or n small accounts with 1 Algo).

The code for the conversion of vrfOutput into number of seats in the committee can be found there: https://github.com/algorand/go-algorand/blob/master/data/committee/sortition/sortition.go