Bitcoin Forum
June 08, 2025, 09:36:11 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Understanding nLock time in Bitcoin transactions.  (Read 117 times)
Abbatty (OP)
Full Member
***
Offline Offline

Activity: 770
Merit: 240


Catalog Websites


View Profile
May 27, 2025, 08:09:11 AM
Merited by ABCbits (2), RockBell (1)
 #1

I've been trying to understand Bitcoin better, and I've got some questions about nLockTime and RBF. From my understanding, nLockTime is like a delay timer for transactions, and miners can't confirm them until the set time is reached. RBF lets you replace an unconfirmed transaction with a new one that has a higher fee. Also I understand that transaction with nLock time set can be replaced by a new transaction with RBF feature so far the set time is not yet reached and has a higher fee. I'm okay with that but I have two questions:

1. Can a transaction with nLockTime be replaced with a new one that has a different nLockTime value? What happens if it gets replaced?
2. If a transaction with nLockTime is stuck in the mempool because of low fees, can I use RBF to replace it with a new transaction that has a higher fee?

Hope someone can help clarify this better for me here.

Already asked this in my local board but got a few replies so I thought I ask here for more explanation and understanding.

Ivystar5
Full Member
***
Offline Offline

Activity: 238
Merit: 139


Stressed since 19's


View Profile
May 27, 2025, 08:33:12 AM
 #2

1. Yes it can be replaced, for instance if I set an  nLockTime and unfortunately the time has come and my expectations are not yet reach I can replace them and set a new expected time. it can be used to gift someone but if the person is not what you expect by the time you locked the transaction then you can replace and give another time.

Nothing happens it's one of the specialty of nLockTime

2. Yes, Another instance is, if the lockTume is reached and because of low fees it hasn't been delivered you can use RBF to make it faster.

Another good thing about RBF and nLockTime is that if your expectations are not reached you can use RBF to return the TX to yourself using a higher Fee especially when it's about goods ordered.

nc50lc
Legendary
*
Offline Offline

Activity: 2800
Merit: 7257


Self-proclaimed Genius


View Profile
May 27, 2025, 11:48:12 AM
Merited by ABCbits (2)
 #3

From my understanding, nLockTime is like a delay timer for transactions, and miners can't confirm them until the set time is reached.
-snip-
1. Can a transaction with nLockTime be replaced with a new one that has a different nLockTime value? What happens if it gets replaced?
2. If a transaction with nLockTime is stuck in the mempool because of low fees, can I use RBF to replace it with a new transaction that has a higher fee?
You can't correlate RBF with nLocktime since a non-final nLocktime prevents the transaction to be relayed by nodes,
So it's either saved by the user locally or saved in the wallet as a local transaction if it has such feature. (not broadcasted)

While utilizing RBF for transaction replacement (bump fee) is for unconfirmed transactions that are already broadcasted to the network.

hosemary
Legendary
*
Offline Offline

Activity: 2786
Merit: 6219



View Profile
May 27, 2025, 01:09:55 PM
 #4

Any transaction with a locktime into the future is rejected by the nodes and it won't go to their mempools at all. This means that you can't broadcast such transactions at all and there is nothing to be replaced.
If you have a transaction with a locktime into the future, you have to wait until the specified time (or the block height) and after that you can broadcast it.

▄███████████████████▄
████████████████████████

██████████▀▀▀▀██████████
███████████████▀▀███████
█████████▄▄███▄▄█████
████████▀▀████▀███████
█████████▄▄██▀██████████
████████████▄███████████
██████████████▄█████████
██████████▀▀███▀▀███████
███████████████████████
█████████▄▄████▄▄████████
▀███████████████████▀
.
 BC.GAME 
███████████████
███████████████
███████████████
███████████████
██████▀░▀██████
████▀░░░░░▀████
███░░░░░░░░░███
███▄░░▄░▄░░▄███
█████▀░░░▀█████

███████████████

███████████████

███████████████

███████████████
███████████████
███████████████
███████████████
███████████████
███░░▀░░░▀░░███
███░░▄▄▄░░▄████
███▄▄█▀░░▄█████
█████▀░░▐██████
█████░░░░██████

███████████████

███████████████

███████████████

███████████████
███████████████
███████████████
███████████████
███████████████
██████▀▀░▀▄░███
████▀░░▄░▄░▀███
███▀░░▀▄▀▄░▄███
███▄░░▀░▀░▄████
███░▀▄░▄▄██████

███████████████

███████████████

███████████████

███████████████

DEPOSIT BONUS
.1000%.
GET FREE
...5 BTC...

REFER & EARN
..$1000 + 15%..
COMMISSION


 Play Now 
mcdouglasx
Sr. Member
****
Offline Offline

Activity: 658
Merit: 270


View Profile WWW
May 27, 2025, 05:15:55 PM
Merited by ABCbits (2)
 #5

Think of it this way, a transaction with nLockTime set for the future is like writing a check (Creating the Transaction) that is postdated for one month.

This check isn't sent to the bank (Not Broadcast to the Network) until the specified date arrives or later.

If you try to deposit the check at the bank before that date, the bank will reject it (Nodes Will Reject It) for being “postdated”.

The responsibility for retransmitting the transaction falls on the creator (or their software).
Abbatty (OP)
Full Member
***
Offline Offline

Activity: 770
Merit: 240


Catalog Websites


View Profile
May 27, 2025, 10:16:33 PM
 #6

Oh I see, now I get this. Thank you all for the clarification. I use to think the transactions are broadcasted and stored somewhere by the nodes in their mempool until the set time before they can work on it. So it can't be broadcasted, either you store on your wallet or you just wait until that time to broadcast. Well understood thanks again.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!