I've been diving into Bitcoin and have a couple of questions about nLockTime and RBF. From what I've gathered, nLockTime acts like a timer for transactions, meaning miners can't confirm them until that time's up. RBF allows you to swap out an unconfirmed transaction for a new one that has a higher fee. I get that a transaction with nLockTime can be replaced by another using RBF as long as the time isn’t up and the new one has a higher fee. However, I've got two questions:
1. Can you replace a transaction with nLockTime with a new one that has a different nLockTime? What happens if that occurs?
2. If a transaction with nLockTime is sitting in the mempool due to low fees, can I use RBF to switch it out for a new transaction with a higher fee?
I hope someone can shed some light on this for me here.
I already posted this on my local board but only got a few replies, so I'm trying my luck here for more detailed answers.
Exploring nLockTime in Bitcoin Transactions
5 replies 81 views
SilentVectorFull Member
Posts: 50 · Reputation: 362
#2Aug 26, 2021, 03:08 AM
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.
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#3Aug 26, 2021, 06:51 AM
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.
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.
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).
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.
Related topics
- Exploring the Potential and Challenges of a Kardashev-Scale Bitcoin Network 3
- Bitcoin Core displaying coins (UTXOs) in a new tab 13
- Are you in favor of BIP-110? Let's get a Bitcoin poll going. 0
- Erlay seems to have some issues here’s a better proposal for a bitcoin protocol without invites 3
- Ways to earn some sats by contributing to bitcoin core development 5
- What can I do to fix this Bitcoin Core error? 8