← Bitcoin Encyclopedia

Timelock (CSV & CLTV)

🌿 Intermediate

💡 The Plain-English Definition

A timelock is a Bitcoin spending condition that prevents funds from being moved until a specified future time or block height. Bitcoin has two timelock types: CLTV (absolute — must wait until a specific block number) and CSV (relative — must wait a certain number of blocks after the enclosing transaction confirms).

🤔 But Why Though?

Bitcoin’s scripting system (the simple programming language that defines spending conditions) allows not just “who can spend this” but “when can this be spent.” Timelocks are the temporal dimension of Bitcoin security — they make it possible to create Bitcoin that cannot be moved for a defined period, regardless of who holds the key.

CLTV (CheckLockTimeVerify — BIP65) locks funds until an absolute point in time or block height. A coin locked with CLTV to block 900,000 cannot be spent before the blockchain reaches that block, regardless of anything else. It’s like a safety deposit box that physically cannot be opened until a calendar date. CSV (CheckSequenceVerify — BIP112) locks funds for a relative period after the transaction containing them is confirmed. A CSV timelock of 144 blocks means the funds are locked for approximately 24 hours after they arrive (144 blocks × 10 minutes per block). This relative nature is critical for Lightning Network security: when a channel force closes (one party broadcasts the channel state unilaterally without the other’s cooperation), the broadcasting party’s funds are subject to a CSV delay of 144 to 2,016 blocks — giving the other party time to broadcast a justice transaction (a special transaction that claims all channel funds as a penalty for cheating) if the wrong state was broadcast.

Timelocks have uses beyond Lightning: vaults (Bitcoin locked with a withdrawal delay so theft can be reversed), inheritance arrangements (Bitcoin that becomes spendable after a specified period if the owner hasn’t acted), and escrow (funds locked until conditions are met by a certain date). They are a foundational primitive that enables complex financial arrangements without any trusted third party.

🌍 The Real-World Analogy

Think of timelocks like a will with a probate period. The money doesn’t transfer to heirs the moment someone dies — it’s locked in probate for a required period to allow disputes to be raised. CLTV is like specifying “this vault opens on January 1, 2030.” CSV is like specifying “this vault opens 90 days after this document is filed.” Both prevent immediate access regardless of who holds the key, making the time dimension of security as enforceable as the identity dimension.

⚡ So What?

You interact with timelocks every time you use the Lightning Network — they’re the security mechanism behind force closes and HTLCs (Hash Time-Locked Contracts — the conditional payment structures that enable trustless Lightning routing). When a Lightning payment fails and “refunds automatically after expiry,” a timelock is what enforced that guarantee. For advanced users, timelocks are the building block for vaults, inheritance setups, and escrow — enabling security arrangements that previously required lawyers and trusted third parties.

Part of The Bitcoin Encyclopedia 167 terms, plain English, no jargon.