Blockchain Double Spending




  • Double spending means spending an equivalent money twice. Any transaction is often processed only in two ways. One is offline, and another is online.
    • Offline : A transaction which involves physical currency or cash is known as an offline transaction.
    • Online : A transaction which involves digital cash is known as an online transaction.

Example

  • You attend Restaurants and order a cappuccino worth $5. You pay in cash. The service provider at Restaurants instantly confirmed that you simply have paid, and you received your coffee in exchange for the cash. It possible to spend the same $5 elsewhere to form another purchase ? The solution is no. what if the solution is YES ? It means the same person can use the same cash more than one times. This sort of problem is known as Double Spending Problem.
 Blockchain Double Spending

Blockchain Double Spending

  • In a physical currency, the double-spending problem can never arise. But in digital cash-like bitcoin, the double-spending problem can arise. Bitcoin transactions have an opportunity of being copied and rebroadcasted. It exposes the possibility that the same BTC might be spent twice by its owner.

How Bitcoin handles the Double Spending Problem ?

  • Bitcoin handles the double-spending problem by implementing a confirmation mechanism and maintaining a universal ledger is named as blockchain.
  • Let us suppose you've got 1 BTC and check out to spend it twice. You made the 1 BTC transaction to Receiver 1.
  • You sign and send the same 1 BTC transaction to Receiver 2. Both transactions enter the pool of unconfirmed transactions where many unconfirmed transactions are stored already.
  • The unconfirmed transactions are transactions which don't pick by anyone. Now, whichever transaction first got confirmations and was verified by miners, are going to be valid.
  • Another transaction which couldn't get enough confirmations are going to be pulled out from the network. In this example, transaction T1 is valid, and Receiver 1 will receive the bitcoin.
 Bitcoin handles Double Spending

Bitcoin handles Double Spending Problem

What happened if both the transactions are taken simultaneously by the miners ?

  • Suppose two different miners will pick both transactions at the same time and start creating a block.
  • When the block is confirmed, both Receiver 1 and Receiver 2 will await confirmation on their transaction.
  • Whichever transaction first got confirmations are going to be validated first, and another transaction are going to be pulled out from the network.
  • Suppose if both Receiver 1 and Receiver 2 received the primary confirmation at the same time, then there's a race are going to be started between Receiver 1 and Receiver 2.
  • Whichever transaction gets the maximum number of confirmations from the network will be included within the blockchain, and therefore the other one will be discarded.


Related Searches to Blockchain Double Spending