Ways to theoretically double spend your bitcoin

13 replies 131 views
RogueGangMember
Posts: 6 · Reputation: 132
#1Sep 28, 2017, 04:39 PM
In this thread, I'm gonna go over a theoretical method where users might be able to double spend their bitcoin. Just a heads up, this is based on game theory and looks at how bitcoin users interact and the different ways miners could make profits. So for starters, I'm gonna assume you're already familiar with Bitcoin's white paper and have a basic grasp of game theory. Also, you should know how transaction fees work and what a 51% attack is all about. Now, about miners making money. An honest miner gets paid through block rewards and transaction fees. But in the situation I’m laying out, block rewards are gone, and all that miners get is those transaction fees. Now let's talk double spending. Basically, it happens when a transaction X, which moves funds from A to B, gets added to a longer chain. After it's in there, a miner manages to mine two blocks in a row without including transaction X. Instead, they throw in a transaction X' where the coins go from A to A', an address controlled by the same individual. Of course, pulling off this kind of attack isn’t a walk in the park. You've got two main choices: one, grab enough computing power to outpace the entire network and create that longer chain, or two, with just a bit of hashing power, you can try your luck and mine two blocks back-to-back, then share it with the network. Honestly, both of these are pretty unlikely. But there's another route: you could incentivize miners to back your double spend, and that's the angle I’m diving into.
6 Reply Quote Share
sam_walletFull Member
Posts: 104 · Reputation: 365
#2Sep 30, 2017, 03:53 PM
If transaction X being moved from A to B is already in the longest chain and means it has gotten a least 1 confirmation, successfully mining the next two blocks doesn't invalidate that transaction. Transaction X will not appear in the next blocks, they just push it deeper into the chain. Unconfirmed transactions go into mempools not the blockchain. This is not feasible, from your analogy you are the one mining the blocks which double spend the transaction, this means there is no incentive for other miners. A one time ridiculous fee is not an incentive to build a chain with more PoW. All of these doesn't matter cause the initial transaction X was already confirmed. 51% attack does not allow you manipulate older transactions. That is centralization which is not how Bitcoin works.
4 Reply Quote Share
w0lf404Hero Member
Posts: 801 · Reputation: 2381
#3Oct 2, 2017, 04:08 PM
All nodes will reject the second transaction and it's very unlikely that mining pools receive that. Also, the cost to perform such an attack would be very high and even if you pay the cost, no mining pool will perform a 51% attack to include the second transaction in the blockchain. It's surely more profitable to be a honest mining pool. By the way, your topic has nothing to do with "Economics" boards and should be moved to "Development & Technical Discussion" board. I feel you didn't understand OP correctly. Let's say the transaction A has been included in the blockchain. A dishonest mining pool try to include transaction B (which spends the same input as transaction A) in a new chain that doesn't have the block contaning transaction A. If the dishonest mining pool manage to add more blocks to the new chain fast enough, so that it becomes the winning chain, the transaction A would be invalidated. In practice, it's very unlikely to perform such an attack successfuly. It does, if it's done successfully.
3 Reply Quote Share
diamond_atlasSenior Member
Posts: 408 · Reputation: 1359
#4Oct 2, 2017, 05:15 PM
It can be done but a deeper into the Bitcoin blockchain and Bitcoin block history, a harder it is to be manipulated successfully. It's very hard to do it successfully for transactions with 10+ confirmations or 100+ confirmations. How many Bitcoin confirmations is enough? Bitcoin confirmations. It does not credit information source to blog.lopp.net. The Bitcoin blockchain
1 Reply Quote Share
sage777Full Member
Posts: 102 · Reputation: 305
#5Oct 2, 2017, 09:38 PM
First, try to demonstrate it on testnet. For example, I successfully sent 9950 tBTC as a fee, and nobody reorged my block. I wonder, how big amount can be sent, without being reorged by another miner, but so far, it seems that miners are not running any kind of code, related to stealing coins in this way.
3 Reply Quote Share
hash_bossLegendary
Posts: 1166 · Reputation: 5261
#6Oct 3, 2017, 12:59 AM
Nodes which already receive and verify block which contain transaction X will reject transaction X'. That means you can't broadcast it to Bitcoin network, where you're forced to communicate with miner/pool directly and hope they agree to perform 51% attack.
4 Reply Quote Share
LuckyCoinLegendary
Posts: 832 · Reputation: 4795
#7Oct 3, 2017, 02:36 AM
I'm pretty sure OP is talking about double-spending after a block confirmation, because to double-spend a transaction while it is unconfirmed is trivial as long as you pay a higher fee. As for the case when you're trying to send a UTXO after it has already been confirmed, that only works when the same miner mines the next block too, and only if they are in on the scheme and patched their nodes accordindly. (Which never happens.)
1 Reply Quote Share
sage777Full Member
Posts: 102 · Reputation: 305
#8Oct 3, 2017, 06:20 AM
You only need "invalidateblock" to do that. But: invalidating a block, and mining two blocks in a row, is not that easy.
1 Reply Quote Share
LuckyCoinLegendary
Posts: 832 · Reputation: 4795
#9Oct 3, 2017, 07:56 AM
Oh and also - it would be much easier to convince a private miner to go along with this than trying to convince a public mining pool, because the moment anyone suspects that a replacement is going on, they are going to take their hash-power out and direct it to some other pool, so the probability of hitting two successive blocks goes down rapidly. Although the difference between the probabilities for each type of miner are like comparing the numbers 1e-10 and 0.00001.
1 Reply Quote Share
node_seedMember
Posts: 52 · Reputation: 196
#10Oct 3, 2017, 10:43 AM
For this to be worth the extremely high fee, the transacted amount must be very high. Nobody is going to accept that large amount with only 1 confirmation, for exactly the reason you described. Use a credit card if you want insurance against mistakes.
5 Reply Quote Share
paul2017Senior Member
Posts: 218 · Reputation: 1426
#11Oct 3, 2017, 02:18 PM
In short, your attack is easily defeated by waiting for multiple confirmations, but you already acknowledge that. But, the real point of your post is to claim that a double spend is still possible because a miner will be incentivized to reorg the blockchain if the replacement transaction pays a sufficient fee. I don't think there is any dispute about that, but something being possible is not the same as it being likely. Where your post falls short is the analysis. I would like to see an analysis so that I can know at what point it might become an issue. Also, I don't feel that a miner is "betraying the network" by reorging the chain to replace a transaction. Reorgs are expected to happen. That's why waiting for multiple confirmations is a common practice.
2 Reply Quote Share
node_seedMember
Posts: 52 · Reputation: 196
#12Oct 3, 2017, 08:03 PM
It is possible a miner tried to double spend your transaction, but couldn't create a longer chain fast enough.
4 Reply Quote Share
max_lynxSenior Member
Posts: 210 · Reputation: 1438
#13Oct 4, 2017, 12:46 AM
What I thought initially as, it’s said you can archive this double spending in events where you have to cancel a transaction after it already had been broadcast but, still awaiting confirmations. It’s even said, you can cancel a transaction with one confirmation using Blockchain.com which is yet I verified at my end. Why should a miner be in on this? Assisting a user of the network to double spend or perform a 51% attack. Wouldn’t that be putting the integrity of the very network you should be protecting in question and what becomes the case with the transparency of the Bitcoin blockchain?
2 Reply Quote Share
sage777Full Member
Posts: 102 · Reputation: 305
#14Oct 4, 2017, 06:13 AM
Possible, but unlikely. The block number is 33201. Which means, that if anyone would try to do this, then it could be possible to observe it in the chaintips. However, this is how it looks like: As you can see, between 33113 and 33415, nothing like that happened. If it would happened, nodes would see at least some block hash on that height. So, if anyone tried, then that miner could not produce even a single block, with difficulty one, on that block height.
2 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics