# Block

The block is a combination of a batch of transactions and contains the hash of the previous block in the chain. This connects the blocks together (into a chain) because the hash is derived from the encryption of the block data. This prevents fraud because any change in any previous block invalidates all subsequent blocks, and all hashes are changed and noticed by all who run the blockchain.

### Why do we need blocks? <a href="#why-blocks" id="why-blocks"></a>

To ensure that all participants on the PolySmartChain network stay in sync and agree on the exact history of a transaction, we divide the transaction into multiple blocks. This means that dozens (or hundreds) of transactions are submitted, agreed upon and synchronized at once.

![](https://ethereum.org/static/85d784391401f89209d3bcc51e0ea677/302a4/tx-block.png)

With spaced commits, we can give all network participants enough time to reach consensus even if transaction requests occur tens of times per second. Blocks on PolySmartChain are committed approximately every 3 seconds.

### How blocks work <a href="#how-blocks-work" id="how-blocks-work"></a>

To preserve transaction history, blocks are strictly ordered (each new block created contains a reference to its parent block) and transactions within the block are strictly ordered. Except in rare cases, at any given time, all participants on the network agree on the exact number and history of blocks, and are working to batch the current active transaction requests to the next block.

Once a block is put together (mined) by one of the miners on the network, it propagates to the rest of the network; All nodes add this block to the end of their block chain and continue mining.

### What does the block contain? <a href="#block-anatomy" id="block-anatomy"></a>

* `timestamp` – Time to mine the block.
* `blockNumber` – The length of a block in the blockchain.
* `baseFeePerGas` -The minimum cost per gas required to include a transaction in the block.
* `difficulty` – The effort required for mining.
* `mixHash` – A unique identifier for the block.
* `parentHash` – The unique identifier of the previous block (this is how the block forms the chain).
* `transactions` –The transactions contained in the block.
* `stateRoot` –The entire state of the system: account balance, contract storage, contract codes and account random numbers.
* `nonce` – Hash, when used in combination with mixHash, proves that the block has passed the workload proof.

### Block Time <a href="#block-time" id="block-time"></a>

Block time refers to the time it takes to mine a new block. In PolySmartChain, the average block time is at 3 seconds and is evaluated after each block. The expected block time is set as a constant at the protocol level and is used to secure the network when miners increase their computing power. The average block time is compared to the expected block time and if the average block time is higher, the block header will be less difficult. If the average block time is lower, the difficulty in the block header is increased.

### Block Size <a href="#block-size" id="block-size"></a>

One last important point is that the size of the blocks themselves is bounded. The target size for each block is 15 million gas, but the block size will increase or decrease depending on the network demand. The block limit is limited to a maximum of 30 million (twice the target block size). The total amount of gas consumed by all transactions in the block must be below the block's gas limit. This is important because it ensures that the block does not grow arbitrarily large. If blocks can be arbitrarily large, less capable full nodes will gradually fail to keep up with the network due to space and speed requirements.


---

# 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.polysmartchain.com/blockchain-foundation/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.
