<p>Yes it's still a consensus rule, as it's been since 2009.</p>
<p>You indeed need to set at least one input's <code>nSequence</code> to something else than <code>0xffffffff</code> for the absolute timelock to be taken into account. See for instance how <code>OP_CHECKLOCKTIMEVERIFY</code> enforces this.</p>
<p>Your transaction may enable <code>nLockTime</code> without enabling RBF by setting the <code>nSequence</code> to <code>0xfffffffe</code>. RBF only gets activated by using <code>0xfffffffd</code> or lower.</p>

CC BY-SA 4.0
2023-10-29T16:59:21.613Z
Thanks, and what about the last (4th) question? If we set all nSequences to == 0xffffffff, we can disable nLocktime and absolute timelock. And what happened if we have CLTV in the output we consume? Do we also disable CLTV since we disabled nLocktime and we do not take into account the value of the nLocktime field?
LeaBit
CC BY-SA 4.0
2023-10-29T18:27:02.760Z
When an OP_CLTV executes, it requires that the spending transactions' locktime is active.
Pieter Wuille
CC BY-SA 4.0
2023-10-29T18:39:05.880Z
@PieterWuille Thanks, I asked a question related to it. Can you help? https://bitcoin.stackexchange.com/questions/120259/does-the-nsequence-of-the-input-that-consumes-the-cltv-output-have-to-be-differe
LeaBit
CC BY-SA 4.0
2023-10-29T16:51:31.823Z
2023-10-29T16:51:31.823Z
Antoine Poinsot
<p><a href="https://bitcoin.stackexchange.com/a/120255/145749">Here</a> Antoine said the following:</p>
<blockquote>
<p>This introduced absolute timelock capability through the <code>nLockTime</code> transaction field, which is disabled if all the transactions inputs have an <code>nSequence</code> that is <code>0xffffffff</code>.</p>
</blockquote>
<p>I have a couple of questions:</p>
<ol>
<li>Is this still a consensus rule?</li>
<li>Does this mean that If I want absolute locktime in my transaction I must set the <code>nSequence</code> of some input to value != <code>0xffffffff</code>?</li>
<li>By setting some input nSequence value to != <code>0xffffffff</code> we are enabling relative locktime (32th bit is NOT set to 1) or RBF (32th bit is set to 1). Does it mean that my transaction, for example, must be RBF in order to use absolute locktime?</li>
<li>If all written above is true, does this mean that by setting all nSequence to == 0xffffffff and by that disabling nLocktime and absolute timelock, we can also disable CLTV?</li>
</ol>

<replace-by-fee><locktime><sequence><checklocktimeverify>
What is the relation between nLockTime and nSequence?
LeaBit
# What is the relation between nLockTime and nSequence?

(Asked by: username_0 on 2023-10-29)

[Here](https://bitcoin.stackexchange.com/a/120255/145749) username_1 said the following:

> This introduced absolute timelock capability through the `nLockTime` transaction field, which is disabled if all the transactions inputs have an `nSequence` that is `0xffffffff`.

I have a couple of questions:

1. Is this still a consensus rule?
2. Does this mean that If I want absolute locktime in my transaction I must set the `nSequence` of some input to value != `0xffffffff`?
3. By setting some input nSequence value to != `0xffffffff` we are enabling relative locktime (32th bit is NOT set to 1) or RBF (32th bit is set to 1). Does it mean that my transaction, for example, must be RBF in order to use absolute locktime?
4. If all written above is true, does this mean that by setting all nSequence to == 0xffffffff and by that disabling nLocktime and absolute timelock, we can also disable CLTV?

**Tags:** replace-by-fee, locktime, sequence, checklocktimeverify


---

## 1 answers

### Answer by username_1 on 2023-10-29. Score: 3 | Accepted answer

Yes it's still a consensus rule, as it's been since 2009.

You indeed need to set at least one input's `nSequence` to something else than `0xffffffff` for the absolute timelock to be taken into account. See for instance how `OP_CHECKLOCKTIMEVERIFY` enforces this.

Your transaction may enable `nLockTime` without enabling RBF by setting the `nSequence` to `0xfffffffe`. RBF only gets activated by using `0xfffffffd` or lower.

> **Comments:**
> **username_0**: Thanks, and what about the last (4th) question? If we set all nSequences to == 0xffffffff, we can disable nLocktime and absolute timelock. And what happened if we have CLTV in the output we consume? Do we also disable CLTV since we disabled nLocktime and we do not take into account the value of the nLocktime field?  
> **username_2**: When an OP_CLTV executes, it requires that the spending transactions' locktime is active.  
> **username_0**: @username_2 Thanks, I asked a question related to it. Can you help? https://bitcoin.stackexchange.com/questions/120259/does-the-nsequence-of-the-input-that-consumes-the-cltv-output-have-to-be-differe  

---

