<p>The only other relevance of the nSequence field is as relative locktime (in version 2 transactions); see BIP 68.</p>

<p>If you do use relative locktime, they will determine the value of nSequence.</p>

<p>If you don't use that feature, any nSequence lower than 0xfffffffe will do.</p>

<p>In BIP125, there is no need for strictly increasing nSequence versions. instead, the highest fee wins.</p>

CC BY-SA 3.0
2017-07-01T16:47:35.233Z
2017-07-01T16:47:35.233Z
Pieter Wuille
<p>What is the recommended <code>nSequence</code> for signalling RBF transactions?</p>
<p><a href="https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki" rel="nofollow noreferrer">BIP125 says</a>:</p>
<blockquote>
<p>A transaction is considered to have opted in to allowing replacement of itself if any of its inputs have an nSequence number less than (0xffffffff - 1).</p>
</blockquote>
<p>What is the recommended policy—is it better to send smaller or higher <code>nSequence</code>?</p>
<p>Also, does the sequence number need to increase with newer &quot;versions&quot; of the transaction with higher fees, as was the original semantics of <code>nSequence</code>, or not?</p>
<p>Bitcoin Core itself uses <code>nSequence=0</code>, but <a href="https://github.com/bitcoin/bitcoin/blob/master/test/functional/replace-by-fee.py#L115" rel="nofollow noreferrer">only in the RBF tests</a>, AFAIK.</p>

CC BY-SA 3.0
2017-07-01T13:37:35.140Z
Related unanswered question - https://bitcoin.stackexchange.com/questions/53398/sequence-number-semantics
Karel Bílek
<transactions><replace-by-fee><sequence>
What is the recommended sequence for signalling RBF?
Karel Bílek
# What is the recommended sequence for signalling RBF?

(Asked by: username_0 on 2017-07-01)

What is the recommended `nSequence` for signalling RBF transactions?

[BIP125 says](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki):

> A transaction is considered to have opted in to allowing replacement of itself if any of its inputs have an nSequence number less than (0xffffffff - 1).

What is the recommended policy—is it better to send smaller or higher `nSequence`?

Also, does the sequence number need to increase with newer "versions" of the transaction with higher fees, as was the original semantics of `nSequence`, or not?

Bitcoin Core itself uses `nSequence=0`, but [only in the RBF tests](https://github.com/bitcoin/bitcoin/blob/master/test/functional/replace-by-fee.py#L115), AFAIK.

**Tags:** transactions, replace-by-fee, sequence

> **Comments:**
> **username_0**: Related unanswered question - https://bitcoin.stackexchange.com/questions/53398/sequence-number-semantics  

---

## 1 answers

### Answer by username_1 on 2017-07-01. Score: 6 | Accepted answer

The only other relevance of the nSequence field is as relative locktime (in version 2 transactions); see BIP 68.

If you do use relative locktime, they will determine the value of nSequence.

If you don't use that feature, any nSequence lower than 0xfffffffe will do.

In BIP125, there is no need for strictly increasing nSequence versions. instead, the highest fee wins.


---

