The 0xffffffff Sentinel
The 0xffffffff Sentinel
The value 0xffffffff (4.29 billion) is the "default" value for the Sequence field in most Bitcoin transactions. It acts as a sentinel that disables several protocol features.
1. Disabling nLockTime
In the original Bitcoin protocol, the nLockTime field (found at the end of the transaction) is only enforced if at least one input has a sequence number less than 0xffffffff.
- If every single input in a transaction has a sequence of
0xffffffff, the transaction is considered "final" and can be mined immediately, even if nLockTime is set to the year 2099.
2. Disabling RBF
As we discussed in the RBF Guide, a sequence of 0xffffffff signals that a transaction is not replaceable according to BIP 125 rules.
- Most wallet software today uses
0xfffffffd(MAX-2) as a default to ensure users can bump their fees if necessary.
3. Disabling BIP 68
For Relative Timelocks to be active, bit 31 of the sequence must be 0. Since 0xffffffff has bit 31 set to 1, it naturally disables relative timelocks for that input.
4. The "Final" Transaction
A transaction is considered "Final" if:
-
nLockTime is 0 OR matches the current block/time.
-
OR All inputs have sequence
0xffffffff.
| Feature | Condition for Activation |
|---|---|
| nLockTime | Any Sequence \u003c 0xffffffff |
| Opt-in RBF | Any Sequence \u003c 0xffffffff - 1 |
| BIP 68 | Sequence Bit 31 = 0 |
[!TIP] If you are building a simple transaction and don't need advanced features, always set the sequence to
0xffffffffto ensure it is processed as quickly as possible.In the final section, we will build a Python Sequence Parser to decode these bits automatically.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: