Tuesday 2 April 2019

Can you reverse or cancel a bitcoin transaction?

A lot of rumor has it that is might be possible to cancel or reverse bitcoin transaction by double spending
this has been found to be untrue, Bitcoin transactions cannot be canceled

though there are some tricks that can be pulled off when the transaction has not been confirmed
these methods have not been confirmed to be 100% true but it might work out.

you can create a (very) low-fee transaction, and broadcast it to as little nodes as humanly possible. Then, create a new transaction, using the same unspent outputs as input but funding a completely different address as the first transaction. You can create this secondary transaction with a much higher fee and broadcast it to as many nodes as possible.

If you do this, there is a decent chance a miner will put the second transaction into the block he's currently working on instead of the first one. And once one of those transactions ends up in a valid, broadcasted block that's been added to the blockchain, the other transaction is automatically "voided". It's using unspent outputs that are no longer in the UTXO set, so the unconfirmed tx becomes invalid.

If you're setting up a service, it's always a good idea to wait for at least 1 confirmation before sending goods or services. For expensive products, you might even choose to wait for 3+ confirmations ( 6+ for the really paranoid shop owners). Once a transaction has a couple of confirmations, there is no way of canceling or reversing it.

No comments

Post a Comment