Bitcoin and double spending problem – What is it

Best Binary Options Brokers 2020:
  • BINARIUM
    BINARIUM

    Best Options Broker 2020!
    Great Choice For Beginners!
    Free Trading Education!
    Free Demo Account 1000$!
    Get Your Sign-Up Bonus Now!

  • BINOMO
    BINOMO

    Only For Experienced Traders!

What is Bitcoin Double Spending?

One of the vital reasons that Bitcoin is so successful is that it has proven that it can retain value very well, a lot like gold. One reason Bitcoin retains value well is that the creator Satoshi Nakamoto eliminated the possibility of double-spending.

Double-spending is just as it sounds; using the same money to pay for two different transactions. Bitcoin avoids the double spending problem by implementing a confirmation mechanism. The confirmation mechanisms rely on the cryptographic algorithms the program uses, and the public ledger of the blockchain.

If you think about trying to double-spend with cash, it would be pretty tricky. But, hypothetically, to double-spend with cash, you would have to use the same bill twice for two different purchases. For example, it would be as if you paid for a coffee with a $5 bill. Then, you managed to take the cash back when the cashier wasn’t looking. And then you used the same $5 bill to buy some donuts.

Early attempts at digital money struggled to overcome the serious problem of double-spending. In fact, before the success of Bitcoin in 2008, there were many attempts to create completely digital cash. They were, however, unsuccessful because they could not properly mitigate the problem of double-spending. As it turns out, it is pretty easy to copy simple electronic bits and reuse them multiple times.

How then did Bitcoin overcome double-spending? Bitcoin’s digital currency seamlessly blends several essential functions that make it nearly impossible to reproduce the same digital transactions after it has already been spent. I will explain why it is “nearly impossible” to reproduce a Bitcoin transaction shortly.

The Elimination of Bitcoin Double-spending:

  • Blockchain and hash-function SHA-256
  • Confirmation Recommendations
  • The Computational Cost of Attacking the System

Blockchain

The foundation of Bitcoin’s construction is blockchain technology. Satoshi did not invent the blockchain, but he was the first one to successfully implement it. The Bitcoin blockchain is a public digital ledger, that is managed by a large collective of decentralized networks. So, each transaction made on the network is recorded on the Bitcoin’s ledger.

Moreover, each transaction is also cryptographically bound to the blocks before and after it. The blocks on Bitcoin’s blockchain are maintained as chronologically-ordered, time-stamped transactions. The ledger continues to increase since its realization in 2009, which adds to its validity.

About every 10 minutes, a new block is added to the Bitcoin blockchain. The program maintains the difficulty rate of addition. Each participating network keeps a copy of each of the blocks on their individual computer.

SHA-256

Another important aspect of the Bitcoin blockchain is the SHA-256 hashing algorithm that the system relies on. Each new transaction relies on the SHA-256 cryptographic hash function. This function works because it uses many many variables, is highly sensitive, and each cryptographic hash is bound to the others in the chain. These features make it computationally impossible to reproduce and reuse the same transaction.

The Confirmation Process

But the ledger and the SHA-256 hash are not the only preventative measures in place to stop Bitcoin double spending!

To send Bitcoin to pay for something, the transaction is transmitted to the network as an unconfirmed transaction. So if you try to quickly resend the same transaction, only the first confirmed transaction is approved. The network rejects the other transaction because it is recognized as a duplicate.

Here’s how that works with the confirmation process:

Best Binary Options Brokers 2020:
  • BINARIUM
    BINARIUM

    Best Options Broker 2020!
    Great Choice For Beginners!
    Free Trading Education!
    Free Demo Account 1000$!
    Get Your Sign-Up Bonus Now!

  • BINOMO
    BINOMO

    Only For Experienced Traders!

Confirmations are the blocks of other transactions added to the blockchain. As I mentioned, each block is cryptographically bound to the others in the chain.

Transactions can be simultaneously received by the network. However, the transaction with the largest number of confirmations is the transaction that is added to the blockchain, not both. This is in part because of the time lag.

The current recommended standard is 6 confirmations before a transaction is added to the blockchain. 6 confirmations indicates that after your transaction was added to the blockchain, 6 more blocks of other transactions were added after yours. So the chain is sufficiently long enough to prove your transactions completion and permanent status in the blockchain ledger.

