<p><code>OP_CHECKSEQUENCEVERIFY</code> (a.k.a <code>OP_RELATIVECHECKLOCKTIMEVERIFY</code>) can do <strong>relative lock times</strong> (used for sidechains and lightning).</p>
<p>It basically checks, if an input's sequence number is smaller than the sequence threshold (1 &lt;&lt; 31 = 2147483648), and if so, it will compare the <code>nLockTime</code> against the sequence number of the input.</p>
<p>More info:</p>
<ul>
<li><a href="https://github.com/ElementsProject/elementsproject.github.io/tree/master#relative-lock-time" rel="nofollow noreferrer">https://github.com/ElementsProject/elementsproject.github.io/tree/master#relative-lock-time</a></li>
<li><a href="https://github.com/maaku/bitcoin/commit/fd9864c3a3c6f2942bc0775c6c725aa379f9d616" rel="nofollow noreferrer">https://github.com/maaku/bitcoin/commit/fd9864c3a3c6f2942bc0775c6c725aa379f9d616</a></li>
<li><a href="https://lightning.network/lightning-network-paper.pdf" rel="nofollow noreferrer">https://lightning.network/lightning-network-paper.pdf</a></li>
</ul>

CC BY-SA 3.0
2016-02-08T02:41:31.467Z
OP_CSV (BIP112) only constrains the nSequence value. The comparison of nSequence against time happens independently of OP_CSV's usage (BIP68).
Pieter Wuille
CC BY-SA 4.0
2015-07-28T07:57:07.937Z
2020-07-16T02:31:11.987Z
2020-07-16T02:31:11.987Z
Jonas Schnelli
<p>Some people have suggested repurposing OP_NOP3 as a new opcode, OP_CHECKSEQUENCEVERIFY.</p>

<p>What would the new opcode do? Why is it useful? Can't the signer choose the sequence field when they sign?</p>

<bitcoin-core-development><checksequenceverify>
What does OP_CHECKSEQUENCEVERIFY (OP_CSV) do?
Nick ODell
# What does OP_CHECKSEQUENCEVERIFY (OP_CSV) do?

(Asked by: username_0 on 2015-07-28)

Some people have suggested repurposing OP\_NOP3 as a new opcode, OP\_CHECKSEQUENCEVERIFY.

What would the new opcode do? Why is it useful? Can't the signer choose the sequence field when they sign?

**Tags:** bitcoin-core-development, checksequenceverify


---

## 1 answers

### Answer by username_1 on 2015-07-28. Score: 11 | Accepted answer

`OP_CHECKSEQUENCEVERIFY` (a.k.a `OP_RELATIVECHECKLOCKTIMEVERIFY`) can do **relative lock times** (used for sidechains and lightning).

It basically checks, if an input's sequence number is smaller than the sequence threshold (1 << 31 = 2147483648), and if so, it will compare the `nLockTime` against the sequence number of the input.

More info:

* <https://github.com/ElementsProject/elementsproject.github.io/tree/master#relative-lock-time>
* <https://github.com/maaku/bitcoin/commit/fd9864c3a3c6f2942bc0775c6c725aa379f9d616>
* <https://lightning.network/lightning-network-paper.pdf>

> **Comments:**
> **username_2**: OP_CSV (BIP112) only constrains the nSequence value. The comparison of nSequence against time happens independently of OP_CSV's usage (BIP68).  

---

