Bitcoin transaction cancellation

I am writing an application for bitcoins and want to implement the cancel function. Throughout reddit there are links that, if there are no more than 3 confirmations, technically payment can be stopped. Maybe just a minute or 2, but still. I can not find any link in bitcoins api docs to demonstrate how this will be done. I know that one altcoin uses the intentional 60-minute gap to confirm this for this reason.

Does anyone know how to do this?

+7
bitcoin bitcoind
source share
3 answers

Is it possible to cancel a Bitcoin transaction ...

... that has not yet been transferred?

Yes, obviously this is possible. I suggest you select this method in your Bitcoin application, showing the user a confirmation screen for several seconds with transaction information and the cancel and confirm buttons. @nahtnam suggested a 60-minute delay, which is too long, given that you may lose Internet access or want the transaction to appear in the blockchain as soon as possible.

... which already was ?

Maybe ... To cancel such a transaction, you need to create a block yourself, which moves the inputs of the original transaction to one of your own addresses. (Actually canceling the original transaction.) However, creating a block costs several thousand dollars at the moment, and finding a block is not guaranteed.

Another possibility is to broadcast another transaction with the same inputs as the original, and target the outputs to one of your own addresses / wallets. To encourage miners to include this transaction instead of the original, you increase the transaction fee. However, some clients cannot transfer such a double spent transaction to the miners, and some miners may reject the double spent transaction and include the original (the one they received at the beginning), instead. (cf Bitpay encountered zero double costs in the first 10,000 transactions and Cancel an unconfirmed tranasaction on @theymos (bitcoin.stackexchange) )

There are several tricks to hide your initial transaction from the miners, creating the so-called "non-standard" transaction. Alternatively, the transaction may include a very low fee for the miners to reject it for economic reasons. (cf Significant losses due to bilateral unconfirmed transactions (bitcoin-dev mailing list) and Double spending on @petertodd (reddit) ) However, this makes your transaction suspicious to the recipient if they look at it, and they will probably ask you to wait until she has one or more confirmations.

Finally, it is also possible if you set a flag in the original transaction to indicate a replacement. You can then replace the original transaction with another by including the same (one or more) inputs in the replacement transaction. In addition, you have to pay a higher fee. However, not all miners comply with this flag, and some may still include your initial transaction. (cf BIP 125 reference : Enabling full replacement on behalf of )

... which is included in one or more blocks?

No, hardly impossible. You will need to manage a significant amount of hashing in order to create a fork by restoring the block chain, starting from the block before the initial transaction occurred and ended on the block with height = (current public block chain height) + 1 . Therefore, "the more evidence you have, the more difficult, expensive and unreliable such an attack is." Source: @DannyHamilton (Bitcointalk) Satoshi Nakamoto Bitcoin paper explains that this is always possible when you control more than 50% of the hash power and possibly with a probability of less than 1, but more than 0, if you control the hash power of less than 50%. See Bitcoin: Peer-to-Peer Electronic Money System . Although, if you control a significant amount of hashing power, you are likely to be encouraged not to undermine the confidence in Bitcoin by eliminating transactions and indirectly damaging your flow of mining income.

+14
source share

Not. Unable to stop bitcoin transaction. What makes Bitcoin so different. It is not possible to modify a transaction, except that the recipient will send it back to you.

On the other hand, you may still have a cancel function. You can set a delay of 60 minutes before sending a transaction, and during this interval someone can cancel, but, as I mentioned earlier, there is no way to stop a transaction that has already reached the block chain.

+3
source share

Develop a strategy before making a bitcoin payment. Make sure that both the Bitcoin addresses for the payer and the recipient are correct (use the copy and paste tool). Verify that the product / service and size information is correct. Make sure you have the correct private key information. Expect to wait at least 24 hours for confirmation. This allows miners to verify the transaction. Then check your Bitcoin account to verify that the transaction completed correctly by inserting your private key details into a Google search or check the Bitcoin software for the details of the transaction. It is difficult and expensive to cancel a transaction. Therefore, before sending, checking, checking and checking before sending.

0
source share

All Articles