So, if you send the same transaction to two different merchants, and one of them does not wait for a minimum of 6 confirmations, they would be out for their product, as they would never receive that payment.

The Computational Cost of Attacking the System

The reason the Bitcoin system functions is because of the cryptography that Bitcoin relies on. Because each block of data is bound to the next, to change one block is to change them all. This is computationally infeasible. This goes back to what I said about it being “nearly impossible” to duplicate or undo a transaction.

The size of the transactions, the energetic and financial cost, along with time lag to add blocks to the chain, all make duplications and attacks nearly impossible. However, theoretically, if an attacker had enough computational power to work backward through the blockchain, changing blocks, and maintaining the length of the chain, they could attack the whole system. However, the amount of computational power necessary to do this is truly unreal, and so there has yet to be a successful attack on Bitcoin’s blockchain.

Read more about the cost of mining Bitcoin to get at a better idea of how much energy is required to perform a reversal.

Potential Issues: Attack 51% & Race Attack

If an attacker were able to capture 51% of the hash power of the network, double spending is possible. This is referred to as a 51% attack. In that case, the attackers would conceivably get a hold of at least 50% of the hash power of the network. In doing this, they could temporarily control the network, and control transactions and confirmations.

A Race Attack is another potential concern. This is when an attacker sends the same transaction in quick succession to two different addresses. But as I mentioned earlier, only one of the transactions will be included. Which means the duplicate transaction is automatically rejected.

Avoiding the Problem of Bitcoin Double Spending

To avoid being the victim of a double-spend, make sure to wait for a minimum of 6 confirmations before you accept the conditions of the transaction. As this article explained, you cannot duplicate or forge a Bitcoin transaction, nor can you change the other transactions in the blockchain.

But it is possible for someone to send the same transaction to two different addresses. And if one or both of those recipients does not wait for 6 confirmations from the network, then the attacker will be successful. This is because if the attacker sends the same transaction to different places, and still receives his product from both merchants, he only actually pays for the one of the two. And the network rejects the duplicate transaction.

Remember, cryptocurrencies are irreversible and under-regulated. So once your money is gone, there is no way to get it back. The Bitcoin script and decentralized network are able to solve the problem of Bitcoin double-spending. However, it is up to the user to behave intelligently and use all available precautions.

What is a double spend?

What is a double spend?

As someone who uses Bitcoin, what do I need to know about how the Bitcoin system prevents double spends? Are there still circumstances where they can occur?

3 Answers 3

A double spend is an attack where the given set of coins is spent in more than one transaction. There are a couple main ways to perform a double spend:

  • Send two conflicting transactions in rapid succession into the Bitcoin network. This is called a race attack.
  • Pre-mine one transaction into a block and spend the same coins before releasing the block to invalidate that transaction. This is called a Finney attack.
  • Own 51+% of the total computing power of the Bitcoin network to reverse any transaction you feel like, as well as have total control of which transactions appear in blocks. This is called a 51% attack.

To prevent damages from the first attack – wait for one confirmation to appear on a given transaction. To prevent damage from the second attack – wait for 6 confirmations to appear on a transaction, or less if the transaction is small (but still require at least 1). Damage from the third attack can cripple the entire Bitcoin network, so don’t worry about it – your business most likely won’t be the main target (it’s unlikely to happen without really big money getting involved).

For more information about all those attacks, you can check out my master thesis on Bitcoin security.

As a merchant, you can reduce the likelihood of losses from a race attack double spend by having your node properly configured (no incoming transactions, explicit outgoing connections to well-connected nodes). There still is a tiny risk of getting cheated even with this configuration but it is rare and relatively random. Thus the disincentive to the attacker is that if success in double spending only rarely occurs, each failed attempt is a profitable sale to the merchant and thus in the long run it is unprofitable for the attacker and profitable for the merchant.

There are circumstances where a merchant is more vulnerable. An unattended coin change machine at a laundromat, for instance, would be the worst case scenario for the merchant. The attacker loses nothing for failed attempts (presuming the machine is not taking any profit from each “sale”), takes the gains on the occasional successful attempt, and is not likely to get caught for committing fraud as by the time the laundromat operator is aware anything happened the thief is long gone. (Of course, countering this is the likelihood that blockchain monitoring would have identified the numerous double spend attempts and thus the laundromat operator can prevent even this from occurring.)

