OP_CHECKSEQUENCEVERIFY

(178 | 0xb2)

Input

1 items

|

Output

0 items

Enforces a UTXO to remain unspendable for a specific number of blocks after its confirmation or a specific period of time after its inclusion in a block. Also known as CSV, this op defines a *relative* timelock mechanism; unlike checklocktimeverify (CLTV), this enforces a condition where the UTXO is locked based on the age or duration since its confirmation, rather than a fixed point in the Bitcoin timeline. When the input item value is below 500000000, it represents a relative block height; otherwise, it represents a relative period in seconds. This is particularly valuable for protocols like Lightning, which rely on relative timelocks to enforce penalty conditions. For the operation to succeed, the sequence value of the transaction input must be disabled or, if enabled, must be less than or equal to the sequence value in the script and greater than or equal to the version-based minimum.

OP_Code Walkthrough

Ensure a UTXO remains unspendable for a relative number of blocks or duration since its confirmation.

Pop top item (relative locktime value)

Determine if it's block height or Unix timestamp based on value

Compare the value to the sequence field of the spending input.

Verify transaction based on Boolean result (fail or continue)