Definition
Median Time Past, or MTP, is the timestamp Bitcoin uses to evaluate time-based timelocks. Instead of trusting a single block's self-reported timestamp, the protocol takes the timestamps of the previous 11 blocks, sorts them, and uses the median. BIP 113 made MTP the reference value for time-based nLockTime and relative-locktime comparisons.
Why the median of 11 blocks
Block timestamps are set by miners and are not strictly ordered, which historically created a perverse incentive: a miner could push a block's timestamp forward to prematurely unlock timelocked coins or pull in extra fee-paying transactions. MTP fixes this because the median of a sliding 11-block window advances monotonically and cannot be manipulated by any single miner. No one miner controls enough of the window to move the median meaningfully.
Practical effects
Because the median of 11 blocks trails the current wall-clock time, transactions using time-based locktimes confirm roughly an hour later than a naive reading of the deadline would suggest. Wallets and contract designers account for this lag when choosing timeout values. MTP applies only to time-based locks (those above the 500,000,000 threshold); block-height locks are compared against the actual chain height. BIP 113 was deployed in 2016 simultaneously with BIP 68 and BIP 112.
MTP is the clock that both Absolute Timelock and Relative Timelock rely on whenever a constraint is expressed in seconds rather than blocks.
In Simple Terms
Median Time Past, or MTP, is the timestamp Bitcoin uses to evaluate time-based timelocks. Instead of trusting a single block’s self-reported timestamp, the protocol takes…
