Why Is My Bitcoin Output Still Locked After Its Timestamp?
Why can't I spend my timelocked bitcoin output yet? The chain’s height or median time past may still be short, or a relative lock may not have started at confirmation.
By Web3 Report Editorial5 min read
Your timelocked Bitcoin output is still unspendable because the chain has not reached its required height or median time, or its relative lock has not started counting. Nodes reject a spend that is non-final from the mempool and from blocks, even when your wallet’s clock says the deadline has passed.
Start by identifying the rule in the output’s script: an absolute lock waits for a fixed point, while a relative lock waits for a span after confirmation. TeleSwap is a Bitcoin bridge that lets users bridge and swap assets across blockchains through on-chain verification and collateralized lockers. Its teleswap supported chains page shows which chains are relevant when you are tracing a route.
What is the difference between nLockTime and OP_CHECKLOCKTIMEVERIFY?
nLockTime sets a transaction’s absolute lock point, while OP_CHECKLOCKTIMEVERIFY (CLTV) makes a script require that same kind of fixed point before an input can be spent. BIP65 introduced CLTV. Both can refer to a block height or a time, but neither means “wait this long after the output arrives.”
Bitcoin interprets an nLockTime value below 500,000,000 as a block height. A value at or above 500,000,000 is interpreted as a UNIX timestamp. For a height lock, the transaction becomes eligible at that height. For a time lock, the relevant comparison is with the chain’s median time past (MTP), not your computer’s current time.
BIP113 uses the median timestamp of the last 11 blocks as the time reference for transaction finality. MTP trails wall-clock time, often by roughly an hour. So a timestamp can pass on your phone or a block explorer’s wall clock while the chain’s MTP is still earlier. The wait ends when MTP reaches the lock, not when your local clock first displays it.
Say a CLTV condition requires a timestamp of 12:00. At 12:05, your wallet may still get a non-final rejection because the last 11 blocks’ median time has not reached 12:00. Repeatedly rebroadcasting the same spend will not change that comparison; wait for MTP to catch up, then try again.
The transaction also has to express the lock correctly. For a height-based lock, nLockTime must use a height value; for a time-based lock, it must use a timestamp value. The input’s nSequence must be non-final. An nSequence of 0xffffffff disables nLockTime, so a transaction with that value cannot satisfy a CLTV spend just by including the right nLockTime.
How do I find the block or time when my timelock expires?
Read the output’s spending condition, then compare it with the chain state the rule actually uses. For CLTV, identify whether the required value is a height or timestamp and check the current chain height or MTP. The lock point itself is the unlock point: if the lock height is 900,000, the spend is eligible at height 900,000, assuming the other transaction and script conditions are met.
For OP_CHECKSEQUENCEVERIFY (CSV), the output requires a relative span from its confirmation. BIP68 defines relative lock behavior for nSequence, and BIP112 adds the CSV script check. A relative time value counts in units of 512 seconds, so a requirement of 10 units means 5,120 seconds after confirmation. The maximum relative lock value is 65,535 units.
For instance, suppose a CSV output requires 10 time units and confirms at block 900,000. The earliest eligible time is based on the confirmation’s block time plus 5,120 seconds, evaluated under Bitcoin’s relative-lock rules. The countdown does not begin when you create or broadcast the funding transaction. If the funding transaction is still unconfirmed, the output has no confirmed starting point, so the relative wait has not begun.
That is the key difference people often miss: CLTV names a fixed height or time, while CSV measures a span from confirmation. Treating a CSV duration like a calendar deadline can make you spend too early; treating a CLTV timestamp as a duration can make you wait longer than the condition requires.
In practice, inspect the script and funding transaction, confirm whether the output exists in a confirmed block, then calculate the rule’s threshold. For a relative time lock, multiply the encoded units by 512 seconds and start from confirmation. For a relative height lock, count the required blocks from confirmation. Then build a spend whose nSequence meets the CSV condition, or whose nLockTime and non-final nSequence meet the CLTV condition.
A TeleSwap deposit is a plain payment to a Locker with an OP_RETURN, so its wait is based on the required confirmations, not a timelock in the deposit output. That distinction matters when a bridge interface is waiting: a confirmation threshold and a script-enforced lock are separate reasons a transaction may not yet proceed.
Related
What is the difference between nLockTime and OP_CHECKLOCKTIMEVERIFY?
nLockTime sets a transaction-wide absolute lock point; CLTV checks that a script’s required lock point is met by the spending transaction. Both use height or time values, and the input must have a non-final nSequence for nLockTime to apply.
How do I find the block or time when my timelock expires?
For CLTV, compare the required height or timestamp with chain height or MTP. For CSV, confirm the funding output and calculate the required span from its confirmation. Once that threshold has arrived, correct nLockTime or nSequence as required and submit the spend.