THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

What Is the Difference Between Bitcoin CLTV and CSV?

permalink THAMER
#bip112#bip65#bitcoin-timelock#cltv-vs-csv#op-checklocktimeverify#op-checksequenceverify

CLTV is an absolute timelock condition; CSV can enforce a relative timelock condition. Both are Bitcoin Script opcodes that restrict when an output may be spent. Neither automatically sends coins when a deadline arrives.

What does CLTV check?

OP_CHECKLOCKTIMEVERIFY compares a script-provided threshold with the spending transaction's nLockTime, subject to height-versus-time compatibility and other consensus rules. The relevant input sequence must not be final.

What does CSV check?

OP_CHECKSEQUENCEVERIFY works with the spending input's nSequence and BIP68 relative-locktime semantics. It can constrain spending by elapsed blocks or time units relative to the output's confirmation context, depending on the encoded flags.

Which should a developer choose?

Use CLTV when the condition must reference a fixed height or time; use CSV when it should be relative to the age of the spent output. Complex protocols may combine them. Review transaction version, sequence flags, signature rules, and relay policy before deployment.

Related references

  • BIP65: https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki
  • BIP68: https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki
  • BIP112: https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects