Working Strategies that Prevent Double-spending

2022-07-07, 02:07


Double spending only occurs with digital currency not physical money.

Blockchains can use either decentralization or centralization to control double-spending.

51% attack, Race attack and Finney attack are types of double-spending.

To reduce the possibility of double spending users should accept transactions with at least three confirmations.

The nature of digital currencies such as cryptocurrencies and the way they are transferred give room to a problem called double-spending. What creates this problem is the lag in transaction finality because the system should confirm the payments. When you transfer the cryptocurrency it takes some seconds or minutes before it is finalized or confirmed. This is different from the way we make payments using notes and coins. With banknotes and coins the payment is confirmed when you hand over the money to another person. In this article we will discuss the problem of double-spending and how to prevent it.


Double-spending



Double spending means making two payments using the same token. The problem of double spending does not occur when using physical cash. This is because you cannot give two people the same $100 note. With most online payments a third party ensures that the payment goes to the intended payee. On the other hand, payment processors and other traditional financial institutions verify the transactions themselves.

However, the above scenario is different when making payments using cryptocurrencies and other digital assets that exist on the blockchain. The reason is that when transferring digital currencies only two parties are involved, the payer and the payee. This is where the danger of double-spending comes in.

In other words, double spending takes place when someone disturbs the blockchain with the aim of stealing the cryptocurrency or any digital assets used as a means of payment. The person who steals the cryptocurrency will then send a proof of transaction to make the payment look genuine. In some cases, the person responsible for the double-spending may delete the transaction altogether. The main perpetrators of such a problem are blockchain developers and other crypto experts.

An example of double spending is when user A sends $50 worth of a token to B before sending the same tokens to C. At the end of the day, it is difficult to conclude if user A has cheated B or C.


Types of double spending



There are three ways in which people can execute a double spending of cryptocurrencies. The methods are 51% attack, Race attack and Finney attack.

51% Attack

To carry out a 51% attack, the attacker should first control more than 50% of the network’s hash power which is required to validate transactions and blocks. This way, he/she can manipulate the situation to send the tokens to two individuals. However, this only takes place when the blockchain system in question has no other proper security systems.



Race attack

This method only works if the trader accepts a transaction with zero confirmation. As such, the attacker can send the same tokens to another person. For example, if a trader makes a dual transaction where A accepts the transaction which is not confirmed and B waits for confirmation, in the end the transaction to B will be confirmed whereas A will receive double spend coins. Therefore, for the intended receivers to get their cryptocurrencies, they should only accept transactions which are confirmed by at least three validators.

Finney attack

This type of an attack is engineered by a miner who generates several blocks without transmitting them to the network. In this case, the miner makes dual payments using the same tokens. When the dealer checks the transaction he/she delivers the goods or services to the payer. The trader will only transmit the transaction to the network after receiving the goods. As a result, all other transactions are confirmed except for that of the dealer. To avoid this type of an attack the payee should not accept an unconfirmed transaction.

How blockchains should prevent problem of double-spending

It is important to note that if the users experience cases of double spending, they will lose trust in the blockchain. Therefore, the blockchain should ensure that it has a proper security system to counter the possibility of double-spending. Blockchains can prevent the problem of double spending through either centralization or decentralization.

Source: Zipmex


Centralization

In this case, a blockchain can use a trusted third party to validate all transactions. Although this is a sure method to prevent double-spending, centralization has its own disadvantages. In most cases this method is very expensive. This is because the blockchain will have to pay for the cost of transferring the cryptocurrencies as well as validating them.

Decentralization

The main means of preventing double-spending using decentralization is through quick validation of the first transaction. By this, the duplicated transaction becomes invalid as soon as possible. To make this system efficient it is essential to have a consensus algorithm which syncs the various servers that store the related data. For example, the proof-of-stake and the proof-of- work consensus systems help in syncing the transaction data on time, thus preventing double spending.


A case of bitcoin

The bitcoin blockchain has adequate security measures to prevent double spending. If the bitcoin network works as expected and the users wait for all transactions to be confirmed, double spending will not take place. The protocol verifies transactions through the confirmation mechanism.

Source: Wealthand


When a trader sends the same coins to different addresses, they are stored in a network of unvalidated transactions. If the transaction gets through at the same time the one with the most number of confirmations is verified and the other rejected. As a safety measure, one should wait for at least six confirmations to accept transactions.


Avoiding double spending



A question some people may have is how they can control double spending. Although the greatest onus of controlling double spending is with the blockchains, an individual can play his/her part. You should not accept transactions which are not confirmed. You can also take more time before accepting any transactions. This helps to reduce chances of double spending.

As a standard it is recommended that you wait for at least three confirmations for a transaction. In addition, you can take at least 10 minutes before accepting a transaction. These measures should help to reduce the cases of double spending.


Conclusion



The problem of manipulating money is common in many places around the world. Regarding physical money, people can create counterfeit notes. Nevertheless, with cryptocurrencies people can double-spend them. In the end, one of the expected recipients will lose as he/she will not receive the said tokens. One of the means to avoid double spending is to wait for a transaction to have at least 3 confirmations.





Author: Mashell C., Gate.io Researcher
This article represents only the views of the researcher and does not constitute any investment suggestions.
Gate.io reserves all rights to this article. Reposting of the article will be permitted provided Gate.io is referenced. In all cases, legal action will be taken due to copyright infringement.
Share
gate logo
Credit Ranking
Complete Gate Post tasks to upgrade your rank