Live · Tue, Oct 6, 2026 · 23:01 UTC Block 843,917 Fees 14 sat/vB Fear & Greed 72 · Greed
Newsletter Pro Terminal Sign in
McLeod Pacific Investments.
Subscribe →
Live · 23:01 UTC Block 843,917 F&G 72
Bitcoin Basics Bitcoin Basics desk

What is a Bitcoin locktime and how does it protect payments?

Bitcoin locktime is a built-in feature that delays when a transaction can be added to the blockchain, giving senders precise control over when funds move. Here's how it works in plain English.

A digital boxing timer displaying 3:00 resting on a wooden table.

Photo by KoolShooters on Pexels

Bitcoin locktime is a field embedded in every Bitcoin transaction that tells the network: "don't accept this payment before a specific point in time." Most transactions set locktime to zero, meaning they can be broadcast immediately. But when a sender sets a non-zero value, the transaction is effectively scheduled, held back from the mempool until the specified block height or Unix timestamp has passed.

It's a quiet feature. Most beginners never notice it because wallets handle it automatically. Understanding it, though, opens up a clearer picture of how Bitcoin's transaction layer actually works.

How locktime values are expressed

Bitcoin locktime is stored as a 4-byte unsigned integer in the transaction data. The value is interpreted in one of two ways depending on its size.

  • Values below 500,000,000 are treated as a block height. A locktime of 850,000, for example, means the transaction cannot be mined before block 850,000 is added to the chain.
  • Values at or above 500,000,000 are treated as a Unix timestamp (seconds since 1 January 1970). A locktime of 1,800,000,000 corresponds to a specific date in 2027.

This threshold might seem arbitrary, but it's a deliberate design choice. Bitcoin's block count won't reach 500 million for centuries, so any value that large must be a timestamp rather than a block number. The network interprets accordingly.

Locktime vs Bitcoin timelocks: what's the difference?

The term "locktime" is sometimes confused with the broader category of Bitcoin timelocks, which includes mechanisms like OP_CHECKLOCKTIMEVERIFY (CLTV) and OP_CHECKSEQUENCEVERIFY (CSV). These are related but distinct tools.

Transaction-level locktime applies to the entire transaction. It prevents the transaction from being broadcast at all until the condition is met. Script-level timelocks, by contrast, are written into the locking conditions on individual outputs and are enforced when those outputs are later spent. If you're curious about how those output-level conditions work, the mechanics are covered in depth in our guide on what a Bitcoin output script actually does.

Locktime is the simpler, older tool. CLTV and CSV arrived later and allow more fine-grained control, especially inside payment channels like the Bitcoin Lightning Network.

A practical example

Suppose a business owner wants to pay a contractor, but only after a project milestone is confirmed at the end of the month. With locktime, the owner could construct and sign a transaction today, set the locktime to a block height expected to be reached around that date, and hand it to the contractor. The contractor holds the signed transaction. Once the target block is mined, they can broadcast it and receive the funds.

Neither party needs to trust a third-party escrow service. The time constraint is baked into the transaction itself, enforced by every node on the network.

The role of sequence numbers

There's a catch that surprises many readers. Locktime is only enforced if at least one input in the transaction has a sequence number below the maximum value of 0xFFFFFFFF. If all inputs carry the maximum sequence number, nodes treat the locktime field as ignored, and the transaction is accepted immediately regardless of its locktime value.

This was originally a design quirk from Bitcoin's early days. Today, wallets that deliberately use locktime set at least one input sequence number to 0xFFFFFFFE, which activates locktime enforcement while still allowing replace-by-fee. Understanding that interaction matters if you ever want to pair locktime with a Bitcoin replace-by-fee transaction, since both features depend on sequence numbers.

Why locktime matters for security

One underappreciated use of locktime is as a defence against fee manipulation. Anti-fee-sniping is a technique where wallets routinely set locktime to the current block height. This discourages miners from reorging recent blocks to "snipe" the fees inside them, because a sniped transaction referencing a future block height would be invalid in an older block. Major wallet software, including Bitcoin Core, applies anti-fee-sniping automatically.

For everyday users, this means locktime is silently protecting every transaction their wallet sends, even when they never set a time delay deliberately.

What beginners should take away

Locktime isn't something most Bitcoin users will configure manually. Your wallet sets it correctly by default. But knowing it exists helps you understand why transactions have a "not before" character, how time-locked payment arrangements work without an intermediary, and why sequence numbers appear in raw transaction data at all.

If you want to go deeper into the raw structure of transactions, our guide on Bitcoin raw transactions walks through every field, including how locktime sits inside the serialised data that gets broadcast to the network.

McLeod Pacific Investments helps clients buy and sell Bitcoin on the Gold Coast with clear, jargon-free guidance. If you have questions about how Bitcoin transactions work under the hood, our team is available to walk you through it.

→ The Confirmations · Daily newsletter

One email at 06:00 UTC. Six minutes. The only digest written for desks, not for retail.