What Is The Double-Spending Problem?

The double-spending problem is the primary reason why cryptocurrencies use blockchain technology. Learn more about this fascinating topic below.

When Satoshi Nakamoto published his groundbreaking whitepaper Bitcoin: A Peer-to-Peer Electronic Cash System in 2008, he introduced a number of important innovations. The most notable of which was blockchain technology and the consensus mechanism it utilizes.

Although the history of digital currencies stretches back to the 1980s, in which David Chaum published his seminal paper, nobody had yet found a good solution to the double-spending problem. Bitcoin changed that.

What is the Double-Spending Problem?

The double-spending problem describes the difficulty of verifying the ownership of a digital token. How can we be sure that a token is only spent once? With real cash, it’s very simple. The physical bill changes hands and is now in your wallet. You now own that money.

If it wasn’t for the double-spending problem, theoretically every digital asset could be used as a form of currency. Fortunately – or unfortunately depending on your perspective – digital files can be cloned, copied, replicated and shared infinitely. Measures to stop this either simply don’t work or involve some central authority – like a government.

In the cryptocurrency-space we want everyone to enjoy as much freedom as possible, so how do we solve the double-spending problem?

The SelfKey Identity Wallet is a free identity solution for Windows, Linux and Mac. Get yours today!

How do we solve the Double-Spending Problem

Blockchain technology allows us to solve the double-spending problem by broadcasting each transaction to a network of nodes and verifying it through the use of a consensus mechanism. In the case of Bitcoin this consensus mechanism is called proof-of-work, but others – like proof-of-stake – are growing in popularity.

Crucially, all transactions are stored on a public ledger and are grouped into sequential blocks which are interlinked (hence the name “blockchain”). As a result, a time-stamped record of each transaction is available to all members of the network and incorrect (or fraudulent) transactions are checked and then rejected. In a nutshell, this is how the double-spending problem is solved.

If you’re new to cryptocurrency this might sound confusing so here is the ELI5 version:

  • There are many nodes (computers) that communicate with each other constantly, forming a peer-to-peer network
  • If I send you one Bitcoin (for example) that information is sent to all the nodes that are running Bitcoin’s software
  • Every node on the network saves the information that you now have one Bitcoin, and I no longer possess it
  • If I try to spend the Bitcoin i just gave you again, the network rejects my transaction because it knows that you are the owner of that Bitcoin
  • We have solved the double-spending problem

It’s also worth keeping in mind that “the network is robust in its unstructured simplicity” and especially designed to prevent double-spending attacks. More specifically, blockchain technology provides a very strong topology which allows nodes to leave and rejoin the network at will.

Importantly, the nodes accept the proof-of-work provided by miners and accept valid blocks by working on extending them. Blocks that contain incorrect transactions are rejected, because the nodes refuse to add the block of transactions to the public ledger mentioned earlier. In more relatable terms: the nodes vote with their CPU power to accept and reject transactions.

Now comes the key piece of information. Each accepted block of transactions is linked to the previous block with a unique hash. As the number of blocks increases, so does the integrity of the blockchain and the hashing power required to break it.

This approach makes a lot of sense, but how well does it perform when attacked?

Can a sophisticated fraudster double-spend tokens?

At its peak the combined market capitalization of all cryptocurrencies reached $800 billion. Although this number has come down recently, the value that is being generated and transferred in the industry is still vast. With so much money on the line, how can we be sure that the double-spending problem won’t resurface and bring the industry tumbling down?

The short answer is that double-spending is not possible as long as the majority (51%) of nodes in the network act with integrity. If a malicious actor manages to somehow control 51% of the network, he controls the hashing power, giving him the opportunity to rewrite blocks and thus add fraudulent transactions to the ledger. The apparent cost of such an attack is so high as to be prohibitive.

Therefore, sophisticated cryptocurrencies with large networks are immune to double-spending because even a successful attack would be so expensive that it couldn’t provide a positive outcome for the attacker.

Best Binary Options Brokers 2020:
  • BINARIUM
    BINARIUM

    Best Options Broker 2020!
    Great Choice For Beginners!
    Free Trading Education!
    Free Demo Account 1000$!
    Get Your Sign-Up Bonus Now!

  • BINOMO
    BINOMO

    Only For Experienced Traders!

Like this post? Please share to your friends:
Binary Options Trading Library
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: