> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/wiki/blocks-and-the-blockchain/blockchain/block-header.md).

# Block header

The block header is the first piece of information propagated by a node when it finds a valid block solution. Other nodes on the network can validate the node's hash solution and determine whether the proposed block warrants the further checking required to secure its place as the top-most link in the longest chain of valid proof of work. A block header contains these fields:

| Field          | Purpose                                                       | Updated when...                             | Size (Bytes) |
| -------------- | ------------------------------------------------------------- | ------------------------------------------- | ------------ |
| Version        | Block version                                                 |                                             | 4            |
| hashPrevBlock  | 256-bit hash of the previous block header                     | A new block comes in                        | 32           |
| hashMerkleRoot | 256-bit hash based on all of the transactions in the block    | An updated merkle tree is completed         | 32           |
| Time           | Current block timestamp as seconds since 1970-01-01T00:00 UTC | Every few seconds                           | 4            |
| Bits           | Current target in compact format                              | The difficulty is adjusted (approx 2 weeks) | 4            |
| Nonce          | 32-bit number (starts at 0)                                   | A hash is tried (increments)                | 4            |

The body of the block contains the transactions. These are hashed only indirectly through the Merkle root. Because transactions aren't hashed directly, the proof of work needed to mine a block with 1 transaction takes exactly the same amount of effort as a block with 10,000, 10,000,000 or 10,000,000,000 transactions. The format of target is a \[] number encoded using a 3-byte mantissa with the leading 1 byte as exponent. The number's range is within 2 256. It is not possible for two nodes to be working on the same Merkle root because the Coinbase transaction is unique to that node, generating a different hash output. Every hash attempt made has the same chance of winning as every other hash calculated across the network.

1. Endianess Note that the hash, which is a 256-bit number, has lots of leading zero bytes when stored or printed as a big-endian \[] constant, but it has trailing zero bytes when stored or printed in little-endian. For example, if interpreted as a string and the lowest (or start of) the string address keeps lowest significant byte, it is little-endian. Most block explorers display the hash values as big-endian numbers; notation for numbers is usual (leading digits are the most significant digits read from left to right).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hub.bsvblockchain.org/wiki/blocks-and-the-blockchain/blockchain/block-header.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
