TYPE 0x0101 · TIMELOCK FAMILY
CSV
Relative timelock in blocks (BIP 68 / BIP 112). Checks that sufficient blocks have been mined since the UTXO was confirmed.
Timelock InvertibleLadder Diagram
Fields
| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| sequence_value | NUMERIC | 1-4 B | Conditions | BIP 68 sequence value in blocks |
No witness fields required — evaluation uses the input sequence number from the transaction context.
Wire Format Breakdown
0x0101
0
1
NUMERIC · 3B
Conditions = 4 + 5 = 9 bytes
0x0101
0
0
Witness = 4 bytes (empty block)
Total
15 bytes
Evaluation Logic
1.Read the conditions NUMERIC field as an int64 sequence_val. If absent or undecodable → ERROR
2.If SEQUENCE_LOCKTIME_DISABLE_FLAG (bit 31, 0x80000000) is set in sequence_val → SATISFIED unconditionally (this short-circuits before the range check)
3.Range check: if sequence_val < 0 or sequence_val > 0xFFFFFFFF → UNSATISFIED (guards the subsequent narrowing cast to uint32_t)
4.Call sig_checker.CheckSequence(uint32_t(sequence_val)); this delegates to BIP 68 / BIP 112 semantics against the spending tx's input sequence and the UTXO's confirmation height. Fails → UNSATISFIED; passes → SATISFIED
Return Values
| Condition | Result |
|---|---|
| NUMERIC field missing or undecodable | ERROR |
SEQUENCE_LOCKTIME_DISABLE_FLAG (bit 31) set in sequence_val | SATISFIED |
sequence_val negative or > 0xFFFFFFFF (uint32 range guard) | UNSATISFIED |
CheckSequence fails (insufficient blocks elapsed since UTXO) | UNSATISFIED |
CheckSequence passes (lock satisfied) | SATISFIED |
JSON Wire Format
Conditions (relative locktime of 144 blocks)
{
"type": "CSV",
"inverted": false,
"fields": [
{ "type": "NUMERIC", "value": 144 }
]
}This requires 144 block confirmations (~1 day) since the UTXO was created before it can be spent.
Use Cases
Lightning Commitment Delay
Revocation paths in Lightning commitment transactions use CSV to enforce a dispute window. The broadcaster must wait N blocks before claiming their output, giving the counterparty time to penalize old states.
Vault Cooling Period
Hot wallet spends are routed through a vault UTXO that requires a cooldown period in blocks before it can be swept, limiting damage from key compromise and allowing time for clawback.
Rate-Limiting Covenant Spends
Each UTXO in a covenant chain requires a minimum number of block confirmations before the next spend, throttling the rate at which funds can be extracted from a contract.