Bitcoin locktime sets a condition, not a confirmation time

Explainer10 min read

Understand Bitcoin locktime, height and timestamp boundaries, sequence numbers and median-time-past. See why eligibility does not guarantee confirmation.

Brokzi holds a fictional Bitcoin transaction at a height gate while later block spaces remain undecided. The scene distinguishes a locktime condition from confirmation.
AI-assisted editorial illustration · Brokzi
On this page

A Bitcoin transaction can carry a time condition without booking a place in a block. If you see locktime in an explorer or decoded record, read it as part of the transaction's rules, not a delivery appointment.

This explainer is for readers interpreting native onchain Bitcoin transactions. It separates absolute nLockTime, a node's waiting pool and actual confirmation. The heights and timestamps below are fictional; no wallet, node or transaction was used.

What the Bitcoin locktime field means

nLockTime is a four-byte unsigned transaction field. Its interpretation changes at 500,000,000: a smaller nonzero value represents a block height; a value at or above that threshold represents Unix time, in seconds. Zero imposes no absolute locktime restriction.

The Bitcoin Developer Guide introduces the field. For the precise boundary, this article follows Bitcoin Core v31.1's finality check: an active nonzero locktime must be strictly less than the candidate block's height or applicable time cutoff. Equality does not pass.

That check is one requirement among others. The transaction still needs available inputs, valid authorization and compliance with the other applicable rules. Passing the locktime check alone does not make it valid in every respect.

In Core's code, "final" in this check concerns locktime eligibility. It does not mean the transaction has confirmed or reached irreversible settlement. Our confirmation explainer owns that separate question.

Sequence numbers can switch the absolute condition off

Each input has its own nSequence field. If every input has the maximum value 0xffffffff, the absolute nLockTime check is bypassed. If at least one input has a lower value, the nonzero absolute condition remains relevant. These rules appear in the pinned finality check and transaction definitions.

For the examples, assume one ordinary, non-mining input with nSequence = 0xfffffffe, transaction version 2 and no script timelock. That input is below the maximum, so the absolute condition applies. Its high disable bit also excludes that input from BIP68's relative-locktime interpretation. Other validity conditions are assumed satisfied.

These are declared teaching assumptions, not settings to copy into a wallet. A different sequence value can have additional meanings. Seeing a sequence number does not, by itself, establish a transaction's acceptance or replacement status.

A height locktime of 100 first passes at height 101

Set the fictional transaction's nLockTime to 100. Because 100 is below the height/time threshold, compare it with the height of the block being considered, not a clock.

Candidate block heightAbsolute comparisonThis condition
99100 < 99 is falseFails
100100 < 100 is falseFails
101100 < 101 is truePasses

The first candidate height that passes is 101. Height 100 is the last excluded height under this particular condition. None of those rows says a miner actually selected the transaction.

There is a useful distinction when reading a node's pending state. Core v31.1's next-block check uses the active tip's height plus one. At a fictional tip of 99, it tests candidate height 100 and the condition fails. At tip 100, it tests 101 and the condition passes. That allows a next-block eligibility check before block 101 exists; it does not report a confirmation in advance.

The numbers identify hypothetical heights, not today's chain or a request to wait for a real block. Bitcoin inputs and outputs explains the records those inputs refer to.

A timestamp lock uses median-time-past

For a timestamp lock, the relevant cutoff is not your laptop's clock or the candidate block's own timestamp. BIP113 specifies the previous block's median-time-past, or MTP. With a complete 11-block window, sort those block timestamps and take the middle one, the sixth. This is a median, not an arithmetic average.

Give a separate fictional transaction nLockTime = 2,000,000,000, keeping the same input assumptions. This is an invented timestamp value above the threshold, not a current observation or scheduled payment.

Previous block's MTP, in Unix secondsAbsolute comparisonThis condition
1,999,999,9992,000,000,000 < 1,999,999,999 is falseFails
2,000,000,0002,000,000,000 < 2,000,000,000 is falseFails
2,000,000,0012,000,000,000 < 2,000,000,001 is truePasses

The one-second step illustrates the strict boundary. It is not a prediction that MTP advances every second or that the next block arrives then. Waiting until a wall-clock display reaches the locktime does not establish that the chain's cutoff has passed it.

Eligibility, mempool admission and confirmation are separate

A mempool is a node's local collection of unconfirmed transactions. It is not a network-wide reservation book. In the v31.1 admission code cited above, Core rejects a transaction as non-final if its absolute locktime fails the next-block check. The node does not simply keep every future-dated transaction until its date arrives.

Passing that check still leaves other admission conditions, available inputs, fees and policy. A wallet or provider may store or display a future transaction differently. This article has not tested a provider's queue, automatic rebroadcast or retention behavior.

Actual inclusion requires a miner to select the transaction in a valid block. Fees affect incentives, but cannot override a failing consensus locktime. Raising a fee also cannot promise selection once the condition passes. Our RBF and CPFP comparison covers fee-bumping mechanisms; the vbytes guide explains fee units and transaction size.

Locktime is a lower-bound condition, not an expiry date. Passing it does not automatically broadcast, execute or cancel the transaction. Later conflicts or other validity changes can still matter.

CLTV and relative timelocks impose different requirements

An absolute field in one proposed transaction does not establish that nobody can spend the underlying output earlier through another permitted transaction. The output's spending conditions need reading too.

