Author

Topic: How can I double spend an unconfirmed Bitcoin transaction? (Read 426 times)

legendary
Activity: 1946
Merit: 1427
Thank you for the answer, you spoke of other options, which would they be?

I think the other options are referring to the Finney & 51% attack. See https://bitcoin.stackexchange.com/questions/4974/what-is-a-double-spend

(Finney; https://bitcoin.stackexchange.com/questions/4942/what-is-a-finney-attack)
(51%; https://en.bitcoin.it/wiki/Irreversible_Transactions#)

You're not likely to execute either of these attacks as an individual nowadays.
newbie
Activity: 19
Merit: 1
Thank you for the answer, you spoke of other options, which would they be?
legendary
Activity: 1624
Merit: 2481
First, if you try to double spend transaction to scam others.. you won't succeed. If you have to ask such basic questions, you are definitely not able to achieve that.

But if it really is for educational purpose.. what you actually want to do in such a scenario is to broadcast the lower fee (to be replaced) transaction at the same time as your higher fee (replacing) transaction.
However, you would use several nodes spread across the world for that. I.e. this means that you would use a single node to broadcast your low fee tx and multiple other nodes (which are not connected with each other) to broadcast the replacing transaction.
With that setup, you would be able to get more nodes to have your 2nd (replacing) transaction in their mempool. Then it is mostly luck which miner does find a block. Either one with your first or with your second transaction.

That's the race attack shortly described. There are a few more ways to double spend, but that is probably one of the easiest.
legendary
Activity: 2268
Merit: 18711
Are there things that can be done to make it always work
No. There will always be a high risk that it will fail, otherwise people would be double spending all the time and everyone would be waiting for multiple confirmations, instead of some services accepting zero confirmation transactions.

Is there a specific block explorer that publishes the transaction faster
It's not a case of publishing it faster, but rather, the speed at which it propagates through the network. You need the first transaction to be broadcast to nodes which are used by the intended recipient/victim or the block explorer of their choice, and you need the second transaction to be broadcast to nodes used by miners, but not those nodes which have already seen the first transaction. You could theoretically work out optimum entry points through significant trial and error, but doing so would be costly, time consuming, wouldn't guarantee anything, and could change at any time as nodes come online and drop offline.

maybe changes in the transaction that the transaction with lower fees cannot be accepted?
No. Once a transaction has been signed and broadcast, it can't be changed to become invalid (excluding transaction malleability if the transaction is built upon a previous unconfirmed transaction, but that doesn't apply here).
newbie
Activity: 19
Merit: 1
Are there things that can be done to make it always work because, in my experience, it only works sometimes?
Is there a specific block explorer that publishes the transaction faster or maybe changes in the transaction that the transaction with lower fees cannot be accepted?

How much higher must the second transaction be with the fees?

I would be very happy to get answers as I find this very interesting.
newbie
Activity: 19
Merit: 1
Thank you for all the answers, you answered my questions.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
When you mention "he can't use that method", do you mean Electrum doesn't allow to perform the steps in guide if it's non-RBF or because race condition?
I mean the actual written steps.

He can use Electum to create the RAW TXs.
Broadcasting the low fee tx using Electrum and quickly (seconds-delay) broadcast the second to other blockexplorers will work
but that wont work for a well propagated unconfirmed non-RBF transaction, like if it was sent 1-5+ minutes ago.
legendary
Activity: 3472
Merit: 10611
If you're the owner of pool, you can perform Finney attack (include conflicting/double-spend transaction on mined block). The higher the hashrate percentage you have, the higher probability the attack will success.
And if it success, you and your pool reputation would be going downhill instantly.

your description sounds like an invalid block (include conflicting/double-spend transaction on mined block) since you can't really do that. the Finney Attack is a pretty simple double spend attack where there are 2 transactions spending same output, one is broadcast to the network (is in mempool) and the other is included in the block by the miner but the block is not broadcast until the receiver accepts the unconfirmed transaction then the block is broadcast right away which makes the tx in mempool invalid.
i said pretty simple because all the merchant has to do is to wait for at least 1 confirmation.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
If you use forum search function or search engine, you can find other thread/website which mention how to perform double spend. Example :
https://bitcointalksearch.org/topic/m.53749056
Smiley The difference is, OP's transaction wasn't flagged as "replaceable", so he can't use that method.
IDK what his intention is but it looks like he's trying to find a workaround to something that requires a non-RBF transaction.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
You can wipe your transaction history by using -zapwallettxes as an added start parameter or in the config file and clear your mempool by manually deleting 'mempool.dat'.
The order is: shutdown core - delete mempool - start with zapwallettxes.
But that wont stop your node from receiving your 1st transaction back to your mempool.

If you're fast enough, try to broadcast the new raw transaction in the console.
But again, it's up to your peers if they will accept the new conflicting non-RBF transaction (99% won't).

