Any discussion of Blockchain is incomplete without discussing about double-spend attack mainly with cryptocurrencies. Double-spending happens when the same cryptocurrency coin is spent for two or more transaction at once. This type of attack requires a tremendous computational power and it is very likely to fail. However if successful, it may be profitable.
Assuming it is not a counterfeit paper note, in real world, same paper note can not be in two places at once. For example, Jimmy a rich millionaire visits his favorite local coffee shop to buy a $5 cup of coffee. In purchasing his coffee, Jimmy hands over the paper note to the shop owner. The owner, in accepting Jimmy’s $5 bill, can instantly confirm that Jimmy has paid the correct amount for the coffee. Jimmy therefore can not now spend that same $5 note elsewhere to make another purchase.
In case of digital transactions, they have to go through central authority (such as banks) to clear the electronic transfers. This is how in real world double-spend issue is easily addressed.
In digital currencies, however there is no actual physical relinquishing of a currency which creates the double-spending problem. Following is an example of double-spend attack in a digital currency called Richa Coin. The attack is split into four stages which are described below.
Stage 1 – Current
Stage 2 – Transfer
Jimmy agrees to sell the painting to Tom for 100 Richa Coins and Tom transfers 100 Richa Coins to Jimmy.
Meantime Tom creates an offspring of the Blockchain from Block 53 and transfers 100 Richa coins to a different account that he owns. This offspring does not broadcast the solution of his blocks to the rest of the Blockchain networks.
Stage 3 – Longest Chain
Jimmy on seeing transaction confirmation, ships the painting to Tom. While in the background, Tom on his private Blockchain succeeds in generating a longer Blockchain with reverse transaction back to him.
Stage 4 – Publish
Once Tom has the longest chain, he connects to the Blockchain network and publishes his blocks. All the nodes in the network agree on considering them as the valid ones because the offspring Blockchain is longer than the current valid Blockchain.
The offspring Blockchain now becomes the valid Blockchain and thereby reversing the transfer of 100 Richa Coins made to Jimmy. In the end Tom still has the 100 Richa Coins and the painting where as Jimmy has neither. This is an example of double-spend attack.
I hope this post now gives you an idea of how double-spent attack is executed and what is involved.