<p>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.</p>

<p>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.)</p>

<p>The Finney attack also has costs that make it less of a threat than it would seem.  Holding a block costs about a dollar a second.  So if once a block is mined but not broadcast and it then takes the thief forty seconds to complete the transaction with the merchant, there had better be a lot more than $40 worth of profit from doing so otherwise the attempt ends up being uneconomical over the long run. Again, the merchant would know eventually that the double spend had occurred (measured in seconds, if monitoring the blockchain), so this doesn't work well in circumstances where the thief risks getting caught.  So the prevention for this is to simply not make large value transactions (e.g., hundred dollars or more) on 0/unconfirmed without some delay where you are watching for double spending.</p>

<p>The 51% attack that would reverse confirmed transactions is so expensive and thus such a remote chance of it occurring, it is not even of concern for a typical merchant. (i.e., someone spending millions of dollars to double spend using this attack vector, if it ever happens, is going to go after trades where large exchanges of value which occur -- think gold bullion traded for bitcoins under a bridge at midnight.  They are not trying to buy your consumer electronics that you ship out via UPS nor are they meeting you at Starbucks hoping to defraud you of your $200.)</p>

<ul>
<li><a href="http://en.bitcoin.it/wiki/Double-spending" rel="noreferrer">http://en.bitcoin.it/wiki/Double-spending</a></li>
</ul>

CC BY-SA 3.0
2012-10-05T18:05:45.367Z
2012-10-05T18:12:55.473Z
2012-10-05T18:12:55.473Z
Stephen Gornick
<p>If everyone could spend the same Bitcoin twice, then the whole system would collapse because Bitcoins would not be scarce.</p>

CC BY-SA 3.0
2014-10-02T21:49:58.313Z
That isn't what "double spend" means though.  A double spend attack doesn't actually create new coins and has no effect on the money supply.  Rather, it lets you take back coins from someone you previously gave them to (so they don't have them anymore).  No offense, but I don't understand how this answer got to +4.
Nate Eldredge
CC BY-SA 3.0
2014-10-02T19:42:57.870Z
2014-10-02T19:42:57.870Z
Matthew Darnell
<p>Double spend when a user able to spent his coins more than once. This normally happens when you able to create two different versions of blockchain ledger, and both were valid at different times.</p>
<p>To understand read this real-world example, where an attacker able to spent double-spent 807K ETC.</p>
<p><a href="https://blog.bitquery.io/attacker-stole-807k-etc-in-ethereum-classic-51-attack" rel="nofollow noreferrer">Attacker Stole 807K ETC in Ethereum Classic 51% Attack</a></p>

CC BY-SA 4.0
2020-08-06T13:30:58.180Z
2020-08-06T13:30:58.180Z
Gaurav Agrawal
<p>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:</p>

<ul>
<li>Send two conflicting transactions in rapid succession into the Bitcoin network. This is called a <a href="https://en.bitcoin.it/wiki/Double-spending#Race_attack" rel="noreferrer">race attack</a>.</li>
<li>Pre-mine one transaction into a block and spend the same coins before releasing the block to invalidate that transaction. This is called a <a href="https://bitcoin.stackexchange.com/q/4942/323">Finney attack</a>.</li>
<li>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 <a href="https://en.bitcoin.it/wiki/Double-spending#51.25_attack" rel="noreferrer">51% attack</a>.</li>
</ul>

<p>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).</p>

<p>For more information about all those attacks, you can check out <a href="https://bitcointalk.org/index.php?topic=88149.0" rel="noreferrer">my master thesis on Bitcoin security</a>.</p>

CC BY-SA 3.0
2014-10-14T12:11:36.233Z
This answer could be improved by explaining that coins can only be spent once and how the double spend attack could be detrimental to the recipient.
Murch
CC BY-SA 3.0
2017-02-23T11:09:44.210Z
"your business most likely won't be the main target (it's unlikely to happen without really big money getting involved)." That is not particularly true, because if you own a lot of mining power, cost of attack becomes really small to you, so you can wreck a lot of people with little cost. Also, you don't need big money to do that. All you need is to hack one the biggest mining pools.
Igor Yalovoy
CC BY-SA 3.0
2012-10-05T15:34:47.973Z
2012-10-05T17:36:45.570Z
2017-04-13T12:47:36.707Z
ThePiachu
<p>What is a double spend?</p>

<p>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?</p>

<transactions><blockchain><security><doublespend><attack>
What is a double spend?
Dr.Haribo
# What is a double spend?

(Asked by: username_0 on 2012-10-05)

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?

**Tags:** transactions, blockchain, security, doublespend, attack


---

## 4 answers

### Answer by username_5 on 2012-10-05. Score: 23 | Accepted answer

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](https://en.bitcoin.it/wiki/Double-spending#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](https://bitcoin.stackexchange.com/q/4942/323).
* 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](https://en.bitcoin.it/wiki/Double-spending#51.25_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](https://bitcointalk.org/index.php?topic=88149.0).

> **Comments:**
> **username_6**: This answer could be improved by explaining that coins can only be spent once and how the double spend attack could be detrimental to the recipient.  
> **username_7**: "your business most likely won't be the main target (it's unlikely to happen without really big money getting involved)." That is not particularly true, because if you own a lot of mining power, cost of attack becomes really small to you, so you can wreck a lot of people with little cost. Also, you don't need big money to do that. All you need is to hack one the biggest mining pools.  

---

### Answer by username_1 on 2012-10-05. Score: 5

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.)

The Finney attack also has costs that make it less of a threat than it would seem. Holding a block costs about a dollar a second. So if once a block is mined but not broadcast and it then takes the thief forty seconds to complete the transaction with the merchant, there had better be a lot more than $40 worth of profit from doing so otherwise the attempt ends up being uneconomical over the long run. Again, the merchant would know eventually that the double spend had occurred (measured in seconds, if monitoring the blockchain), so this doesn't work well in circumstances where the thief risks getting caught. So the prevention for this is to simply not make large value transactions (e.g., hundred dollars or more) on 0/unconfirmed without some delay where you are watching for double spending.

The 51% attack that would reverse confirmed transactions is so expensive and thus such a remote chance of it occurring, it is not even of concern for a typical merchant. (i.e., someone spending millions of dollars to double spend using this attack vector, if it ever happens, is going to go after trades where large exchanges of value which occur -- think gold bullion traded for bitcoins under a bridge at midnight. They are not trying to buy your consumer electronics that you ship out via UPS nor are they meeting you at Starbucks hoping to defraud you of your $200.)

* <http://en.bitcoin.it/wiki/Double-spending>


---

### Answer by username_2 on 2014-10-02. Score: 1

If everyone could spend the same Bitcoin twice, then the whole system would collapse because Bitcoins would not be scarce.

> **Comments:**
> **username_3**: That isn't what "double spend" means though.  A double spend attack doesn't actually create new coins and has no effect on the money supply.  Rather, it lets you take back coins from someone you previously gave them to (so they don't have them anymore).  No offense, but I don't understand how this answer got to +4.  

---

### Answer by username_4 on 2020-08-06. Score: 0

Double spend when a user able to spent his coins more than once. This normally happens when you able to create two different versions of blockchain ledger, and both were valid at different times.

To understand read this real-world example, where an attacker able to spent double-spent 807K ETC.

[Attacker Stole 807K ETC in Ethereum Classic 51% Attack](https://blog.bitquery.io/attacker-stole-807k-etc-in-ethereum-classic-51-attack)


---

