> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xyzchain.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Validators

> Query the validator set, delegations, and staking pool

# Validators

XYZ Chain uses Proof of Stake consensus with a set of validators. Query validator details, their delegators, and the overall staking pool.

## List Validators

Returns all validators filtered by bond status.

```bash theme={null}
curl "http://67.205.164.156:1317/cosmos/staking/v1beta1/validators?status=BOND_STATUS_BONDED&pagination.limit=100"
```

<Accordion title="Response">
  ```json theme={null}
  {
    "validators": [
      {
        "operator_address": "xyzvaloper1abc123...",
        "consensus_pubkey": {
          "@type": "/cosmos.crypto.ed25519.PubKey",
          "key": "..."
        },
        "status": "BOND_STATUS_BONDED",
        "tokens": "50000000000000",
        "delegator_shares": "50000000000000.000000000000000000",
        "description": {
          "moniker": "Validator-1",
          "identity": "",
          "website": "",
          "details": ""
        },
        "commission": {
          "commission_rates": {
            "rate": "0.100000000000000000",
            "max_rate": "0.200000000000000000",
            "max_change_rate": "0.010000000000000000"
          }
        },
        "min_self_delegation": "1"
      }
    ],
    "pagination": {
      "next_key": null,
      "total": "3"
    }
  }
  ```
</Accordion>

### Bond Status Values

| Status                  | Meaning                                      |
| ----------------------- | -------------------------------------------- |
| `BOND_STATUS_BONDED`    | Active validators participating in consensus |
| `BOND_STATUS_UNBONDING` | Validators in the unbonding period (21 days) |
| `BOND_STATUS_UNBONDED`  | Inactive validators not producing blocks     |

### Key Fields

| Field                              | Description                                      |
| ---------------------------------- | ------------------------------------------------ |
| `operator_address`                 | Validator operator address (prefix `xyzvaloper`) |
| `tokens`                           | Total staked tokens in `uxyz`                    |
| `delegator_shares`                 | Total shares held by all delegators              |
| `commission.commission_rates.rate` | Current commission rate (e.g., `0.1` = 10%)      |
| `description.moniker`              | Validator's display name                         |

## Get Specific Validator

```bash theme={null}
curl http://67.205.164.156:1317/cosmos/staking/v1beta1/validators/xyzvaloper1abc123...
```

Returns the same structure as above for a single validator.

## Get Validator Delegations

List all delegators for a specific validator.

```bash theme={null}
curl "http://67.205.164.156:1317/cosmos/staking/v1beta1/validators/xyzvaloper1abc123.../delegations?pagination.limit=100"
```

```json theme={null}
{
  "delegation_responses": [
    {
      "delegation": {
        "delegator_address": "xyz1delegator...",
        "validator_address": "xyzvaloper1abc123...",
        "shares": "10000000000.000000000000000000"
      },
      "balance": {
        "denom": "uxyz",
        "amount": "10000000000"
      }
    }
  ]
}
```

## Get Delegations for an Address

List all validators a given address has delegated to.

```bash theme={null}
curl http://67.205.164.156:1317/cosmos/staking/v1beta1/delegations/xyz1delegator...
```

## Get Staking Pool

Returns the total bonded and not-bonded token amounts across the entire chain.

```bash theme={null}
curl http://67.205.164.156:1317/cosmos/staking/v1beta1/pool
```

```json theme={null}
{
  "pool": {
    "bonded_tokens": "100000000000000",
    "not_bonded_tokens": "5000000000000"
  }
}
```

| Field               | Description                                 |
| ------------------- | ------------------------------------------- |
| `bonded_tokens`     | Total `uxyz` staked with active validators  |
| `not_bonded_tokens` | Total `uxyz` in unbonding or unbonded state |

## Get Staking Parameters

```bash theme={null}
curl http://67.205.164.156:1317/cosmos/staking/v1beta1/params
```

```json theme={null}
{
  "params": {
    "unbonding_time": "1814400s",
    "max_validators": 100,
    "max_entries": 7,
    "bond_denom": "uxyz"
  }
}
```

| Parameter        | Description                                      |
| ---------------- | ------------------------------------------------ |
| `unbonding_time` | Time to undelegate (21 days = 1,814,400 seconds) |
| `max_validators` | Maximum number of active validators              |
| `bond_denom`     | The staking token denomination (`uxyz`)          |