(Don't do this if your node is pruned)

If this is not for scamming purposes this video below will help how to perform double-spend and how double-spend works.
- https://www.youtube.com/watch?v=ycq7O48aPvQ
Too bad, localbitcoins removed their blockexplorer's broadcast function.
I can't believe they accepted non-RBF double-spends and can successfully propagate it in 2015.
legendary
Activity: 3374
Merit: 3095
Playbet.io - Crypto Casino and Sportsbook
Thank you for this information, if you know a mining pool, I would be very interested to try such a double spend. Smiley

If this is not for scamming purposes this video below will help how to perform double-spend and how double-spend works.
- https://www.youtube.com/watch?v=ycq7O48aPvQ

Actually the video is made to save your stuck transaction but you can get idea how it works.
newbie
Activity: 19
Merit: 1
Thank you for this information, if you know a mining pool, I would be very interested to try such a double spend. Smiley
legendary
Activity: 1666
Merit: 1196
STOP SNITCHIN'
Having said all that, the vast majority of nodes will only accept the transaction which they see first (which will be your original transaction)

To have any chance of success, the second transaction would need to be sent directly to mining nodes. I'm not sure how many mining pools still have policies that allow spends like this. It was once possible with Eligius.

If it was as simple as broadcasting two different transactions from two different places as I stated above, then everyone would be doing it and bitcoin would be useless.

We should just consider unconfirmed transactions as unpaid. That's how most businesses deal with the issue.
newbie
Activity: 19
Merit: 1
Thank you for the informations.
In my opinion, Bitcoin would not be useless just because you can double spend unconfirmed transactions, that's why nearly anyone wait for confirmations.
To understand this correctly, it is actually almost impossible to double spend an unconfirmed transaction that has not been marked with RBF since the nodes always accept the transaction that they saw first.
I always thought the nodes preferred the transactions with the highest fees.
You have to create a raw transaction with a higher fee and submit to the mempool.
So the answer is wrong?
legendary
Activity: 2268
Merit: 18711
Why do you want to do this?

I have tried it several times now, but with both Bitcoin Core and Bitcoin Armory I get the error message that the new Bitcoin transaction conflicts with the unconfirmed transaction and therefore I fail with double spend.
It sounds like you are referring specifically to a race attack.

You won't be able to broadcast a new transaction via the client which broadcast your previous transaction, as the node or server will already have your previous unconfirmed transaction in its mempool, and so your new transaction will be flagged as a conflict and rejected. You will need to sign the new transaction, export it, and broadcast it from somewhere which hasn't yet seen your previous transaction, such as a different wallet connected to a different node or an online transaction broadcaster such as https://blockchair.com/broadcast.

Having said all that, the vast majority of nodes will only accept the transaction which they see first (which will be your original transaction), and most block explorers will flag it up as an attempted double spend. If you are trying to rip someone off with this, you won't be successful. If it was as simple as broadcasting two different transactions from two different places as I stated above, then everyone would be doing it and bitcoin would be useless.
newbie
Activity: 19
Merit: 1
Are you sure that this does not lead to transaction conflicts with the unconfirmed transaction, but also with an unconfirmed transaction that is not marked with RBF?
jr. member
Activity: 107
Merit: 8
You have to create a raw transaction with a higher fee and submit to the mempool.
newbie
Activity: 19
Merit: 1
I would like to know if it is possible, if so, how, if you can double spend an unconfirmed Bitcoin transaction if you have not marked the transaction with RBF.
I have tried it several times now, but with both Bitcoin Core and Bitcoin Armory I get the error message that the new Bitcoin transaction conflicts with the unconfirmed transaction and therefore I fail with double spend. Sad

I would be very happy if someone could help me.
Jump to: