Bitcoin Forum
July 25, 2026, 04:32:07 PM *
News: Latest Bitcoin Core release: 31.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Understanding nLock time in Bitcoin transactions.  (Read 188 times)
Abbatty (OP)
Sr. Member
****
Offline

Activity: 1190
Merit: 298



View Profile
May 26, 2025, 01:52:26 PM
Merited by igebotz (4)
 #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?

I for ask this question for main board but sometimes their explanations and terms used de dey too complex for easy understanding. Hope person fit help clarify this for me here.

Charles-Tim
Legendary
*
Offline

Activity: 2352
Merit: 6449


Leading Crypto Sports Betting & Casino Platform


View Profile
May 26, 2025, 02:08:12 PM
Merited by igebotz (2)
 #2

1. Can a transaction with nLockTime be replaced with a new one that has a different nLockTime value? What happens if it gets replaced?
This is one of what timelock can be used for, inheritance purpose. Maybe you set it to be confirmed after one year, but you think of extended the time because you are closer to the time already, you can extend it and use RBF to double spend the transaction and you can make the new transaction a timelock transaction. But do not forget that you will always replace it a little higher fee each time.

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?
Yes. In case of inheritance, the person that wants to inherit it can use CPFP and use high fee to get faster confirmation.

There are pros and cons while using this for inheritance, so know the coins as well if you want to use it for inheritance.

Why not ask this on the general board where you will get more better replies?

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
promise444c5
Legendary
*
Offline

Activity: 1092
Merit: 1051


All things are numbers


View Profile WWW
May 26, 2025, 04:58:26 PM
Last edit: June 02, 2025, 11:52:59 PM by promise444c5
Merited by Charles-Tim (1), igebotz (1), Felicity_Tide (1)
 #3

The nLocktime can actually be double-spend by you (just as Charles mentioned) but if you utiles  script timelock which uses op code <OP_CHECKTIMELOCKVERIFY> , the receiver won’t be able to spend it till the lock time is fullfilled ..
It will be added to the blockchain unlike the nLocktime which will be rejected by nodes (untill the block height or timestamp specified  is fulfilled before it get added to the blockchain ), there will be a time lock script on your output preventing the receiver from spending the UTXO until the time& conditions specified is been fufilled…

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
Abbatty (OP)
Sr. Member
****
Offline

Activity: 1190
Merit: 298



View Profile
May 26, 2025, 11:10:42 PM
 #4

Thanks for the replies it have really helped a lot and I now have a better understanding of lock time in Bitcoin transactions and also how it relates with RBF.

Why not ask this on the general board where you will get more better replies?
I think you're right, maybe I will ask this on the general board and see what more I can get there. Thanks.

igor72
Legendary
*
Offline

Activity: 2394
Merit: 2396


View Profile
May 31, 2025, 01:36:23 PM
Merited by igebotz (2), promise444c5 (1)
 #5

What many people don't seem to realize is that nLockTime transaction doesn't sit in the mempool waiting for its time, it simply can't be broadcasted until a given time or block.
Abbatty (OP)
Sr. Member
****
Offline

Activity: 1190
Merit: 298



View Profile
June 01, 2025, 10:02:09 AM
 #6

What many people don't seem to realize is that nLockTime transaction doesn't sit in the mempool waiting for its time, it simply can't be broadcasted until a given time or block.
I get it, nLockTime transactions aren't waiting in line, they just can't be sent until a certain time or block is reached. Actually, someone already explained this to me, and now it clicks even more. Thanks anyways.

Felicity_Tide
Sr. Member
****
Offline

Activity: 840
Merit: 385


cout << "Bitcoin";


View Profile
June 01, 2025, 05:53:13 PM
Merited by igebotz (2), Hatchy (2), promise444c5 (1)
 #7

I get it, nLockTime transactions aren't waiting in line, they just can't be sent until a certain time or block is reached. Actually, someone already explained this to me, and now it clicks even more. Thanks anyways.

I'm not sure of why I didn't come across this discussion earlier, but I guess it's never too late. I have asked something similar some months back, and the replies in the thread explains everything perfectly. Mind you, you can have only a single nlocktime. So, whatever your goal might be, you can either specify a specific block height, or a datetime.

Here is the thread...
Bitcoin users or miners - who is behind(initiates) a bitcoin Locktime

Obim34
Hero Member
*****
Offline

Activity: 1050
Merit: 718



View Profile WWW
June 01, 2025, 07:41:48 PM
Merited by igebotz (2)
 #8

What many people don't seem to realize is that nLockTime transaction doesn't sit in the mempool waiting for its time, it simply can't be broadcasted until a given time or block.
I get it, nLockTime transactions aren't waiting in line, they just can't be sent until a certain time or block is reached. Actually, someone already explained this to me, and now it clicks even more. Thanks anyways.
It works just like scheduled message for those using Telegram, the message doesn't upload until the exact time it was assigned.

Using nLockTime for inheritance purposes also needs some derivative to sum it up into success. Using nLockTime doesn't secure Bitcoin for inheritance because losing private keys to a third party, as much backfires with the risk of losing your Bitcoin since it can be altered and broadcast in a shorter time.


███████▄▄███▄███▄
███▄▄████████▌██
▄█████████████▐██▌
██▄███████████▌█▌
███████▀██████▐▌█
██████████████▌▌▐
████████▄███████▐▐
█████████████████
███████████████▄██▄
██████████████▀▀▀
█████▀███▀▀▀

▄▄▄██████▄▄▄███████▄▄▄
███████████████████████████
███▌█████▀███▌█████▀▀███████████▄▄▄▄▄▄▄▄
███▌█████▄███▌█████▄███▐███████████████████▄
▐████████████▀███████▄██████████▀▀▀▀▀▀▀▀████▀
▐████████████▄██▄███████████▌█████████▄████▀
▐█████████▀█████████▌█████████████▄▄████▀
██████████▄███████████▐███▌██▄██████▀
██████████████▀███▐███▌██████████████████████
████▀██████▀▀█████████▌███▀▀▀▀███▀▀▀▀▀▀▀████▌
 
      P R E M I E R   B I T C O I N   C A S I N O   &   S P O R T S B O O K      

█▀▀









▀▀▀

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  98%  
RTP

 
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

▀▀█









▀▀▀

█▀▀









▀▀▀

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

 HIGH 
ODDS

 
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

▀▀█









▀▀▀
 
..PLAY NOW..
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!