Sequence
A Bitcoin sequence number is the 4-byte input field that sets locktime, replace-by-fee (RBF) and relative locktime. See its values and bit layout.
By Dimitar Zurnov · Updated 4 Nov 2026
Adapted from Learn Me a Bitcoin by Greg Walker.
The sequence field is a 4-byte setting in every transaction input. It controls three things. It decides whether the transaction's locktime is enforced, and whether the transaction can be replaced by a higher-fee version while it waits in the mempool. Through relative locktime, it sets how long after an output was mined its spend can be included in a block. Each input has its own sequence, but the first two settings apply to the whole transaction.
A common choice is fffffffd. It turns on both the locktime and the replace-by-fee signal.
What values does the sequence take?
| Value | Effect |
|---|---|
ffffffff |
Final. No locktime, no RBF signal. |
fffffffe or lower |
Locktime is enforced for the whole transaction. |
fffffffd or lower |
The transaction signals that it can be replaced by a higher-fee version. This also turns locktime on. |
Bit 31 clear (below 80000000) |
Relative locktime for this input, counted in blocks or time. Needs transaction version 2 or higher. |
The table reads from the top. A transaction where every input is ffffffff is final, and the network will mine it as soon as it fits in a block. As soon as one input is lower, the locktime field of the transaction starts to count. You only need one input to change the setting, even if the transaction has several inputs.
How does locktime use the sequence?
Locktime is a field at the end of the transaction. It names either a block height or a Unix timestamp, and the transaction cannot be mined until that point. The field only takes effect when at least one input's sequence is fffffffe or lower. Otherwise the transaction counts as final and the locktime is ignored.
Bitcoin Core uses the locktime field to discourage fee sniping, a trick where miners re-mine recent blocks to take their fees. Its wallet sets the locktime to the current height and sets sequence to a value below ffffffff on its transactions. That is why the sequence in a typical Core transaction is not final.
How does RBF use the sequence?
Replace-by-fee lets the sender send a higher-fee version of a transaction that is still in the mempool. The signal is a sequence of fffffffd or lower on at least one input, defined in BIP 125. It is only a signal, so the replacement does not need a different sequence.
Full replace-by-fee is now the default mempool policy in Bitcoin Core. Since 28.0, the -mempoolfullrbf setting defaults to 1, so a node will accept a replacement even when the original did not signal. Bitcoin Core's wallet also signals RBF by default, with DEFAULT_WALLET_RBF set to true. The stuck transaction guide covers the current rules and how to use them.
The replacement can also send its coins to different outputs, so it is not limited to the original payments.
A replacement must pay at least the fees of the transactions it replaces, plus the incremental relay fee for its own size. So the minimum fee is the old fees plus the incremental relay fee times the replacement's virtual bytes. From Bitcoin Core 29.1, that default is 100 satoshis per kilovirtual-byte, or 0.1 sat/vB, set in policy.h. Earlier releases used 1 sat/vB. The RBF word page has more on how fee bumps work.
How does relative locktime work?
Relative locktime, defined in BIP 68, delays an input until a number of blocks or seconds have passed since the output it spends was mined. It is set per input, so one input can have a delay and another need none. It has been enforced by consensus since block 419,328.
The sequence field is read as a bit field:
- Bit 31 is the disable flag. When it is set, relative locktime is off for that input. When it is clear, the input uses relative locktime.
- Bit 22 is the type flag. When it is set, the value counts 512-second units. When it is clear, the value counts blocks.
- Bits 15 to 0 hold the value, from 0 to 65,535.
Time is counted in units of 512 seconds, which is 2 to the power of 9, so the unit is a power of two. The largest value, 65,535, then covers about 388 days. That is close to the 455 days that 65,535 blocks of 600 seconds would take.
Relative locktime needs transaction version 2 or higher. Version 1 transactions ignore it, so the version field matters as much as the sequence.
What are some example values?
These are the values a developer is most likely to meet:
fffffffeturns on locktime and nothing else. Bitcoin Core's wallet produces this value when it does not signal RBF.fffffffdturns on both locktime and RBF, which is the usual choice for transactions you may need to bump.00000090is a relative locktime of 144 blocks, since0x90is 144 and the type bit is clear.00400007is a relative locktime of 3,584 seconds, since7 × 512is 3,584 and the type bit is set.
To build a value yourself, set the bits you need and combine them with OR. The bytes and byte order pages explain the notation.
The next page, Output, covers the other half of a transaction: the amounts it creates and the locks on them.
Sources
- BIP 68: Relative lock-time
- BIP 125: Opt-in Full Replace-by-Fee Signaling
- Bitcoin Core 28.0 release notes, for the full-RBF default
- Bitcoin Core policy.h, for the default fee settings
In this section: Transactions
Something look wrong? Tell us