What is double spending on the blockchain and how does it happen

()

What is double waste and how does it happen

If you delve into the history of the creation of cryptocurrencies, you can find that even before the advent of Bitcoin, many enthusiasts tried to create a decentralized means of payment, but all of them rested on the inability to prevent double spending within the system. The solution to this problem was found only years later.

The main problem in creating a stable system of decentralized payments was the ability to copy payment transactions, which causes the risk of re-spending funds. Centralized payment systems prevent the resending of funds by the presence of a monitoring server that checks all transactions using a specific mechanism.

Double spending or double spending. Often double spending in decentralized systems occurs at the moment when one sender sends the same amount of funds to several recipients in the time interval before the first transaction is included in the block.

Let’s say in real life a person decided to buy a cup of coffee for $ 1 in one of the cafes. When paying, the money is transferred to the cash desk of the institution and it is impossible to spend it again. Digital currencies are distinguished by the fact that they are not physically transferred, therefore, before the transaction is verified and executed, the funds remain in the wallet, which means that in the interval between sending the transaction and the fact of its completion after verification, a re-payment is possible.

In real life, there may also be a double waste. For example, unscrupulous realtors can repeatedly sell one property and this opportunity is created due to the fact that re-registration for a new owner can take a lot of time, but until the right of ownership is registered to the buyer, the property remains in the possession of the previous owner.

Why is double spending dangerous

A double waste of funds causes material damage to the seller who sent the goods and did not receive the funds. It discredits cryptocurrencies as a means of payment and prevents widespread distribution. Also, the problem of double spending leads to a decrease in the value of a digital asset, as investors lose confidence in the security of the system.

Attack types

Race

If the seller cooperates on payments that have zero confirmations, it can become a victim of a Race attack when two transactions are created for the same amount and sent to different stores. Thus, only one of the recipients will actually receive the funds. Coins will be transferred on the first transaction, which will be added to the blockchain.

Attack finney

Services that accept payments with zero confirmations are also at risk for this attack, only with such an attack it will also require the complicity of the miner to send the copied transaction to the block.

Finney’s attack is a false double waste, the essence of which is that the miner sends a re-transaction after his first payment goes to the network for verification, and in this case a fork is created in which only one transaction will be accepted by the collective decision of the miners. At the same time, the seller, having waited for the first transaction to appear, has already sold the goods.

Vector76 attack

This is a combined attack consisting of the two attacks described above. Vector76 is based on intentional branching of transaction blocks and allows you to spend twice with one confirmation. Here the fact is used that when phased inclusion of different transactions in blocks, part of the network will see transactions as valid, and the other part as invalid. The attack lasts only 10 minutes and during this time the attacker can manage to get services or cash out funds for two transactions.

Brute force attack

This attack is feasible even if the seller sends the goods only after receiving several confirmations, but for its implementation, high power of the attacker’s equipment is needed. Its essence lies in the fact that the attacker sends a transaction to pay for goods while continuing to check the blocks of transactions in which he will be included.

After the store receives the required number of confirmations, it ships the goods, and the attacker branches the chain by this moment if he finds more confirmations and receives funds back. If it was not possible to collect more confirmations for another transaction, the attack will not take place and the funds will be transferred to the recipient’s account.

The success of this attack depends on the power of the fraudster and the number of requested confirmations. For example, if the attacker’s power is 10% of the total network capacity, and the recipient is waiting for 6 confirmations, then the attack success rate is 0.01%.

Attack 51%

If the attacker holds most of the network’s power, then double-spending of coins is possible according to the scheme described above, only with a 100% guarantee of success. An attacker is able to generate blocks faster than the rest of the network and create their own block chains for dishonest transactions longer than the correct ones.

How to make a double waste

Information in the blockchain registry is open to all. Everyone can copy digital coins and try to pay them twice. Miners can only check the availability of funds in the sender’s account at a specific time period, therefore, if you take advantage of the moment, then the same coins can be sent twice until the funds are debited from the previous transaction.

In insecure systems, a double waste of sending repeated transactions in the time interval until the previous transaction has not yet been confirmed. In this case, the recipient will receive the coins whose transaction was first included in the block.

For more secure systems, the attacker will also need to have sufficiently large capacities to find more confirmation for the wrong transaction and to return their funds back after the first transaction is rejected.

How to prevent double spending

At present, payment systems operating on the blockchain have two systems for preventing double spending:

  • Open transaction registry;
  • Special verification mechanism.

Blockchain keeps a chronological registration of all payment registrations and each new block contains information about all previous transactions, starting from the moment of its foundation. All transactions are assigned the time of the transaction and this helps to find out which of the transactions is the main and which is copied.

For example, the sender wants to make a double waste of funds, having 1 MTC on the account. He sends this coin to the first seller and taking advantage of the fact that the funds have not yet been debited, he wants to deceive the second seller and sends him the same coin again.

Both transactions are transferred to the pool of unconfirmed transactions and are checked, while only the first transaction will be executed and the second transaction will be considered false, because it will not collect the required number of confirmations.

Therefore, the seller, in order not to be deceived, needs to send goods only after receiving confirmation from the network, and not the fact of sending the payment from the buyer. Transactions with 6 confirmations are considered safe before double spending.

Conclusions

Double spending of digital coins is possible due to the fact that until the transaction is confirmed the funds remain in the account of the sender. At the same time, the creation of decentralized payment systems became possible due to the fact that only transactions with more confirmations are recorded in the blocks, and the second branch with repeated spending is recognized as incorrect and rejected.

Nevertheless, the blockchain remains an opportunity to make a double waste, but this requires quite high power. Without them, the seller can be deceived only if he sends the goods on payments with 0 confirmations.

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

Leave a Reply

Your email address will not be published. Required fields are marked *