# Block

The `Block` entity provides a normalized representation of the Casper Network block. It doesn't contain the executed deploy hashes as the network block object. However, they could be queried separately using the [Deploy](/rest-api/deploy.md) API.

## Properties

The `Block` entity has the following properties:

| Property                     | Type         | Description                                                                                               |
| ---------------------------- | ------------ | --------------------------------------------------------------------------------------------------------- |
| `block_height`               | `uint64`     | Block height. Primary block identifier                                                                    |
| `block_hash`                 | `string(64)` | Block hash represented as a hexadecimal string. Secondary block identifier                                |
| `parent_block_hash`          | `string(64)` | Parent block hash represented as a hexadecimal string                                                     |
| `state_root_hash`            | `string(64)` | Identifier of the network's state after executing the block's deploys represented as a hexadecimal string |
| `era_id`                     | `uint32`     | Era ID in which the block was created                                                                     |
| `proposer_public_key`        | `string(68)` | Public key of the validator who proposed the block represented as a hexadecimal string                    |
| `is_switch_block`            | `bool`       | `true` if the block is the last one in the era                                                            |
| `gas_price`                  | `uint8`      | The gas price (cost per unit of gas) used for deploys in the block                                        |
| `version_id`                 | `uint8`      | Block version identifier. Value is `1` for Casper 2.0 blocks, and `0` for 1.X versions blocks             |
| `native_transfers_number`    | `uint16`     | Number of native transfer deploys included in the block                                                   |
| `contract_calls_number`      | `uint16`     | Number of contract calls included in the block                                                            |
| `auction_txn_number`         | `uint16`     | Number of auction-related transactions included in the block                                              |
| `install_upgrade_txn_number` | `uint16`     | Number of install or upgrade transactions in the block                                                    |
| `small_txn_number`           | `uint16`     | Number of `small` transactions in the block \*                                                            |
| `medium_txn_number`          | `uint16`     | Number of `medium` transactions in the block \*                                                           |
| `large_txn_number`           | `uint16`     | Number of `large` transactions in the block \*                                                            |
| `timestamp`                  | `datetime`   | The timestamp from when the block was proposed                                                            |

* Please refer to the network `chainspec.toml` file for the exact configuration for `small`, `medium` and `large` transactions.

**Example**

```json
{
  "auction_txn_number": 1,
  "block_hash": "cb549c2a75fa7d3aa5f7007642d7f6b36f44c2cd1b24d54f5b0e07ca1c3c3614",
  "block_height": 4685962,
  "contract_calls_number": 1,
  "era_id": 17221,
  "gas_price": 1,
  "install_upgrade_txn_number": 0,
  "is_switch_block": false,
  "large_txn_number": 0,
  "medium_txn_number": 0,
  "native_transfers_number": 0,
  "parent_block_hash": "46a73212616c1477581fca4c991bcd65bb56bb1e69df50aa7ee4048bb68d98e8",
  "proposer_public_key": "011330bc6ba272373ce0294efc7d78cc3d41a147ecfd89f7d9ab6435d32ac1cb14",
  "small_txn_number": 0,
  "state_root_hash": "f63e5228c2da89226a837c6e9aeeb06fdab97255e0c95e776dfba5160ca7875a",
  "timestamp": "2025-03-18T16:23:17Z",
  "version_id": 1
}
```

## Optional properties

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

| Property                            | Type                                                              | Description                                                                                                    |
| ----------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `proposer_account_info`             | [`AccountInfo`](/rest-api/account-info.md)                        | [Account info](https://github.com/make-software/casper-account-info-contract) provided by the proposer account |
| `proposer_centralized_account_info` | [`CentralizedAccountInfo`](/rest-api/centralized-account-info.md) | Account information available for known accounts provided by CSPR.cloud team                                   |
| `proposer_cspr_name`                | `string`                                                          | Primary CSPR.name of the block proposer account                                                                |

## Relations

| Entity                                                        | Mapping property      | Description                                                       |
| ------------------------------------------------------------- | --------------------- | ----------------------------------------------------------------- |
| [`Deploy`](/rest-api/deploy.md)                               | `block_hash`          | Blocks can have deploys                                           |
| [`Validator`](/rest-api/validator.md)                         | `proposer_public_key` | Blocks are proposed by validators                                 |
| [`Contract`](/rest-api/contract.md)                           | `block_hash`          | Contract deployment is a transaction in block                     |
| [`Fungible token action`](/rest-api/fungible-token-action.md) | `block_hash`          | Fungible token actions are results of deploy execution in a block |
| [`NFT action`](/rest-api/non-fungible-token-action.md)        | `block_hash`          | NFT actions are results of deploy execution in a block            |
| [`Transfer`](/rest-api/transfer.md)                           | `block_hash`          | Transfers are results of deploy execution in a block              |

## Endpoints

The `Block` entity has the following endpoints:

* [Get block](/rest-api/block/get-block.md)
* [Get blocks](/rest-api/block/get-blocks.md)
* [Get validator blocks](/rest-api/block/get-validator-blocks.md)

## Relation endpoints

The `Block` entity has the following relation endpoints:

* [Get block deploys](/rest-api/deploy/get-block-deploys.md)


---

# 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.cspr.cloud/rest-api/block.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.
