Why isn't transaction replacement supported?



The wiki article on contracts talks about the best stuff you can do with delays and replacement. (Lock time and sequence numbers, respectively.) But according to the documentation, replacement isn't supported yet. Why not?

(If the answer is "it's not implemented yet", why hasn't it been?)

JP Sugarbroad

Posted 2011-09-10T20:58:01.583

Reputation: 83



That's not correct. The nLockTime field is implemented. It was deliberately switched off some time ago in order to reduce the complexity of the protocol. The reason was a series of protocol-based attacks that had compromised the integrity of the system.

At some point the feature will be re-activated. Probably, after someone has written a comprehensive test suite and technical analysis showing that it's not risky to re-enable.

Mike Hearn

Posted 2011-09-10T20:58:01.583

Reputation: 106

2Is nLockTime really deactivated? Could somebody provide a source? – kermit – 2013-03-15T08:31:56.917

Presumably by "That's not correct" you mean Thomas' answer, but the Stackexchange format does not make the context at all clear and immutable. – Meni Rosenfeld – 2012-12-16T10:12:23.787


You can do almost everything on that Contracts page without needing transaction replacement. Lock time does work today (as of Dec 2013), transactions with lock_time can't go into the blockchain until the time is reached.

Transaction Replacement is not supported because the developers have said that the whole idea of nSequence-based replacement is problematic, and may never be enabled apparently it causes potential denial of service problems. They discuss it here:


However, I don't think transaction replacement is really needed because sometime recently the developers made so transactions using lock_time and version < UINT_MAX are "non-standard". What this means is that transactions using lock_time won't be relayed on the peer-to-peer network until the lock_time is reached, at which point you can push the transaction for relaying and it will be considered standard and able to go into the blockchain.

The reason I think this takes care of most use cases is because replacement was only needed when the locked transactions were being relayed, and stored in the memory pools, so if a transaction came along that wasn't locked, it wouldn't be accepted because replacement wasn't implemented, and the locked transaction was already in the mempool. Since the locked transactions won't relay and store in the mempools now until lock_time is reached, I believe replacement is far less important, so the fact that it doesn't look like it will be implemented anytime soon is not a problem.

Mike Taylor

Posted 2011-09-10T20:58:01.583

Reputation: 31


it's not implemented yet.

The protocol has these feature defined so they can be implemented in the future, but currently more important features are being worked on.

Fork the repo and create a patch to add support :p

Thomas Grainger

Posted 2011-09-10T20:58:01.583

Reputation: 119


Heres a site that shows nLockTime code implementation whether it works or not I have no idea Some say its implemented, others say its not



Posted 2011-09-10T20:58:01.583

Reputation: 1