How Does Blockchain Bitcoin Protect Itself Against The Double-Spending Problem?
Discover how Bitcoin manages this critical problem.
Published in 2008, the Bitcoin white paper revealed to the world the first fully functional P2P cash exchange system. The father of Bitcoin, the mysterious Satoshi Nakamoto, then released the first Bitcoin client on SourceForge in 2009 which officially gave birth to Bitcoin. A new exceptional adventure had just started.
At the heart of the phenomenal success of Bitcoin lies the resolution of the double-spending problem that had caused the loss of all other attempts to create digital currencies previously. In this article, I will return to what is the double-spending problem and I will show how the Blockchain Bitcoin solves it to be secure for all its users.
Before Bitcoin, There Was Bit Gold
Bitcoin is not the first attempt to create a functional digital money system. In 1998, Nick Szabo, a pioneer in the world of digital currencies, proposed Bit Gold before presenting his ideas in a blog article in 2005. With a little perspective, it is quite possible to imagine that Nick Szabo could have developed Bitcoin from the Bit Gold as a starting point.
However, a 2008 article on his blog about Bitcoin reveals that his views on the iconic cryptocurrency differ from those of Satoshi Nakamoto, the anonymous creator of Bitcoin. A crucial point in Nick Szabo’s writings concerns his approach to Bitcoin.
For Nick Szabo, Bitcoin is above all a store of value and not a medium of exchange.
One of the reasons for the failure of previous attempts to create digital currencies is that, like Bit Gold, it could not solve the double-spending problem.
What Is Double-Spending Problem?
First of all, it seems important to define what double-spending is. As the term strongly suggests, double-spending means spending the same currency twice. With fiat currencies physically represented as coins and banknotes, this is simply not possible and the problem does not even arise.
Consider the following example:
You will shop at Walmart and buy for $30 of goods. You pay in cash with a $20 and a $10 note. Once these notes are crated, you can no longer spend them again unless you physically steal them.
Why Is Double-Spending A Problem For Digital Currencies?
Digital currencies are different from cash. When you make a transaction with a digital currency, you will broadcast the transaction to all nodes on the network. Nodes are the computers running the software on which the cryptocurrency in question is supported. These nodes need to receive and then confirm the transaction. All this takes time. The problem is therefore as follows:
What can prevent someone from copying the transaction and resending it on the network before the previous one has been confirmed on the network?
How can the network know which of these transactions is authentic?
Bitcoin Has No Central Bank To Arbitrate Disputes
Before the invention of Bitcoin, digital currency exchanges over the Internet were monitored and controlled by banks and financial institutions. The problem with banks acting as mediators in financial disputes is that transactions can be canceled. All this leads to higher transaction fees and longer validation times.
Bitcoin has set itself the goal of solving these limitations by creating a system based entirely on cryptographic evidence instead of trust in the intermediary. In this sense, Bitcoin has made it possible to carry out bank type exchanges without the need for banks.
Each Bitcoin Allows To Trace The Chain Of Its Owners
In order to begin to understand how the cryptographic evidence system works, it is essential to understand what a Bitcoin is.
In the Bitcoin White Paper, a Bitcoin is defined as a chain of digital signatures.
It can be switched from one owner to another via digital portfolios. Each portfolio has a public key, also known as an address, and a private key, which is a confidential password that must be known only to the owner.
When the owner of a Bitcoin decides to transfer it to someone else, the corresponding transaction will take as a signature the hash of the previous transactions as well as the public key of the next owner. This hash is then added at the end of the Bitcoin. Therefore, each Bitcoin is the equivalent of a car’s logbook containing a record of all previous owners.
Explanation Of Cryptographic Hash Functions
A cryptographic hash function is a mathematical algorithm that accepts as input a character string containing data and returns as output a character string whose size has been arbitrarily set. This is a one-way function, which means that the same parameter set several times at the input will return the same output. In addition, it is not possible to reverse engineer the input.
More importantly, it is impossible for two different inputs to produce the same output value. In fact, each output produced by the cryptographic hash function will be unique. Each time a Bitcoin is transferred, a new hash is added. The owner chain of each Bitcoin can thus be verified simply by looking at the signatures embedded in the Bitcoin.
All this is particularly interesting but does not solve the double-spending problem. A beneficiary cannot verify that one of the former owners of a Bitcoin has not spent this Bitcoin twice. One solution could have been to have a central bank that would allow each transaction to be verified to prevent the problem of double-spending.
However, then we would have lost the decentralized side that is at the very origin of the creation of Bitcoin. Indeed, Bitcoin was designed to solve the problems posed by central banks during bank exchanges. What is the point of replacing one central bank with another?
The Bitcoin Blockchain Is A Universal General Ledger
In order to manage the double-spending problem, Bitcoin relies on a universal general ledger more commonly known as a Blockchain. In order to prove that there have been no double-spending attempts, the Blockchain allows all nodes to be aware of each transaction made.
With Bitcoin, all transactions are therefore publicly announced to all network nodes. The latter can then agree on a single history of the order in which they were received.
Bitcoin therefore avoids the double-spending problem by taking into account transactions for which the majority of network nodes have agreed to arrive first.
Attempts that occur later and therefore attempt a double expense are not considered.
Explanation On The Bitcoin Timestamp Server
Satoshi Nakamoto proposed in his white paper on Bitcoin the use of a timestamp server as a solution to protect against the double-spending problem.
This Bitcoin Timestamp Serve rtakes the hash of a block of transactions and then distributes it to all nodes of the Bitcoin Blockchain.
This timestamp associated with the hash will prove that not all the data contained in the hash could be created after the hash was published.
Since each timestamp includes the timestamp of the previous block in its hash, this provides an unchangeable record of the order in which each transaction took place. The timestamps will, therefore, strengthen each other.
There Is A Public Record Of All Bitcoin Transactions Performed Since Its Creation
To fully understand how the Blockchain Bitcoin protects itself from the double-spending problem, it is worth recalling that it maintains a complete history of all transactions carried out since the first Bitcoins were sent by Satoshi Nakamoto in 2009.
Since each block of transactions of the Bitcoin Blockchain is linked to the previous one via the cryptographic hash created, it is impossible to modify past records.
The recorded history is better known as Blockchain and a new group of transactions, grouped into a block, is added every 10 minutes.
The Bitcoin Blockchain In Action
Before concluding, an example of the Bitcoin Blockchain in action will be more telling. You will consider that you have 1 BTC that you want to try to spend twice. Let’s imagine that you then make a purchase worth 1 BTC with a merchant that accepts Bitcoin payments, such as Microsoft. Now, what happens if you try to send the same Bitcoin to another Bitcoin address?
You will be able to do it… Or at least you can try it!
As you can see, there is no mechanism to prevent someone with bad intentions from trying to broadcast two transactions for the same Bitcoin.
In this scenario, both transactions will go into the pool of unconfirmed transactions. What will happen then?
Your first transaction, the one with Microsoft, will be confirmed by the Bitcoin miners and verified in the next block. This transaction will, therefore, be stored as a cryptographic hash within the Bitcoin Blockchain.
Of course, the timestamp of the previous block is recorded at that time. It is by relying on this timestamp that the nodes of the Blockchain Bitcoin will be able to judge the second transaction as invalid.
It will be rejected from the network and will therefore never be confirmed.
By confirmation, I mean here that the blocks containing transactions have been added to the Blockchain. As each block is linked to the previous blocks, a merchant will only have to wait to receive a certain number of transactions to be sure that the Bitcoin received was not spent twice.
The double-spending problem is therefore well managed and solved!
To summarize, you must know that the Bitcoin Blockchain avoids the double-spending problem by associating a timestamp with groups of transactions and then distributing this information to all nodes of the Bitcoin network. As the transactions are timestamped on the Blockchain and mathematically linked to each other, they are irreversible and impossible to falsify.