Skip to content

The problem of Double-Spending

The problem of Double-Spending

All electronic payment systems rely heavily on cryptography and, more specifically, on digital signatures, but unfortunately this does not solve the problem of Double-Spending.

Double-Spending is a type of digital fraud in which a user tries to spend the same amount twice, for example by sending the same payment to two different recipients at the same time. For a decentralized system, such as Bitcoin, it is even more difficult to solve because, unlike centralized systems, there is no entity, such as a bank, that guarantees the payments made.

The most immediate and effective solution is to consider as valid only the transaction that is verified first. The Block Chain is not only a simple list of transactions, but it is intended to solve the Double-Spending problem for a peer-to-peer network of potentially untrusted nodes.

The problem of coordinating a group of nodes with possible saboteurs is known as the Byzantine Generals Problem. The Block Chain solves the problem by using the computational power of the nodes as a voting system.

First, nodes group transactions into blocks that are connected together to form the Block Chain; then the blocks are transmitted to the entire network. As the figure below demonstrates, each block contains a hash of the previous block in the chain of which it is a part, which must already have been verified since, otherwise, the newly added block is rejected by the system.

This allows the chronological order of the blocks to be established and verified (through hash value verification), but since it is possible for anyone to add a new block, an attacker could try to create a new Block Chain that reassigns the various owners arbitrarily.

To prevent this problem, in other words to slow down block production, Bitcoin nodes require that a certain Proof-Of-Work must be resolved to add a new block to a chain.

This implies that to duplicate a chain, one would have to repeat the proof-of-concept for each block within it, requiring an excessive amount of computational power.

An attacker could also try to create a block that replaces the most recent block in a chain, causing two blocks to come from the same previous block; it can also happen because different nodes receive the new blocks at different times, depending on the delay introduced by the network: if this happens, each node chooses the block it received first and works trying to extend the chain from it. The Bitcoin system always chooses the longest chain, since the length defines the total computational difficulty, therefore: after a certain number of new blocks, the forking is eliminated.

In the figure the main blocks, in black, represent the branch accepted by the whole network, which is always the longest one. Orphan blocks, in grey, are ignored because they are not in the longest branch, but they will be inserted in subsequent blocks. Lastly, the first block of the chain, in green, is called genesis block.

Confirmations

In order to avoid the problem of Double-Spending, it is necessary to perform a process, transaction confirmation, so that when bitcoins are received by a user, they cannot be spent immediately.

The process of placing a transaction in a block is called transaction confirmation. A transaction can be called confirmed when it has 6 or more confirmations.

The basic Bitcoin client displays a transaction as “n/unconfirmed” until it has been entered in 6 successive blocks, but each user can set at his own discretion, and at his own risk, the number of confirmations required for the transactions he receives.

Since a block is produced about every 10 minutes, the amount of a transaction that requires 6 confirmations cannot be spent before one hour from the creation of the transaction.

This implies that, for example, a shopkeeper who accepts a payment in bitcoin cannot be sure that the customer is actually in possession of the amount spent before about an hour has passed.

Era Innovator

Era Innovator is a growing Technical Information Provider and a Web and App development company in India that offers clients ceaseless experience. Here you can find all the latest Tech related content which will help you in your daily needs.

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version