> For the complete documentation index, see [llms.txt](https://protocol.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://protocol.bsvblockchain.org/concepts/sequence-and-locktime.md).

# 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](/specification/transactions.md#nlocktime); their role in the finality consensus rule is on the [Consensus Rules](/specification/consensus-rules.md#finality-nlocktime--nsequence) 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.

{% hint style="warning" %}
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](/specification/transactions.md#bip68-relative-locktime--pre-genesis-only).
{% endhint %}
