# 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;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plater.network/plater-network-documentation/consensus-algorithms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
