There are only two ways to process any transaction –
Online - A transaction that uses virtual/digital currency is referred to as an online transaction.
Offline: A transaction that uses actual cash or money is referred to as an offline transaction.
Spending money more than once results in double spending. The double spending issue is never possible with physical currency. However, double spending can occur with digital currency like bitcoin.
To understand the double-spending problem, let’s take a small example
You visit a restaurant and order a pot of coffee worth $5 and you pay with cash. When you pay for your coffee in a restaurant, the cashier immediately acknowledges your payment and gives you your coffee. It is now impossible to use the same $5 elsewhere to make a different transaction. But what if you can spend that $5 again to make another purchase? It indicates that a single individual can utilize the same funds several times. The term “double spending problem” refers to this sort of issue.
Digital money is far different from physical money.
When you use digital money to make a transaction, the transaction is broadcast to all of the nodes within the network.
Nodes must wait for the transaction to be received and confirmed, which takes time.
Consequently, this is a problem:
What prevents someone from duplicating a transaction and retransmitting it before the confirmation of the transaction from the network?
The network would not be able to tell which transaction was authentic.
Digital currency circulated on the internet before bitcoin was created. Banks and other financial organizations were in charge of overseeing and regulating it all, as they still do for the most part today.
Banks serving as mediators in banking conflicts have the drawback that transactions can be undone if a conflict arises.
This results in increased costs and extended transaction delays. By developing a system that is fully reliant on cryptographic evidence rather than trust, Bitcoin attempts to address these constraints. In essence, it provides a mechanism to do financial business devoid of banks.
It’s crucial to comprehend what a bitcoin is in order to begin comprehending how this method of cryptographic evidence functions.
A sequence of digital signatures is how a bitcoin is described in the bitcoin white paper.
It may be transferred between owners via digital wallets. Both a private key (a password that only the owner knows) and a public key (an address) is stored in each wallet.
When a bitcoin owner transfers a coin to another, they sign the public key of the new owner and a hash of the prior transaction.
The bitcoin is then completed by appending this hash. As a result, each bitcoin is similar to a car’s logbook in that it contains a list of all prior owners.
Bitcoin uses a global ledger known as a blockchain to address the double-spending issue.
The blockchain offers a mechanism for all nodes to be knowledgeable of every transaction, demonstrating that no efforts to double spend have been made.
All bitcoin transactions are formally broadcast to every node. The sequence in which they were acquired can then be agreed upon as a unified history.
Double spending efforts made after that point are ineffective in bitcoin since most nodes will concur on which transaction was the first to be received.
A timestamp server was suggested as a solution to the double spending issue in Satoshi Nakamoto’s white paper. A block of transactions is hashed by this server, which then broadcasts the hash to every node in the bitcoin network. This timestamp demonstrates that none of the information in the hash could have been produced following the publication of the hash. This creates an immutable (unchangeable) log of the sequence in which transactions occurred since each timestamp contains the preceding timestamp in its hash. Each timestamp builds on the ones that came before it.
You must be aware that since the first bitcoin client was delivered in 2009, the blockchain of bitcoin has preserved an exhaustive record of all transactions ever done in order to properly comprehend how the blockchain avoids double spending. You cannot just alter the record since every transaction is cryptographically hashed to the preceding blocks. This database is referred to as a blockchain because a fresh batch of transactions, known as a block, is added to it every ten minutes.
When a group of miners controls over 50% of the network’s hash rate, they launch a 51% attack against a cryptocurrency blockchain. Having control of 51% of the network’s nodes provides the governing parties with the ability to change the blockchain.
Payments between a few or all users might be stopped if the attackers were able to stop fresh transactions from receiving confirmations. The ability to undo decisions taken when they were in charge would likewise be available to them. One of the problems that consensus systems like proof-of-work were designed to avoid is that by reversing transactions, users might double spend coins.
On a coin with a high participation rate, a 51% assault is an extremely demanding and difficult undertaking. The majority of the time, the group of attackers would have to be able to command the required 51% and have a backup blockchain ready to be injected when the opportunity arises. The main network would then have to be out-hashed. One of the biggest obstacles against a 51% attack is the expense of doing so.
For instance, the Bitmain S19 XP Hydro is the most sophisticated Application Specific Integrated Circuit (ASIC) miner. It boasts 255 TH/s (tera hashes per second) of hash rate and costs more than $19,800.
FoundryUSA, with 54.42 EH/s (exahashes per second), accounts for 23.75% of the entire Bitcoin network hash rate, followed by AntPool at 41.49 EH/s, 18.12%, and Binance Pool at 34.48 EH/s, 15.06%.
The above data as per by July 2020 is of 51% attack on Ethereum Blockchain.
In conclusion, the blockchain stops double spending by broadcasting groups of transactions to all nodes in the bitcoin network and timestamping them. Transactions are irreversible and hard to tamper with since they are timestamped on the blockchain and quantitatively tied to earlier ones.