What is double-spending?

What is double-spending?

13.02.2023
Author: Robert Strickland
Subscribe

What is double-spending?

What is double-spending?
If you go deeper into history, it becomes clear that before bitcoin, some enthusiasts already tried to create digital currencies, but all their attempts crashed against the impregnable rocks of double spending, which had a very negative impact on the entire digital economy. So what is double spending and what does it mean in the cryptocurrency segment?

  • DOUBLE SPENDING: DEFINITION

Double spending is the phenomenon when a user makes repeated and sometimes even multiple spending/selling of the same funds. From a real-world perspective, such a thing is impossible. This is due to the fact that we use physical money.


In digital currencies it is somewhat different - their money does not have a physical embodiment but is a software product. Yes, bitcoin and other cryptocurrencies have already grown to the point where double spending is almost impossible, but there are still some risks.

  • HOW DO I PREVENT DOUBLE SPENDING IN CRYPTOCURRENCIES?

In fact, any cryptocurrency has two mechanisms to prevent double-spending:

Confirmation of transactions by miners.

Open blockchain.
To understand how this works, we'll also break down a small example. Suppose you have 1 BTC, you send it at 19:00 to the first seller and at 19:01 to the second seller to cheat him. Both transactions hit the mempool where they are waiting for confirmation. Only one transaction can be confirmed. Due to the fact that all blocks in the blockchain are linked, it is not difficult for nodes to identify coins already spent. In addition, the first transaction will be validated sooner and the money will be deducted from your account.

And what if transactions are accepted for verification at the same time? One of them will not pass through anyway, because one of them will be rejected by the miners. In this case, the confirmed transaction will be in the longest chain, and the unconfirmed transaction will be in the shortest chain.

  • HOW TO DO DOUBLE-SPENDING?

Despite the fact that double spending is considered practically impossible, there are several theoretical situations where such a situation takes place. First, there is the so-called 51% attack, when someone takes over most of the total computing power in the network. Then this monopolist can dictate its rules, missing double-spending.

Race attack, or race attack, is not tricking the network, but tricking the merchant or other user you are sending payment to. You quickly create two transactions, such as one to your address, where the money will eventually go, and the other to the merchant's address. In doing so, you provide him with a link to the explorer where the transaction is hanging as a confirmation. That way, he will see that the transaction is already in progress. But it will never reach the final destination and will remain in the fraudster's second account.

  • HOW DO I PROTECT MYSELF AGAINST DOUBLE-SPENDING?

If you accept payment from someone, do not believe screenshots, references to explorers, etc. It's better to wait until the money arrives in your account. Yes, it may take longer, but you will be sure that you will not be cheated. Ideally, you should wait for a couple more blocks to be added after the transaction. This procedure will take 20-25 minutes.

If a transaction was created but the money did not arrive in your account, then you know - it was a double waste and you were simply cheated.

 

Other instructions

Cold and hot cryptocurrency wallets. What is the difference and how to create them?
Securing Information: Shamir's Secret Sharing Scheme and Bitcoin
"Reputation Institute. What will happen to blockchain in 30 years
What is Worldcoin? Why the creator of ChatGPT needs a catalog of all the inhabitants of the planet
Measure blockchain. How important is the TVL indicator
What is Lightning Network and how the project solves bitcoin's main problem