I found myself incapable of answering what would happen in this case, so here it is:
A hacker (
Mr Hacker) spends
TX_1, depositing the monetary value of all
TX_1's outputs into a
Service(eg a payment processor).
A legitimate user (
Mr Legit) spends
TX_2's outputs targets the same
TX_2make it into the same block and get one confirmation by the network.
Mr Hackerthen decides to double-spend
TX_1and for that reason he creates
TX_5which "redirects" all outputs to himself.
Mr Hackeris a miner so he is able to perform all the hashing work to make the double-spend successful. He is also lucky and the double-spend succeeds.
So the question is:
Have all TXs before
TX_5(TXs: 1,2,3,4) been invalidated or just
TX_4spent an output previous controlled by
TX_1which was double-spent)?
Mr Legitcould see 1 confirmation for
TX_2before the double-spending. What does he see now? What does
Mr Smithsee in his wallet, before and after the double-spending?
Servicerealizes that a double-spending took place and needs to recover from that broken state. What does it have to do to get back to normal operation? Does it have to re-send all the TXs? Does it still have in place the deposits made by
TX_2after the double-spending or does it have to do something to re-claim these outputs?
How can the
Mr Hacker, who also has plenty of money to spend, from repeating the same process forever just to ruin the
Service's smooth operation, rather than (the
Service) waiting for more confirmations before sending out the payments?