# Proof-of-Stake

## `ProofOfStake` Class

`utilities/proof_of_stake.py`

The **`ProofOfStake`** class provides a reusable implementation of on-chain Proof-of-Stake (PoS) verification logic. It is designed to serve as a shared component across middleware layers and authorization modules that require peer stake validation.

This class is primarily utilized by the [ProofOfStakeAuthorizer](/subnet-template/authorizers/pos.md), but can also be integrated into other subsystems within the subnet framework. Standardizing PoS verification rules ensures consistency and persistence of stake logic throughout the network.

#### **Key Features**

* **Reusable Middleware Component**\
  Can be embedded in any logic that requires verifying a peer’s on-chain PoS.
* **Persistent State Management**\
  Maintains PoS-related state across the subnet, preventing redundant or excessive verification attempts.
* **Cooldown Mechanism**\
  Enforces cooldown periods when one peer verifies another’s stake, mitigating the risk of over-verification during high request/response throughput.

**Purpose**

The `ProofOfStake` class allows multiple system components to rely on the same verification logic without duplication, ensuring that PoS validation is efficient, consistent, and resistant to abuse.


---

# 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.hypertensor.org/subnet-template/proof-of-stake.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.
