Cover photo

What Is The Double-Spending Problem In Cryptocurrency?

Follow the author on Twitter and subscribe on Youtube (The Non-fungible Guy).

The double-spending issue in cryptocurrency is a typical issue in all economic systems. Wrongdoers aim to exploit or mimic existing currencies for personal financial benefit, whether with fraudulent gold, counterfeit dollar bills, fake coins, or duplicating cryptocurrency. Wrongdoers are frequently some of the first to adopt new technologies and currencies because an asset is often untested or unregulated, making it easier to exploit. Cryptocurrency is no exception.

What Is Cryptocurrency And How Is It Different From Fiat Currency?

To begin with, it's important to realize that a digital currency is simply another type of digital asset - in other words, anything from a song file to a video file to an e-document. A digital asset is represented as electronic cash in cryptocurrency.

In the physical world, you can share your bank's details with others, but the money will remain in your account. To claim your cash, you must provide evidence of ownership. You visit the bank and produce a piece of ID showing that it's you by a method of signature; only then may you receive your funds from your account.

With cryptocurrency, the process is very similar; the public key/address is like your bank account and routing number, while the private key is the actual money, and only the owner has the private key to verify it. A digital signature (public keys and private keys) ensures that someone's identity is kept secret while electronic cash is securely stored. A private-public key combination, as you may have seen with the Enigma machine, allows you to encrypt and decrypt information while keeping the information secure.

The problem with digital currency

When you use fiat money (such as paper money made legal by a government) like American dollars or euros, the paper is inconvertible, which means that once you gave the paper away, you cannot spend it again. Now, is it possible for someone to double spend your cryptocurrency? What happens if you demonstrate ownership and send your digital money twice at precisely the same moment in time? This might result in double-spending.

The double-spending problem is a situation in which the same unit of currency is spent repeatedly more than once. This leads to a divergence between the volume of money spent and the amount of cash available.

Imagine, for example, if someone walks into a Nike store with only $100 and buys a $100 basketball jersey, then buys another $100 basketball jersey with the same $100 already paid to the cashier. While this is difficult to accomplish with actual cash—since the recent transaction and its recipients may be readily checked in real-time—there’s more opportunity for wrongdoers to do it with digital currency.

Cryptocurrencies are considered the future of money when it comes to digital assets, but when wrongdoers try to double-spend them in what way can they be stopped? The blocks (also known as digital records) that hold keys are not enough to provide security and solve the double-spending problem.

Another potential for double-spending is after receiving the counterparty’s assets or services, a wrongdoer may attempt to double-spend by reversing a transaction, keeping both the received products and the transmitted cryptocurrency. In this situation, the attacker sends numerous messages (units of data) to the network in an attempt to reverse the transactions and give the illusion that they never occurred.

However, what makes Bitcoin (BTC) so revolutionary is that its creator, Satoshi Nakamoto designed it so that it actually can be the closest technology to solving the double-spending problem in both the examples mentioned.

The Double Spending Solution that Bitcoin Provides

Satoshi designed Bitcoins so that each Bitcoin transaction utilizes a network of computers that ensure that no double-spending attempts have succeeded. This is accomplished by all the computers on its network being aware of every transaction. All transactions are made available to all machines in the network at the instance of the transaction in question.

The Bitcoin blockchain is a decentralized, public ledger that records the creation of all new Bitcoins as well as every transaction performed with those coins since their inception. The copy of the ledger maintained by a decentralized network of miners is identical.

The goal of the Bitcoin ledger is to maintain a record of all Bitcoins that have ever existed and are known as "the Blockchain". Satoshi created a game-theory-based method for keeping the Bitcoin ledger up to date, incentivizing miners to compete by being honest, and only submitting genuine transactions to the ledger. For example, when Travis sends Anna one BTC, the transaction is entered into a pool along with all other unconfirmed transactions. Miners compete in a race to be the first to solve difficult cryptographic calculations, demanding considerable computing power. The first miner to solve the problem selects a group of transactions from the pool, which is known as a block.

The miner then sends their solution and block to the rest of the network's miners. The solution is checked, as well as the validity of the transactions in the block. To succeed, Travis must have a valid Bitcoin address that contains at least one BTC. If he does, the trade is authorized and recorded in the Bitcoin ledger.

Each block is linked cryptographically to the one before it, creating a verifiable chain of transactions. Returning to the question of double-spending, it would be difficult for someone to perform a double spend if they can persuade or dupe the network into thinking that Travis still has that one BTC in his account after he's already sent it to Anna. There are only a few options for any person or computer trying to make this happen, and none of them is simple.

A peer is a computer connected to other computers in the network via the Internet. A laptop, mobile device, or server may be any computer that satisfies the network criteria. Computers are linked together via a P2P (Peer-to-peer) network protocol and create a network of nodes over the Internet.

The P2P network protocol is not new. It has been used extensively on the Web for years now, from downloading files via Kazaa or LimeWire networks to having video chats via Skype. Even Bitcoin itself was not the first cryptocurrency invented. Before it was invented there was Bit Gold which has a similar crypto mining system to Bitcoin called proof of work and then Hashcash which was developed in the mid-1990s. However, Bitcoin is generally considered the first major cryptocurrency to solve the double-spending problem and become massively successful.

Bitcoin's success is attributed to the following characteristics: it is unhackable because it uses public-private keys, it is decentralized without the need of a governing body, it is freely accessible, and it is open-source code. These were Satoshi's motives for developing Bitcoin.

So Bitcoin was the first viable cryptocurrency, and it solved the double-spending issue as well as allowed electronic cash to be stored without going through financial institutions by utilizing P2P to form the blockchain protocol.

In Bitcoin's Whitepaper - Satoshi Nakamoto put it as :

—Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System”
—Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System”

Cryptocurrencies, like Bitcoin, are highly speculative investments that can change rapidly owing to market news and other factors. Yet it's the prospect of huge price swings that draws some investors—especially those with a long-term investment horizon—to hang in there as cryptocurrency investors. There are people who think that Bitcoin is the next global currency, and on the other hand there are others who think it's a bubble waiting to burst. Do you think it's possible that Bitcoin could become worthless? What do you think would happen to all of those individuals who have their money in it if this were to occur? In my next article, I dive deeper into this scenario and the kinds of effects that such a situation would have.

Photography (top): Photo by Mati Mango from Pexels