> For the complete documentation index, see [llms.txt](https://canopy-network.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://canopy-network.gitbook.io/docs/canopy-network/core-features/nestbft/vrf-leader-election.md).

# VRF Leader Election

### Leader Selection in Consensus

In most Byzantine Fault Tolerant systems, a proposer is elected to produce the subsequent block in the chain. This function allows simplicity and minimizes communication as the Validator Set decides on the contents of the next block.

*However, if designed incorrectly, the network may be* [*halted*](/docs/canopy-network/core-features/chain-halt-rescue.md#whats-a-chain-halt) *or tokens may be distributed unfairly, threatening the integrity and confidence of the entire system.*

### Distributed Denial of Service Attacks

💡A DDoS attack is a coordinated exploit where multiple sources overload a system by overwhelming a server with requests.&#x20;

Performing a DDoS attack on a series of BFT leaders would cause an extended non-liveness event for the chain, essentially halting the system.

An example of weak DDoS protection is **any chain built with Tendermint / Cosmos SDK:**

* Utilizes Round-Robin Leader selection, which makes future leaders predictable as long as the set remains constant.
* Asks Validators to run 'Sentry Nodes' in front of any Validator to protect against this, but since Sentries also may be DDoS'd, this methodology is weakly effective at best.

### Grinding Attacks

💡 A stake grinding attack (pre-computation attack) is an exploit where the current leader biases the future leader selection by modifying block contents or election parameters until they have a higher likelihood of being a future leader.&#x20;

Executing a grinding attack on a blockchain system leads to significant bias in token distribution and control, effectively undermining the decentralization and fairness of the crypto-economy.

As many blockchains attempt to introduce Randomness in the leader election to address [DDoS](#distributed-denial-of-service-attacks) attacks, they inadvertently cause another serious threat in Grinding Attacks:

* NXT
* Early Cardano
* Pre-Merge Ethereum

### NestBFT Leader Election

NestBFT implements a DDoS-resistant and highly available leader selection algorithm that is immune to grinding attacks:

* Multi-candidate
* Stake-Weighted
* Blind / reveal cycle
* Non-biasable seed input

→ *By combining simplicity with cryptographic integrity, this design enhances security and resilience in decentralized environments.*
