Can unconfirmed transactions be aborted?

When my transaction does not get confirmed within reasonable time, I can republish it. Is there also a way to abort it?

For example: If I bought something with Nano at a store, but I'm holding up the queue because my transaction hasn't been confirmed for 20s, I'd rather abort it and pay with cash.

Right now I don't think it's possible and I don't know any viable (future) way of doing that, which wouldn't open the door to double spend attacks.

What you could do right now, is you could remove the frontier block of your account chain (the most recent send block) and replace it by another send block with destination=your account. This is essentially a double spend and you have no control which of the two blocks gets confirmed first by the network.
You need to consider a send procedure immutable, if you don't want to run into trouble.

Troubleshooting the issue goes like this:
the store issues a refund, if you pay through other means after you've already sent a NANO payment. This is creating no trouble on protocol level, but creates some efforts and may need some time, if the network is facing extraordinary conditions.
The store needs to ask you, whether they can return the NANO to the sender address.
If you confirm that, they just need to set a flag in their payment system, that returns the funds upon receipt.
If you deny that, you need to give them an address, which they assign to that transaction for the refund.
This is the only safe way I can think of.

It's good to consider these situations, because edge cases need to be taken care of, but under normal conditions they should rarely happen. That's why I call them edge cases :wink:

Thanks for the extensive answer! Automated refunds seem like an appropriate solution to me.

1 Like

You're welcome!
Maybe other people have additional ideas. I'm glad you found the automated refund helpful.