# 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](https://docs.hypertensor.org/subnet-template/authorizers/pos), 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.
