Sequence Number
A Sequence Number is a field within each Bitcoin transaction input that was originally designed to allow transaction updates before confirmation. Today, it is primarily used to support features such as Replace-by-Fee (RBF) and relative timelocks through mechanisms like CheckSequenceVerify (CSV).
Sequence Number Explained in Simple Terms
Sequence Number Explained in Simple Terms
Every Bitcoin transaction input contains several pieces of information, including a Sequence Number.
In Bitcoin's early design, this field was intended to allow users to replace a transaction with a newer version before it was confirmed. Although the original concept was not widely adopted, the field later became the foundation for important protocol features.
Today, Sequence Numbers are commonly used for:
transaction replacement
fee bumping
relative timelocks
Lightning Network functionality
Most wallet users never see Sequence Numbers directly because wallets manage them automatically. However, they play a critical role behind the scenes in modern Bitcoin transactions.
How Sequence Number Works
How Sequence Numbers Work
A Sequence Number is assigned to each transaction input.
The process works as follows:
Transaction Created The wallet constructs a Bitcoin transaction.
Sequence Values Assigned Each input receives a Sequence Number.
Nodes Interpret the Value Depending on the value used, different rules may apply.
Special Features Activated The transaction may support:
Replace-by-Fee
relative timelocks
advanced scripting logic
Transaction Validated Nodes evaluate the Sequence Number as part of transaction verification.
The relationship can be summarized as:
The meaning of the field depends on how it is configured.
Example of Sequence Number in Practice
Example of a Sequence Number
Suppose Alice sends a Bitcoin transaction with a low fee.
The transaction remains unconfirmed because network congestion increases.
If the transaction was created with Replace-by-Fee enabled, Alice's wallet can create a replacement transaction with:
the same inputs
the same recipient
a higher transaction fee
The Sequence Number signals that replacement is permitted.
Miners typically prefer the higher-fee version, improving the likelihood of confirmation.
Why Sequence Numbers Matter
Although often overlooked, Sequence Numbers are important because they enable flexibility within Bitcoin's transaction system.
They support:
fee management
transaction updates
payment channels
relative timelocks
Layer 2 protocols
Without Sequence Numbers, several modern Bitcoin features would either be impossible or significantly more difficult to implement.
Sequence Number and Replace-by-Fee (RBF)
One of the most common uses of Sequence Numbers is Replace-by-Fee.
RBF allows a user to replace an unconfirmed transaction with a new version that pays a higher mining fee.
This is particularly useful when:
the original fee was too low
network congestion increases unexpectedly
faster confirmation becomes necessary
Sequence Numbers help signal whether a transaction is eligible for replacement.
Sequence Number and Relative Timelocks
Sequence Numbers also support relative timelocks through CheckSequenceVerify (CSV).
Unlike Locktime, which specifies an absolute date or block height, relative timelocks measure time relative to when a UTXO was confirmed.
For example:
wait 100 blocks after confirmation
wait 7 days after receipt
before allowing spending.
This functionality is widely used in advanced Bitcoin contracts and payment channels.
Sequence Number vs Locktime
Locktime
Controls:
when a transaction becomes valid
Based on:
block height
timestamp
Applies to:
the entire transaction
Sequence Number
Controls:
input-specific behavior
Supports:
transaction replacement
relative timelocks
Applies to:
individual transaction inputs
Although both relate to transaction timing, they serve different purposes.
Sequence Numbers and the Lightning Network
The Lightning Network relies heavily on relative timelocks.
Sequence Numbers help enforce:
channel settlement periods
fraud prevention windows
dispute resolution mechanisms
These time-based protections allow Lightning participants to interact securely without broadcasting every transaction to the blockchain immediately.
Default Sequence Numbers
In most standard transactions:
wallets assign default values automatically
users never interact with them directly
Only advanced use cases typically require manual control of Sequence Numbers.
As a result, most Bitcoin users benefit from the functionality without needing to understand the underlying implementation.
Related Bitcoin Terms
Locktime
Replace-by-Fee (RBF)
CheckSequenceVerify (CSV)
Transaction Input
Lightning Network
Timelock