← Glossary

Mining

What Is Median Time Past? Why Blockchains Don't Trust One Timestamp

Median time past (MTP) is the median of the timestamps of the previous 11 blocks, a time value that miners cannot easily manipulate, used in Bitcoin's lock-time rules since BIP-113.

Key takeaways

The problem with timestamps

Blockchains have no trusted clock. Each block header carries a time, but the miner who builds the block writes it, and nodes accept it within a loose tolerance. A timestamp therefore cannot be treated as exact, and a single miner could nudge it to their advantage.

What the median does

Median time past takes the timestamps of the previous 11 blocks and picks the middle value. A single dishonest miner can only move that median slightly, because most of the 11 values come from other miners. The result is a time value that is slightly behind real time, since half the values in the window are earlier than the median, but that is much harder to manipulate.

Where it is used

Some transactions are locked until a given time. Before BIP-113, a lock time was compared against the timestamp of the block that included the transaction, which gave the block's miner room to include a transaction slightly early or late. BIP-113 changed the rule so the lock time is compared with the median time past of the preceding blocks. The BIP defines the window as the median of the last 11 blocks. The change was introduced through a soft fork, so it applies to blocks after activation.

What it means for you

If you ever use time-locked transactions or escrow contracts, the unlock time is approximate and can lag clock time by about an hour on a chain with 10-minute blocks. For a coin with faster blocks, the lag is shorter in absolute time since 11 blocks cover less time. For most payments you will never see MTP directly, but it is part of why time-based rules on a blockchain are never exact to the second.

Example

The last 11 block timestamps are 10:00, 10:03, 10:05, 10:08, 10:12, 10:14, 10:16, 10:21, 10:23, 10:24 and 10:30. The median is the sixth value, 10:14, so a lock time of 10:13 counts as passed while one of 10:15 does not.

Put it into practice

Treat time-based rules as approximate

Blockchain time is a range, not an exact clock. Scrypt Wallet shows transaction status from the chain so you can wait for confirmations instead of relying on a timestamp.

Create a free wallet Get Scrypt for Android

Sources and verification

Last reviewed 2026-10-02 by the Scrypt Wallet team. The factual claims on this page, and where each comes from:

  1. BIP-113 defines median time past as the median of the last 11 blocks' timestamps. [1]
  2. BIP-113 compares a transaction's lock time against median time past rather than the block's own timestamp. [1]
  3. A block header has a time field written by the miner. [2]

Sources

  1. BIP-113: Median time-past as endpoint for lock-time calculations · bitcoin/bips on GitHub · primary source
  2. Bitcoin developer reference: Block chain · Bitcoin.org · primary source

Primary sources are protocol papers, specifications, source code or a project's own documentation; secondary sources are wikis and explainers. We checked each claim against the source text on the review date. Found an error? Tell us and we will correct it.

Frequently asked questions

Why 11 blocks?

It is the window the BIP defines; an odd number gives a single middle value and enough blocks to blunt manipulation.

Is MTP always behind the current time?

Usually, yes, because it sits at the middle of the recent window rather than at the end.

Does it matter for ordinary payments?

Not directly. It matters for time-locked transactions and contracts.

Related terms

Go deeper

Written by the Scrypt Wallet team · Updated 2026-10-02. General education, not financial, tax or legal advice.