This file implements the election sortition mechanism for the Canopy blockchain’s Byzantine Fault Tolerance (BFT) consensus protocol. It provides a fair, secure, and decentralized way to select block proposers (leaders) based on their stake in the network.
Election sortition in Canopy is designed to:
The election sortition process uses a multi-step approach to select leaders:
Verifiable Random Function (VRF): Each validator generates a provably random value using their private key and common seed data. This creates unpredictability while allowing verification.
Stake-Weighted Threshold: Validators with more stake have a higher probability of becoming candidates. The system calculates a threshold based on each validator’s voting power relative to the total.
Candidate Selection: Validators whose VRF output falls below their threshold become candidates for leadership.
Leader Selection: From all valid candidates, the one with the lowest VRF output becomes the leader for the current round.
Fallback Mechanism: If no candidates emerge, the system falls back to a stake-weighted pseudorandom selection.
The system uses several parameters to control the sortition process:
The sortition process includes robust verification mechanisms:
The election sortition mechanism includes several security features:
Protection Against Grinding Attacks: By including previous proposer addresses in the seed data, validators cannot manipulate the process by repeatedly trying different inputs.
Protection Against DDoS Attacks: The identity of the leader isn’t known until the process begins, making it difficult for attackers to target specific validators in advance.
Stake-Weighted Fairness: The probability of becoming a leader is proportional to a validator’s stake, ensuring economic alignment with network security.
Non-Malleability: The use of BLS signatures provides non-malleability and uniqueness, making them suitable for the VRF implementation.
Deterministic Leader Selection: Once candidates are identified, the selection of the leader is deterministic, preventing manipulation of the final selection.