2.4 KiB
2.4 KiB
The general idea of this implementation of Casper is as follows:
- There exists a deterministic algorithm which determines a single proposer for each block. Here, the algorithm is simple: every validator is assigned an ID in the range
0 <= i < NUM_VALIDATORS
, and validatori
proposes all blocksNUM_VALIDATORS * k + i
for allk ϵ Z
. - Validators perform a binary repeated betting procedure on every height, where they bet a value
0 < p < 1
for the probability that they think that a block at that height will be finalized. The bets are incentivized via logarithmic scoring rule, and the result of the bets themselves determines finalization (ie. if 2/3 of all validators betp > 0.9999
, the block is considered finalized, and if 2/3 of all validators betp < 0.0001
, then the state of no block existing at that height is considered finalized); hence, the betting process is self-referential. - From an incentive standpoint, each validator's optimal strategy is to bet the way they expect everyone else to be betting; hence, it is like a schellingcoin game in certain respects. Convergence in either direction is incentivized. As
p
approaches 0 or 1, the reward for betting correctly increases, but the penalty for betting incorrectly increases hyperbolically, so one only has the incentive to betp > 0.9999
orp < 0.0001
if they are really sure that their bet is correct. - If a validator's vote exceeds
p = 0.9
, they also need to supply the hash of the block header. Proposing two blocks at a given height is punishable by total deposit slashing. - From a BFT theory standpoint, this algorithm can be combined with a default strategy where bets are recorded in log odds (ie.
q = ln(p/(1-p))
), if 2/3 of voters voteq = k
or higher fork >= 1
, you voteq = k+1
, and if 2/3 of voters voteq = k
or lower fork <= -1
, you voteq = k-1
; this is similar to a highly protracted ten-round version of Tendermint (log odds of p = 0.9999 ~= 9.21). - If 2/3 of voters do not either vote
q >= 1
orq <= -1
, then the default strategy is to vote 0 if a block has not yet arrived and it may arrive close to the specified time, voteq = 1
if a block has arrived close to the specified time, and voteq = -1
if a block either has not arrived and the time is far beyond the specified time, or if a block has arrived and the time is far beyond the specified time. Hence, if a block at a particular height does not appear, the votes will converge toward 0.