If I set nSequence to be 0xffffffff and broadcast that transaction. Will it be considered safe as nobody can double-spend it before it's getting into the block? Thank you.
That was the faulty assumption before "
mempoolrbf" option is implemented.
"
Faulty" because even if most nodes wont accept a replacement of it by default, there's no stopping anyone to remove it from their mempool and accept the replacement instead.
It's a race on which one to reach the miners' (
pool or solo) node to get included to the blockchain. It's also up to them which transaction to include to the block their mining.
If more of saying "
it may not be replaced" than "
it will not be replaced".
It was mainly used by centralized service to implement zero-fee deposits with low risk on their part
but since they are custodial, they are still in control of what their users can withdraw from their service in case the unconfirmed transaction is replaced.
In your case, you mustn't assume that it's safe.
And speaking of mempoolrbf option a.k.a. "
full-rbf".
If a node enabled the option, it will accept replacements regardless if
nSequence field of the transaction is
0xffffffff or
0xffffffff -1.
I've tested this before and I can say that it's now easy to replace an unconfirmed transaction without opt-in-rbf flag as long a you can broadcast the replacement to nodes that accept it.
(
with the right conditions)
-snip-
-snip-
OP must be referring to BIP125 (
Opt-in Full RBF Signaling), a.k.a. "
rbf" since
nLocktime has nothing to do with transaction replacement.
BIP-0125:
Opt-in Full Replace-by-Fee Signaling