I suppose a better alternative would be to hold the key data in RAM until your tx is confirmed, and sign a new transaction with the new txid, if the first one is mutated. Perhaps even broadcast the first one, but immediately sign and broadcast the replacement if the first one is invalidated. I prefer the first one though (where the software just waits before doing anything), which is a bit cleaner.
Interesting. In my example (
https://bitcointalksearch.org/topic/m.5113081) where the customer's donut purchase is invalidated because his coffee purchase was malled, the wallet would realize this and then send out a new transaction to remedy the situation [which may occur after the customer has left the store and without his knowledge].
So, the customer could still pay instantly, even if they have no confirmed outputs. Provided the customer is honest (which we already need to assume), the merchant will still get paid even if the parent transaction gets malled by an attacker: the wallet just checks for malling and, if so, sends a replacement TX to fix the problem.
My concern with this is that the customer turns off their phone or turns off their computer, and the replacement tx never gets sent. Yet, they saw the "This invoice has been paid" message and didn't realize that it wasn't guaranteed. I'd rather they see nothing positive until the tx is done.
But that also assumes that all tx will be mutated. Thus there's no point to doing the first tx. If the standard case is no mutations, it might work.
But I am deeply concerned that people will find themselves accidentally reversing paying for their doughnut, and then refusing to allow the replacement tx to go through. i.e. They pay, turn off their device, turn it back on later, and it tells them the payment never went through, please re-type your password to re-send... "hmm, if I just don't type my password, that was a free doughnut!"
It's one of those things, that makes me feel like the
empirical reliability of zero-conf tx allowed too many businesses to build services around them, which can't be supported now. Technically, you could do an ETF from your bank to pay for your doughnut, or pay with gold flakes, but we don't because the timelines and convenience make it infeasible. I would argue that Bitcoin should be treated somewhat the same way, and it was only a matter of time before the illusion fell apart.
Bitcoin is fantastic for a whole lot of things, but Point-of-Sale doesn't seem to be one of them.