← GlossaryWallet basics
What Is Locktime? Transactions That Can't Confirm Until Later
Locktime is a field in a Bitcoin-style transaction that prevents the transaction from being included in a block until a given time or block height has passed, unless all its inputs have the maximum sequence number.
Key takeaways
- A transaction with a future locktime cannot be mined until that point.
- It is finalised when its locktime is in the past or all inputs have sequence 0xffffffff.
- It supports refunds, scheduled payments and some contract designs.
- Median time past decides what 'now' means for time-based locks.
What it does
Every Bitcoin-style transaction has a locktime field. If it is set to a future block height or time, nodes will not include the transaction in a block until that moment. The transaction can be built and signed today, held by whoever has it, and only becomes valid later. If the field is zero, it applies immediately.
The finality condition
Bitcoin's reference documentation states the condition: a transaction must be finalised, meaning either its locktime is in the past or at most the current block height, or all of its sequence numbers are set to the maximum value, 0xffffffff. This is why the sequence field and locktime are described together. Setting the sequence numbers to the maximum disables the lock.
What 'now' means
For time-based locks, nodes need a clock. BIP-113 changed the comparison to use median time past, the median of the last 11 blocks' timestamps, rather than the including block's own timestamp. That makes the lock harder for a single miner to game and means the unlock moment can lag real clock time by around an hour.
Uses
Locktime enables refund transactions that can only be used after a delay, scheduled payments that become valid on a future date and some multi-party protocols, where one party holds a signed transaction that becomes spendable after a deadline. Most everyday payments have no lock at all. The field matters mainly to developers and to people using advanced contracts, and wallets that use it will describe the delay in their own words.
Example
You sign a transaction paying coins to yourself that is locked until block 3,000,000. If you hold the signed transaction, it cannot be mined before that height. It acts as a time-delayed fallback that you can prepare now.
Put it into practice
Know when a payment is final
Ordinary payments need no locktime; they confirm as miners include them. Scrypt Wallet sends standard transactions you can follow in a block explorer.
Create a free wallet Get Scrypt for AndroidSources and verification
Last reviewed 2026-10-02 by the Scrypt Wallet team. The factual claims on this page, and where each comes from:
- A transaction must be finalised: its locktime must be in the past or at most the current block height, or all its sequence numbers must be 0xffffffff. [1]
- BIP-113 compares time-based locks against median time past of the last 11 blocks. [2]
Sources
- Bitcoin developer reference: Transactions · Bitcoin.org · primary source
- BIP-113: Median time-past as endpoint for lock-time calculations · bitcoin/bips on GitHub · 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
Does a locked transaction lock my coins?
The coins are not locked on the chain until a transaction spending them is confirmed. A locked transaction is simply invalid to mine before its time.
Is locktime exact?
Not to the second. Time-based locks use median time past, which lags clock time.
Do I need it for normal sends?
No. Most transactions use no locktime and are valid immediately.
Written by the Scrypt Wallet team · Updated 2026-10-02. General education, not financial, tax or legal advice.