> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/wiki/transactions-and-utxos/bitcoin-transactions/nlocktime-and-nsequence.md).

# NLocktime and nSequence

nLocktime and nSequence are interlocks that can be applied to Bitcoin Transactions.

1. nSequence **nSequence** is a parameter applied to each input of a transaction. If a transaction's nLocktime interlock is active (i.e. nLocktime is set to a point in the future), a transaction which has one or more inputs where nSequence is less than UINT\_MAX (0xFFFFFFFF), then the transaction cannot be accepted into a block.
2. nLocktime **nLockTime** is a parameter applied to each transaction specified in either unix time or block height, before which, the transaction cannot be accepted into a block. If all inputs in a transaction have nSequence equal to UINT\_MAX, then nLockTime is ignored. If nLockTime < 500,000,000, the integer is interpreted as the block height after which this transaction can be accepted. Otherwise the integer is interpreted as the UNIX timestamp after which this transaction can be included in a block. The [Unix Timestamp](https://en.wikipedia.org/wiki/Unix_Timestamp) is the number of seconds that have elapsed since the Unix epoch, which began at 00:00:00 UTC on 1 January 1970, minus leap seconds. Leap seconds are ignored, with a leap second having the same Unix time as the second before it. Every day is treated as if it contains exactly 86400 seconds. Due to this treatment, Unix time is not a true representation of UTC.
3. Use in Payment Channels In transactions where nLockTime is set in the future, and one or more inputs have nSequence number fields less than 0xFFFFFFFF they are considered non-final and may be held in a transaction pool until either nLockTime expires or all inputs have their nSequence finalised. Non-final transactions are replaceable with transactions that include the same inputs with a higher nSequence number. This function can be used to build payment channels allowing dynamic exchange of data between parties in a peer to peer manner.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hub.bsvblockchain.org/wiki/transactions-and-utxos/bitcoin-transactions/nlocktime-and-nsequence.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
