I know it is currently not possible to cancel transactions in the Bitcoin. However, say someone wants to implement such mechanism in an altcoin. Is it theoretically possible without damaging the open nature of cryptocurrencies ? Do we have the required primitives for it ?
There are proposals to introduce new
opcodes which allow an parent output script to impose spending conditions onto the output(s) of the spending child transaction.
You could therefore "ensure" that the child transaction outputs would be "revocable", which is similar to what you are describing.
This output script could be a RSMC contract. If I wish to "cancel" the spending transactions outputs within a timeout period, I can sweep the output with the revocation key.
The proposed script opcode
OP_PUSHTXDATA pushes transaction elements from the spending (child) transaction to the stack during verification, and this could include the output script data of the child transaction:
- Output script:
OP_PUSHTXDATApushes spending child transaction output script elements onto stack, to verify that it is a revocable output.
- Input: Spends parent transaction
- Output Script: Must be a revocable output with conditions enforced by parent transaction output script.
One of the fundamental principals of cryptocurrency is to be able to operate without the need of a trusted central entity. I can't see how a transaction can be cancelled or reversed without involving a trusted central entity to arbitrate the transaction.
However we also have cryptocurrency like Ripple. In my opinion Ripple is not a cryptocurrency because of the centralized nature, but well what do I know.
Maybe in the future some genius will discover a method to implement this without a central entity :)
You surely could inplement the cancelling of an unconfirmed transaction by asking other clients to delete it from their memory. But I guess this could open door for transaction spam in your network (I mean people creating and then cancelling transactions at no cost).