Sequence and Locktime
nLockTime and nSequence finality
Two fields govern when a transaction is final: the transaction-level nLockTime and the per-input nSequence. Their exact encodings are in Transactions; their role in the finality consensus rule is on the Consensus Rules page. This page summarises the behaviour.
nLockTime
nLockTime (4-byte LE) sets the earliest point at which a transaction may be mined:
0— final immediately.below
LOCKTIME_THRESHOLD(500,000,000) — a block height; final once the chain reaches that height.at or above the threshold — a Unix timestamp; final once that time is reached.
nLockTime has effect only while at least one input is non-final. If every input has nSequence = 0xffffffff (SEQUENCE_FINAL), the transaction is final regardless of nLockTime.
nSequence
The only role of nSequence that affects validity in the current protocol is this finality flag: 0xffffffff marks an input final. A value below 0xffffffff marks the input non-final, which activates the nLockTime condition above.
The BIP68 relative-locktime interpretation of nSequence (and the original sequence-number transaction-replacement mechanism) applied only before Genesis, tied to OP_CHECKSEQUENCEVERIFY, which reverts to a no-op at Genesis. After Genesis, nSequence carries no relative-locktime meaning — see Transactions.
Last updated
