← Back to Glossary

Input Sequence (nSequence)

An input sequence, or nSequence, is a field of a Bitcoin transaction input.

An input sequence, or nSequence, is a field of a Bitcoin transaction input. The sequence of an input was originally intended to enable payment channels similar to the Lightning Network. This design was implemented in the first version of Bitcoin, but such on-chain payment channels were quickly found to be insecure, so the functionality was disabled, leaving the sequence field unused for several years.

With the adoption of BIP 125, the sequence field came into use once again. Currently, input sequences are used to signal support for Replace-by-Fee (RBF), which allow a user to replace an unconfirmed transaction and with a similar transaction that pays a higher fee. If a user broadcasts a transaction with a low fee, and the transaction is not being confirmed in the desired time, RBF allows the user to increase the fee, incentivizing miners to confirm the transaction faster.

Originally, the input sequence was meant to allow transactions to be replaced dynamically, allowing Bitcoin payment channels to be created on-chain. On-chain channels would have worked as follows.

Alice and Bob create a transaction with some inputs and outputs, and set the input sequences to zero and the locktime to some point in the future, preventing the transaction from being included in a block until that point. In the meantime, Alice and Bob can pay each other back and forth by changing the amounts in the outputs and incrementing the sequence, which acts like a version counter for the transaction itself.

If, at any point, Bob and Alice want to finalize their payment channel, they can set the sequence to its maximum value, precluding any further updates. When the locktime is reached, a miner will include the most up-to-date version of the transaction in a block, finalizing it.

Input Sequence (nSequence) is a concept relevant to Bitcoin, finance, or blockchain technology that investors should understand. Onramp's comprehensive Bitcoin glossary provides clear explanations of Input Sequence (nSequence) and hundreds of other terms to support informed investment decisions.

Frequently Asked Questions

What is Input Sequence (nSequence)?

Input Sequence (nSequence) is a term used in Bitcoin, finance, or blockchain technology. Understanding Input Sequence (nSequence) helps investors and enthusiasts build a stronger foundation of knowledge about digital assets and financial markets.

Why is Input Sequence (nSequence) important?

Input Sequence (nSequence) is relevant to understanding how Bitcoin, financial markets, or blockchain technology operates. Knowledge of such concepts helps investors make better-informed decisions about their portfolios.

Where can investors learn more about Input Sequence (nSequence)?

Onramp's Bitcoin glossary offers detailed, accessible explanations of Input Sequence (nSequence) and over 500 other terms related to Bitcoin, finance, and blockchain technology for investors at all experience levels.

Multi-Institution Custody

Are you ready?

The best security available for your Bitcoin without the technical burden. It’s time to upgrade.

Sign up