Transaction Cancellations

Should Coda support cancelling of transactions? We currently support the replacement of transaction via providing a new transaction with the same nonce but a higher fee. As far as I understand, however, other cryptocurrencies, such as ETH, support free and explicit transaction cancellation commands. This seems like a useful feature for when someone wants to remove a transaction but not replace it with a new one. For instance, perhaps someone makes a transaction with too high of a fee by accident and wants to replace it with a transaction with a lower fee. Or perhaps just sent a transaction by accident all together because of a bad wallet UX. Under the current setup, they would be out of luck in these situations.

Any thoughts or opinions on this? Any more details and examples about what other cryptocurrencies do?


The thought I had was what would incentivize nodes to actually cancel a transaction if they didn’t receive at least as much fees as they would have from including it.

We can incentivize nodes to honor cancellations by having the cancellation for that nonce stick around in the txn pool until another txn replaces it. With this, nodes can then reject and punish producers of blocks that contain transactions for nonces that are currently cancelled. Some more thought needs to be put into this to ensure the txn pool won’t leak (only one cancellation record per account at a time, with purely constant size), and to make sure that new txns can replace the cancelled nonce without triggering bans on honest nodes that include the txn before everyone knows about the replacement, but I think this is a promising angle we could explore still.

I don’t think Ethereum supports free transaction cancellation, for the reason @bkase mentions. Non-canonical source, I couldn’t find a relevant spec in a few minutes of searching.

The transaction pool DoS RFC supports that approach and, I believe, we have transaction cancellation today.

I am very hesitant to tie block validity to off-chain state like the tx pool. You mention this: if you race your cancellation with the block gossip, what would happen? I’m not sure it’s insurmountable (maybe add some latency to all txn processing, maybe commit to the tx pool hash on chain, others?) but the complexity seems unwarranted.

As block time trends down, successfully being able to cancel a txn becomes less and less likely.

I was mistaken when I said that ETH supported it then. I cancelled a transaction on ETH before, but I think it was just a UX hiding the reality that it was invalidating the transaction with an extremely high fee or something like that.

It’s true that as block time trends down the window to cancel a transaction decreases, but if influx of transaction is high enough, there is still a window. I agree that it’s not a great thing to tie block validity to off-chain state, though. Perhaps there is little gained here for the cost to validation. Implementing this would likely require a slot delay for txns to be included (the delta parameter in Ouroboros).

Still curious what others think on this topic.