# Validator

The `Validator` entity provides a normalized representation of the Casper Network [Validator](https://docs.casper.network/concepts/glossary/V/#validator). It includes the extended information about its stakes, fee, shares etc.

## Properties

The `Validator` entity has the following properties:

| Property            | Type         | Description                                                                                                                                                                                                           |
| ------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rank`              | `uint8`      | Projected validator rank based on total stake amount                                                                                                                                                                  |
| `era_id`            | `uint32`     | Current era validator identifier                                                                                                                                                                                      |
| `public_key`        | `string(68)` | Validator public key represented as a hexadecimal string                                                                                                                                                              |
| `is_active`         | `bool`       | Describes whether the validator is active or not                                                                                                                                                                      |
| `fee`               | `float32`    | Percentage of the rewards the validator retains for its services                                                                                                                                                      |
| `delegators_number` | `uint64`     | Number of delegators staked to validator                                                                                                                                                                              |
| `bid_amount`        | `uint64`     | Amount of validator bid stake                                                                                                                                                                                         |
| `delegators_stake`  | `uint64`     | Cumulative stake of all delegators                                                                                                                                                                                    |
| `total_stake`       | `uint64`     | Total validator stake. The sum of the self-stake and the delegator stakes                                                                                                                                             |
| `self_stake`        | `uint64`     | Validator self-stake calculated as a sum of the bidder stake and the stakes of the affiliated accounts provided via the [Casper Account Info Standard](https://github.com/make-software/casper-account-info-contract) |
| `self_share`        | `float32`    | Percentage of the validator's self-stake to its total stake                                                                                                                                                           |
| `network_share`     | `float32`    | Percentage of the validator's total stake to the total amount staked on the network                                                                                                                                   |

**Example**

```json
{
  "delegators_number": 327,
  "delegators_stake": 514860723339425900,
  "era_id": 12099,
  "fee": 15,
  "is_active": true,
  "network_share": "6.16",
  "public_key": "018f84c6fc037284f189cc8cb49f89212ff434a5eb050e48cdd164ff3890fbff69",
  "rank": 1,
  "self_share": "0.3",
  "self_stake": 1524223078827207,
  "total_stake": 516384946418253100
}
```

## Optional properties

Depending on the endpoint some of the following optional properties may be included in the `Validator` entity:

| Property                   | Type                                                                                        | Description                                                                                             |
| -------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `account_info`             | [`AccountInfo`](https://docs.cspr.cloud/1.5.x/rest-api/account-info)                        | [Account info](https://github.com/make-software/casper-account-info-contract) provided by the validator |
| `centralized_account_info` | [`CentralizedAccountInfo`](https://docs.cspr.cloud/1.5.x/rest-api/centralized-account-info) | Account information available for known accounts provided by CSPR.cloud team                            |
| `cspr_name`                | `string`                                                                                    | Primary CSPR.name of the validator account                                                              |
| `average_performance`      | [`ValidatorPerformance`](https://docs.cspr.cloud/1.5.x/rest-api/validator-performance)      | Validator average performance                                                                           |

## Relations

| Entity                                                                                  | Mapping property   | Description                                                   |
| --------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------- |
| [`Account`](https://docs.cspr.cloud/1.5.x/rest-api/account)                             | `public_key`       | Accounts can participate in the auction to become a validator |
| [`Bidder`](https://docs.cspr.cloud/1.5.x/rest-api/bidder)                               | `public_key`       | Validators with active bids are bidders in the auction era    |
| [`Block`](https://docs.cspr.cloud/1.5.x/rest-api/block)                                 | `era_id`           | Validators propose blocks                                     |
| [`Delegation`](https://docs.cspr.cloud/1.5.x/rest-api/delegation)                       | `delegators_stake` | Accounts can delegate to validators to increase their stake   |
| [`Validator rewards`](https://docs.cspr.cloud/1.5.x/rest-api/validator-reward)          | `public_key`       | Validators receive staking rewards for their services         |
| [`Validator performance`](https://docs.cspr.cloud/1.5.x/rest-api/validator-performance) | `public_key`       | Validators' participation is measured                         |

## Endpoints

The `Validator` entity has the following endpoints:

* [Get validator](https://docs.cspr.cloud/1.5.x/rest-api/validator/get-validator)
* [Get validators](https://docs.cspr.cloud/1.5.x/rest-api/validator/get-validators)

## Relation endpoints

The `Validator` entity has the following relation endpoints:

* [Get validator blocks](https://docs.cspr.cloud/1.5.x/rest-api/block/get-validator-blocks)
* [Get validator delegations](https://docs.cspr.cloud/1.5.x/rest-api/delegation/get-validator-delegations)
* [Get validator rewards](https://docs.cspr.cloud/1.5.x/rest-api/validator-reward/get-validator-rewards)
* [Get validator total rewards](https://docs.cspr.cloud/1.5.x/rest-api/validator-reward/get-validator-total-rewards)
* [Get validator total delegator rewards](https://docs.cspr.cloud/1.5.x/rest-api/delegator-reward/get-total-validator-delegators-rewards)
* [Get historical validator performance](https://docs.cspr.cloud/1.5.x/rest-api/validator-performance/get-historical-validator-performance)
* [Get historical average validator performance](https://docs.cspr.cloud/1.5.x/rest-api/validator-performance/get-historical-average-validator-performance)
