Every monetary system must develop an effective method of preventing double or multiple spending. Cryptocurrencies are no exception and have also faced this challenge.

Before the creation of the Bitcoin payment system, many scientists and engineers tried to create a decentralized means of payment, but they all relied on the impossibility of solving double spending in the system. The solution to this issue was developed after many years.

The problem of double spending related to cryptocurrencies

One of the most significant obstacles in the creation of a stable decentralized payment system was preventing the copying of payment transactions in order to avoid the risk of spending the same funds again. All centralized payment systems prevent re-transfers of funds due to the presence of a special monitoring server that verifies all transactions using a dedicated mathematical mechanism.

Double-spending is a type of re-spending previously used funds. Repeatedly, double-spending in decentralized financial systems occurs when a given sender sends the same amount of funds to several recipients in a short period of time, before the first transaction is blocked.

Let’s explain it with the following example. Let’s assume that in real life a person decided to buy a cup of tea for $1 at a restaurant. When paying, the money is transferred to the restaurant’s cash register and cannot be used again. A characteristic of cryptocurrencies is that they are not physically transferred during the transaction. So until the transaction is verified and then executed, the funds remain in the sender’s wallet. This means that in theory it is possible that between the sending of the transaction and the fact of its completion after verification, it is possible to pay again using the same units of a given cryptocurrency.

In real life, it’s possible to double spend. A good example to illustrate this state of affairs is when real estate agents would sell the same property multiple times. This possibility arises due to the fact that the subsequent registration of the owner who purchased the property often takes a long time. Therefore, until the title of ownership is registered for the buyer, the property formally remains in the possession of the person who was the previous owner.

How to prevent the problem of double spending

Blockchain technology, which is the structural basis of all cryptocurrencies, includes two mechanisms to prevent double spending:

  1. open transaction register;
  2. special verification mechanism.

Blockchain as a distributed database keeps a continuous chronological record of all payment registrations. Each new block contains detailed information about all previous transactions, starting from the creation of the given blockchain. Each single transaction is assigned an operation time. This solution works great to determine which of the transactions is the main one and which was simply copied.

For example, you can imagine that the sender wants to double spend funds with 5 BTC in the account. In the first step, the sender sends these coins to the first merchant and, taking the opportunity that the funds sent by him have not yet been collected, he tries to defraud the second merchant by sending them the exact same coins again.

Blockchain as a cryptocurrency settlement base works in such a way that both transactions described above are converted into a pool of unconfirmed transactions. Then such transactions are checked, but only the first one will be successfully executed. The second transaction will be considered fraudulent by the system. This is because it will not collect the required number of confirmations.

Taking this into account, the seller will send the goods only when he receives confirmation from the network, and not because the buyer has sent a confirmation of payment. It is customary in the Bitcoin network that transactions with 6 confirmations are considered safe from the risk of double spending.

Closing thoughts

In theory, double-spending cryptocurrencies is possible if the transaction is confirmed and the funds still remain in the sender’s account. Nevertheless, the creation and effective functioning of decentralized payment systems is possible due to the fact that only transactions with a greater number of confirmations from the network are recorded in blocks. In turn, the second and subsequent branches with repeated spends of the same coins are classified as invalid and consequently rejected.

However, this does not change the fact that cryptocurrency systems based on blockchain technology still remain a good opportunity to use the double-spending phenomenon, although such activities require exceptionally high power.