How are baking and endorsement rights allocated to bakers? Is there a formula? Can we see the distribution of the baking/endorsement rights for all bakers for each cycle? (Particularly for priority 0)
Baking and endorsing rights are allocated at random, proportionally to the delegate's stake, using a PRNG and a random seed derived from on-chain data (nonces committed by bakers and revealed later). For more details, see the doc.
To see the distribution of baking/endorsing rights, use these RPCs:
-
Could a block explorer show the aforementioned randomness by listing the priority 0 baking rights of bakers per cycle? – Adi_daz Oct 27 '19 at 8:37
-
So you would like to see the random seed used to allocate the baking rights? Or just to see who are the bakers at priority 0? – Eugen Oct 27 '19 at 9:38
-
Both...we see which bakers are baking blocks as it happens, but can this info be scraped and presented in advance? – Adi_daz Oct 27 '19 at 12:37
-
To get the seed for the current cycle:
tezos-client rpc post /chains/main/blocks/head/context/seed
(though I don't see what would you use it for...) To get the the bakers at priority 0 for cyclex
:tezos-client rpc get /chains/main/blocks/head/helpers/baking_rights?cycle=x&max_priority=1
– Eugen Oct 27 '19 at 20:58