The Unix Timestamp Field
The Unix Timestamp Field
The Timestamp is the fourth field in the 80-Byte Block Header. It is a 4-byte unsigned integer that records the time the miner began hashing the header.
1. Unix Epoch Time
Bitcoin uses Unix Time (also known as POSIX time), which is the number of seconds that have elapsed since January 1, 1970 (the "Epoch"). * Format: 4-byte unsigned integer. * Capacity: It can represent dates up to the year 2106. After that, the field will overflow, requiring a Hard Fork or a protocol upgrade.
2. Little-Endian Storage
Like the Version and Bits fields, the timestamp is stored in little-endian order.
* If the timestamp is 1689254345 (0x64B011C9), it is stored on disk as C9 11 B0 64.
3. The Miner's Clock
Unlike the Merkle Root or Prev Hash, the timestamp is not derived from other data. The miner simply takes the current time from their local system clock and inserts it into the header.
4. Why a Timestamp Matters
The timestamp is essential for two primary consensus functions: 1. Difficulty Adjustment: The network calculates the time between the first and last block of a 2016-block window to decide whether to increase or decrease Difficulty. 2. Timelocks: Protocol features like Locktime use the block timestamp to decide if a transaction is valid yet.
Because Bitcoin is a decentralized network, there is no "master clock." Every node has its own local time, which leads to the challenge of coordinating a single, agreed-upon time for the entire blockchain.
In the next section, we will look at how nodes calculate a reliable "Network Time" using the Median Time Past (MTP).
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: