Double Spending in Blockchain

2022-04-08, 04:22


Double spending is a fraudulent activity whereby a digital currency is expended more than once.

There are three types of double-spending.

The race attack is the first type of double-spending whereby you make two transactions simultaneously. However, just one of the two transactions is genuine.

The Finney attack occurs when miners pre-mine transactions into a block from one wallet to another.

The 51% attack is quite popular, and it occurs when the digital currency platform holds and controls more than 50% of the network's hashing power.

The preventive measures that you can take as an investor or trader to prevent double-spending attacks are to avoid unconfirmed transactions and always use blockchain technology.

As the name implies, double spending involves using a single transaction detail or amount for multiple transactions.

It is, however, necessary to explain in detail the definition of double spending and the various ways in which the attack can be executed.


What is Double-spending?



Double spending is a digital flaw that enables a single digital asset for multiple transactions, i.e., it is used more than once.

With physical currency, double spending is not possible. You can not give a single currency note to two people unless you tell them to split it among themselves. Therefore, it is only peculiar to digital currencies online.

In recent times, the best way to prevent double-spending is the use of the blockchain. When you use blockchain technology for your transaction, it creates a ledger for all transactions.

The blockchain creates a public ledger that records both complete and incomplete transactions. The entire transaction is recorded as "confirmed," while in the situation where the sender has sent the token but the recipient has not received it, the blockchain will record it as "unconfirmed."

The recipient's blockchain wallet will automatically verify the confirmed transaction. With this feature, it is hard for the sender to copy or duplicate the transaction details and use them to dupe another person.

Also, if the blockchain wallet of the first recipient does not certify it as an actual transaction, you do not get notified of an exchange.

Double spending could be done in various ways or methods, they include;


Types of Double-spending



Double spending a cryptocurrency involves a lot of processes and requires some level of expertise. Some ways in which double spending occur include the following;

Race attack
A race attack is an intentional duping whereby you make two transactions simultaneously. However, just one of the two transactions is genuine.

In a race attack, one of the two transactions will show "confirmed," while the other transaction, mainly the second one, will show unconfirmed. So the recipient will get deceived since the first one is confirmed.

Sometimes, the race attack will have two simultaneous transactions sent to the recipient, and before the second one gets confirmed, the hacker or swindler will invalidate it using the block they had created for such an act.

One instance of a race attack was in a viral video in 2019. The digital currency fraudsters used an upgrade protocol called Replace-By-Fee (RBF).

The first transaction was sent to the merchant; another was sent simultaneously with a higher fee attached. The second transaction that used the RBF protocol overrode the first transaction as it had a higher price. Before the first one would eventually be registered on the blockchain, the senders reversed it to their wallets.

Finney attack
A Finney attack is quite complex and can only be done by miners. The Finney attack goes through a sequence that the miners have planned before the transaction.

It is on record that only the individual who discovered this double-spending trick has used it. His name is Hal Finney, and the attack was named after him.

What the miners do is to pre-mine a transaction into a block from one wallet to another.

Afterward, the miner or a collaborator will use the first wallet to make a second transaction and broadcast the pre-mined block, including the first transaction.

The Finney attack is like diverting a digital currency to a block you created (earlier) on its way to another wallet.

The 51% attack
The 51% attack is due to the hashing percentage of the holder or controller of the digital currency. It occurs when the digital currency platform holds and controls more than 50% of the network’s hashing power.

51% attack is difficult and expensive to run. If a transaction is presumed to occur and you want to attack it using this trick, you need to have more than the cost of the trade you want to attack.

To profit from a 51% attack, you must target large transactions and blockchain wallets with significant holdings.

There is a general belief that bitcoin is immune to the hashing attack because the currency itself controls more than 50% of the hashing power. However, other digital currencies with less hashing power are prone to this kind of attack.

For instance, in 2019, it was recorded that Ethereum Classic was 51% attacked, and in 2018/2020, bitcoin Gold was 51% attacked, which made it a two-time attack on bitcoin Gold.

Even though these attacks rarely happen, it is pertinent to know ways to prevent the attack should hackers be trying to find their way through your transactions.


How To Prevent Double-spending Attacks



Those who execute double-spending acts are not easy to recognize; you need to have your preventive measures to keep your transaction secured at every time. The preventive measures include;

Avoid unconfirmed transactions
The best way to stay safe from double-spending is to avoid unconfirmed transactions. If a buyer or exchanger sends you a digital currency, do not proceed with the transaction until your blockchain network shows that the transaction is confirmed.

If it is multiple transactions, ensure all the transactions show "confirmed" on your blockchain wallet. Do not be in a hurry or trust any partner until the token reflects on your wallet.

Always use blockchain technology
Since double-spending requires the creation of a new block to divert the transaction, you are on the safer side if you use blockchain technology.

Before a transaction is completed on the blockchain, the network of miners will have to accept and verify such transactions. It is, therefore, challenging and mostly impossible to insert a secret block into a blockchain.


Conclusion



All double-spending attacks require a lot of effort and arrangement. Even though the attacks have been successful in a few instances, there is a high probability that the hackers have tried several times, and they will continue to devise different ways.

To stay ahead of these attacks, you should take the advice highlighted above, keep your digital currency in a trusted wallet and avoid shady exchange technologies.



Author: Valentine A.,Gate.io Researcher
This article represents only the researcher's views 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.
Поділіться
gate logo
Credit Ranking
Complete Gate Post tasks to upgrade your rank