> For the complete documentation index, see [llms.txt](https://docs.plater.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plater.network/plater-network-documentation/consensus-algorithms.md).

# Consensus Algorithms

**Proof of Stake (PoS) Mechanism**

PoS allows validators to stake PLATER tokens, securing the network and incentivizing validators based on their stake.

```solidity
function stake(uint256 amount) public {
    require(balances[msg.sender] >= amount, "Insufficient balance.");
    stakes[msg.sender] += amount;
    totalStaked += amount;
}

function calculateProbability(address validator) public view returns (uint256) {
    return stakes[validator] * 1e18 / totalStaked;
}
```

**Proof of Capacity (PoC) Nonce Generation**

Nodes commit storage for fast block production by precomputing hash scoops, defining time limits for block creation.

```solidity
function calculateDeadline(uint256[] memory scoops) public pure returns (uint256) {
    uint256 minDeadline = scoops[0];
    for (uint256 i = 1; i < scoops.length; i++) {
        if (scoops[i] < minDeadline) {
            minDeadline = scoops[i];
        }
    }
    return minDeadline;
}
```
