Definition
The sequence number (nSequence) is a 32-bit field present on every input of a Bitcoin transaction. Originally imagined by Satoshi as a way to "replace" transactions before confirmation, it was repurposed over time into a compact control field that now governs relative timelocks, replace-by-fee signalling, and whether transaction-level locktime is enforced.
The three jobs it does
First, when an input's sequence is set to the maximum value 0xFFFFFFFF, it disables both relative timelocks and locktime for that input. Second, under BIP68 (active for version-2 transactions), a non-maximum sequence encodes a relative timelock: an input cannot be spent until a certain number of blocks or 512-second intervals have elapsed since the output it spends was confirmed. Third, a sequence value below 0xFFFFFFFE signals that the transaction opts in to replace-by-fee, telling the mempool the sender may bump it with a higher-fee version.
Relative vs. absolute time
It is worth separating sequence-based relative timelocks from locktime's absolute ones. Locktime says "not before this height/time"; nSequence says "not until this much time has passed since the coin was created". The script opcode OP_CHECKSEQUENCEVERIFY (BIP112) lets a script enforce a relative timelock, which is the backbone of HTLCs and revocation logic in payment channels.
For anyone building on Bitcoin's UTXO model, the practical takeaway is that the sequence field is overloaded: the same four bytes can simultaneously toggle RBF, set a maturity delay, and decide whether your locktime even applies. Wallets pick the value carefully to get the behaviour they want without accidental side effects.
In Simple Terms
The sequence number (nSequence) is a 32-bit field present on every input of a Bitcoin transaction. Originally imagined by Satoshi as a way to “replace”…