BIP65's CHECKLOCKTIMEVERIFY, commonly CLTV, lets an executed script path require a spending transaction's locktime to have the same height/time type and be at least the script's threshold. It also rejects a maximum sequence value on the input executing that check. The transaction then faces the absolute finality rule described above; CLTV does not itself count confirmations or book a future block. Other script requirements and alternative permitted paths still matter.

BIP68 instead defines relative constraints through input sequence numbers for transaction versions 2 and above when the input's disable bit is clear. A relative constraint measures an input's age, rather than naming an absolute height or Unix timestamp. Its encoded delay can use blocks or units of 512 seconds, with the specified MTP reference points for time. It is a separate calculation, not a different spelling of the transaction's nLockTime field.

Where relative input age starts

BIP68 measures a relative delay from the output being spent. For a block delay, the origin is that output's confirmation height. For a time delay, the origin is the MTP of the block before its confirmation block. The candidate block supplies the other end of the comparison.

These are separate fictional examples from the absolute examples above. Assume one already confirmed ordinary input, transaction version 2, active BIP68 rules and a clear relative-lock disable bit. The delays are already decoded and positive. Every other validity condition is assumed satisfied; these calculations do not test those conditions. The earlier 0xfffffffe sequence would disable this relative check.

Relative delayStart of the countCandidate must reach
d blocksOutput's confirmation height HCandidate height H + d
u time unitsMTP of the block before the output's confirmation blockCandidate's previous-block MTP at least that origin plus 512 × u seconds

The time row compares two chain MTP values. It uses neither the confirmation block's own timestamp nor a wall-clock countdown. BIP68's type bit selects blocks or time, and its low 16 bits supply the decoded delay. The time unit is 512 seconds. A reorganization can change the chain context used in the calculation.

A four-block delay first passes at candidate height 624

Suppose the fictional output confirmed at height 620 and the decoded relative delay is 4 blocks. The first eligible candidate height for this age condition is 620 + 4 = 624.

Candidate heightRelative age condition
623Fails: below 624
624Passes: reaches 624
625Passes: above 624

Equality with that calculated threshold passes. An active absolute nLockTime field of 624 would instead exclude candidate height 624. The quantities have different meanings: the relative sum identifies the first eligible height; the absolute field identifies the last excluded height.

Three time units use a 1,536-second MTP difference

Keep the fictional confirmation height at 620. Suppose block 619's MTP is 1,500,000,000 and the decoded time delay is 3 units. The span is 3 × 512 = 1,536 seconds, so the candidate's previous-block MTP must reach 1,500,001,536.

Candidate's previous-block MTPRelative age condition
1,500,001,535Fails: below the threshold
1,500,001,536Passes: reaches the threshold
1,500,001,537Passes: above the threshold

These are invented timestamp integers, not observations or arrival times. An active absolute timestamp lock of 1,500,001,536 would fail at equality, just as the earlier absolute example does.

BIP68's printed reference calculation explains the boundary: it subtracts one from the first eligible relative height or MTP to obtain an internal last-invalid cutoff. It then rejects a candidate at or below that cutoff. Here those cutoffs are 623 and 1,500,001,535. The relative sum already identifies the first eligible boundary.

CSV checks the path's requirement; BIP68 checks age

BIP112's CHECKSEQUENCEVERIFY, or CSV, lets an executed script path require compatible input sequence fields. For the version-2 case here, active CSV rules require a clear disable bit on the input, the same block/time type and a masked input delay at least as large as the enforcing operand's masked delay. Stack parsing and nonnegative-value checks also apply. An operand with its own disable bit set does not enforce that relative requirement.

CSV compares those fields. BIP68 supplies the separate comparison against chain age. Passing one does not establish that the other, another permitted path or the remaining transaction conditions pass. For multiple relevant inputs, BIP68 uses the strictest height and time cutoffs, and both must pass. No row above establishes mempool admission, inclusion or confirmation.

No script construction or signing procedure is needed to understand the distinction. A label saying "timelocked" is incomplete until you know which mechanism and spending path it describes.

Read the condition before treating it as a countdown

When interpreting a record, keep these questions together:

  • Is this absolute nLockTime, an executed script condition or a relative input constraint?
  • Is the value a height or timestamp, and is the absolute check active under the input sequences?
  • Which candidate height or previous-block MTP supplies the comparison?
  • Does the screen show eligibility, local admission or an actual containing block?

Bitcoin locktime can explain why a transaction is too early. It cannot tell you when a miner will include it. Establish the condition first, then check inclusion and later confirmations as separate observations.

Sources

Primary specifications and pinned source checked October 29, 2026. The Developer Guide contains historical statements about equal-height inclusion, candidate-block time and sequence usage; those passages are not used as current rules. The strict comparison follows Core v31.1, the time cutoff follows BIP113, and relative sequence semantics follow BIP68. Pinned code is an implementation reference, not a claim that every service runs that version.

Relative-age origins, boundary calculations and CSV requirements were checked November 20, 2026 against the full BIP65, BIP68, BIP112 and BIP113 specifications and their printed reference implementations. No newer Bitcoin Core release was tested for this addition; the v31.1 implementation check above remains dated October 29.

All example heights, timestamps and transaction parameters are fictional. No live chain height, transaction ID, wallet, node, RPC, signature, broadcast, locked funds, provider behavior or confirmation-time experiment was tested. This is an explanation of documented mechanisms, not a funds-locking recipe or financial recommendation.

See something wrong? Brokzi logs material changes. Prepare a correction note.

About the byline

Brokzi Editorial

The accountable byline for Brokzi’s explainers, definitions, news notes, and corrections.

Editorial responsibility →