<p><strong>Edit</strong></p>

<p>You could practically open two separate bitcoin clients (such as MultiBit and Bitcoin-QT). Prepare a transaction that is using the same input. As for output one would use the payee's address, while the other client would use your address (you're double spending right?).</p>

<p>At this point you'd just have to send the transactions at the same time and hope your payee has gotten the correct transaction instead of the double spend. I doubt there's a client that automates this procedure.</p>

<p>You could also make this happen with a higher success rate if you send the valid transaction directly to the payee's client, while you send the double-spend to the node of a pool. This would increase the chances that your double spend will actually make it inside a block before the other. </p>

<p>Of course to do this would require you to get your hands wet with lower level bitcoin clients such as <a href="https://github.com/spesmilo/sx" rel="nofollow">sx</a> or directly <a href="https://en.bitcoin.it/wiki/Bitcoind" rel="nofollow">bitcoind</a>. Actually I'm afraid you'd have to program this functionality yourself studying the protocol and making sure you know how to broadcast to specific nodes instead of the entire network.</p>

CC BY-SA 3.0
2014-01-22T18:06:40.033Z
The question specifically asks how someone *practically* could get a *bitcoin client* to broadast a double-spend transaction under the assumption that the merchant will accept a *zero-confirmation* transaction.  I'm not asking how the blockchain / proof-of-work system solves this problem with confirmations.
RentFree
CC BY-SA 3.0
2014-01-22T19:11:21.073Z
Ah well you didn't specify the zero-confirmation part in your question. Why not try with two different bitcoin clients and see what happens?
Luca Matteis
CC BY-SA 3.0
2014-01-22T19:13:36.463Z
"... they handed over something of value in exchange for a bitcoin payment with no confirmations."
RentFree
CC BY-SA 3.0
2014-01-22T19:15:33.513Z
Sorry I then missed your point of the question. My bad. But again why not try to send a payment *at the same time* using two separate bitcoin clients? Some clients will eventually converge with one, others with another.  Depends on propagation speed and latency of the network.
Luca Matteis
CC BY-SA 3.0
2014-01-22T19:22:30.747Z
I edited with some more info. Hope it's appropriate to your question this time.
Luca Matteis
CC BY-SA 3.0
2014-01-22T19:27:11.850Z
Makes sense... why does it have to be different clients (e.g. MultiBit and Bitcoin-Qt)?  Why not just the same client on 2 computers (or 2 phones)?
RentFree
CC BY-SA 3.0
2014-01-22T09:06:57.457Z
2014-01-22T19:22:09.090Z
2014-01-22T19:22:09.090Z
Luca Matteis
<p>I think the best way to explain this is to use the analogy of the old banker's cheque.</p>

<p>In the olden days when I was a lad we had a cheque book which allowed us to sign an instruction to pay someone a particular amount. </p>

<p>Now if I was cheeky, I could write one cheque to Bob for ten pounds and another to Alice for ten pounds. The trouble was I only had ten pounds in my account and no overdraft facility. So when Alice cashed the cheque first, she got the money and Bob's cheque was bounced "insufficient funds". Cashing the cheque meant that she had succeeded in being the first person to put her claim to the bank, who then checked my account balance and agreed to pay.</p>

<p>Making a double spend attempt is exactly the same on the bitcoin network. You are contriving to sign two transactions to two different people when you know that your bitcoin funds are not sufficient to cover both payments. This is a simple string of text, not a physical cheque, but the principle is identical.</p>

<p>In this case the network is much faster than the old banking system, and on the bitcoin network, I think a transaction is visible to the whole bitcoin-world-network in under three seconds, so I would have to somehow force one transaction to be delayed in order to move my funds with another transaction. In any event the network will only accept one transaction.</p>

<p>If you wanted to create a transaction head on over to <a href="http://brainwallet.org/#tx" rel="nofollow">this link</a> and have a look. It allows you to create a raw transaction and then broadcast it. I suspect you are going to have a go anyway, but it would be nice if you could try out your stuff on Testnet.</p>

CC BY-SA 3.0
2014-01-22T18:51:35.000Z
Actually, here, it's not simply a matter of your funds not being sufficient to cover both payments. When you spend bitcoins, you're spending _specific_ bitcoins, not just a number off of your balance. A double-spend is signing two transactions that spend the same output.
Micha
CC BY-SA 3.0
2014-01-22T22:42:40.647Z
@Micha nope, the protocol doesn't identify specific bitcoins, it really is just a number that you have. If you have two bitcoins in your account and you send out two transactions for the 'same' bitcoin then both will be accepted and you will have zero bitcoins.
placeybordeaux
CC BY-SA 3.0
2014-01-24T08:38:39.093Z
@Peter ...no, you're wrong. When you create a Bitcoin transaction, you spend (destroy) one or more transaction outputs, referenced with the txid and output index, as the input, and you create one or more new transaction outputs with a value equal to or less than the sum of the inputs. If you look at any raw transaction, you can see that it spends one or more specific outputs from earlier transactions. On the protocol level, there are no such things as addresses or accounts or balances -- each transaction output is its own unit.
Micha
CC BY-SA 3.0
2014-01-24T12:10:17.067Z
I don't think this is a question about unspent transaction outputs and how they become the inputs to the next transaction. I simplified to explain the issue to the OP.
T9b
CC BY-SA 3.0
2014-01-22T14:43:19.767Z
2014-01-22T14:43:19.767Z
T9b
<p>With Bitcoin Core, or most any local wallet, you can generate a double-spend without complex raw transaction tricks, simply by making two copies of your wallet, then doing one spend from each, using at least one of the same inputs.</p>

<p>You will need to make sure the second wallet is not connected to the network when you transmit the spend from the first, and transmit both before the next block.</p>

<p>The network will mostly ignore the double-spend (but see <a href="https://github.com/bitcoinxt/bitcoinxt" rel="nofollow noreferrer">Bitcoin XT</a>).</p>

<p>WARNING: Using more than one copy of a wallet is very dangerous.  See <a href="https://bitcoin.stackexchange.com/questions/490/can-i-use-my-wallet-on-different-computers">Can I use my wallet on different computers?</a></p>

CC BY-SA 3.0
2015-03-01T20:13:12.753Z
Can you clarify exactly what you mean by "ignore the double spend"?  Do you mean, it will honor one spend and ignore the others, or do you mean it will ignore both?  I'm pretty sure you mean "ignore both" but you may want to consider editing your answer to make this clear.
RentFree
CC BY-SA 3.0
2015-03-03T00:36:33.523Z
A Bitcoin Core node that encounters a second-spend silently drops it, and does not relay it to other nodes.  It does not forget about the first spend it saw.
Tom Harding
CC BY-SA 3.0
2015-02-28T18:41:26.307Z
2015-02-28T18:41:26.307Z
2017-04-13T12:47:34.187Z
Tom Harding
<p>Double-spending is simply the act of signing two transactions that spend the same bitcoin output twice. There are a few ways one could accomplish this.</p>

<p>All you would need is some tool that allows you to craft transactions manually, such as <a href="http://brainwallet.org/#tx" rel="nofollow">http://brainwallet.org/#tx</a>, Bitcoin Core's raw transaction RPC commands, or even just a test editor and knowledge of the transaction format. You would create a transaction that spends certain outputs to some address, typically controlled by yourself, and create a different transaction spending one or more of the same output(s) to whoever you're paying. It can also be possible without manual transaction creation, if you can make your wallet forget the transaction, in which case it can create a double-spend that it simply doesn't know it's doing.</p>

CC BY-SA 3.0
2014-01-22T19:27:07.493Z
2014-01-22T19:27:07.493Z
Micha
<p>I've occasionally seen people online claiming they were victims of a double-spend because they handed over something of value in exchange for a bitcoin payment with no confirmations.</p>

<p>Although I understand this is theoretically possible, how would someone try this practically?  All available bitcoin clients would not allow you to make a transaction that spends an output that has already been spent, and the client would know about the first transaction very soon after it was broadcast.</p>

<p>Are there specialized double-spend-friendly bitcoin clients out there?</p>

<p><strong>EDIT:</strong>  Please note: I am not asking for theory of any kind (especially not theory on how the blockchain / proof-of-work / waiting for confirmations solves the dobule-spend problem).  I am asking purely <em>practically</em> ... how does someone pull off a double-spend attempt?</p>

<doublespend>
How do people actually try double-spends?
RentFree
# How do people actually try double-spends?

(Asked by: username_0 on 2014-01-22)

I've occasionally seen people online claiming they were victims of a double-spend because they handed over something of value in exchange for a bitcoin payment with no confirmations.

Although I understand this is theoretically possible, how would someone try this practically? All available bitcoin clients would not allow you to make a transaction that spends an output that has already been spent, and the client would know about the first transaction very soon after it was broadcast.

Are there specialized double-spend-friendly bitcoin clients out there?

**EDIT:** Please note: I am not asking for theory of any kind (especially not theory on how the blockchain / proof-of-work / waiting for confirmations solves the dobule-spend problem). I am asking purely *practically* ... how does someone pull off a double-spend attempt?

**Tags:** doublespend


---

## 4 answers

### Answer by username_1 on 2014-01-22. Score: 2 | Accepted answer

**Edit**

You could practically open two separate bitcoin clients (such as MultiBit and Bitcoin-QT). Prepare a transaction that is using the same input. As for output one would use the payee's address, while the other client would use your address (you're double spending right?).

At this point you'd just have to send the transactions at the same time and hope your payee has gotten the correct transaction instead of the double spend. I doubt there's a client that automates this procedure.

You could also make this happen with a higher success rate if you send the valid transaction directly to the payee's client, while you send the double-spend to the node of a pool. This would increase the chances that your double spend will actually make it inside a block before the other.

Of course to do this would require you to get your hands wet with lower level bitcoin clients such as [sx](https://github.com/spesmilo/sx) or directly [bitcoind](https://en.bitcoin.it/wiki/Bitcoind). Actually I'm afraid you'd have to program this functionality yourself studying the protocol and making sure you know how to broadcast to specific nodes instead of the entire network.

> **Comments:**
> **username_0**: The question specifically asks how someone *practically* could get a *bitcoin client* to broadast a double-spend transaction under the assumption that the merchant will accept a *zero-confirmation* transaction.  I'm not asking how the blockchain / proof-of-work system solves this problem with confirmations.  
> **username_1**: Ah well you didn't specify the zero-confirmation part in your question. Why not try with two different bitcoin clients and see what happens?  
> **username_0**: "... they handed over something of value in exchange for a bitcoin payment with no confirmations."  
> **username_1**: Sorry I then missed your point of the question. My bad. But again why not try to send a payment *at the same time* using two separate bitcoin clients? Some clients will eventually converge with one, others with another.  Depends on propagation speed and latency of the network.  
> **username_1**: I edited with some more info. Hope it's appropriate to your question this time.  
> **username_0**: Makes sense... why does it have to be different clients (e.g. MultiBit and Bitcoin-Qt)?  Why not just the same client on 2 computers (or 2 phones)?  

---

### Answer by username_2 on 2014-01-22. Score: 1

I think the best way to explain this is to use the analogy of the old banker's cheque.

In the olden days when I was a lad we had a cheque book which allowed us to sign an instruction to pay someone a particular amount.

Now if I was cheeky, I could write one cheque to Bob for ten pounds and another to Alice for ten pounds. The trouble was I only had ten pounds in my account and no overdraft facility. So when Alice cashed the cheque first, she got the money and Bob's cheque was bounced "insufficient funds". Cashing the cheque meant that she had succeeded in being the first person to put her claim to the bank, who then checked my account balance and agreed to pay.

Making a double spend attempt is exactly the same on the bitcoin network. You are contriving to sign two transactions to two different people when you know that your bitcoin funds are not sufficient to cover both payments. This is a simple string of text, not a physical cheque, but the principle is identical.

In this case the network is much faster than the old banking system, and on the bitcoin network, I think a transaction is visible to the whole bitcoin-world-network in under three seconds, so I would have to somehow force one transaction to be delayed in order to move my funds with another transaction. In any event the network will only accept one transaction.

If you wanted to create a transaction head on over to [this link](http://brainwallet.org/#tx) and have a look. It allows you to create a raw transaction and then broadcast it. I suspect you are going to have a go anyway, but it would be nice if you could try out your stuff on Testnet.

> **Comments:**
> **username_3**: Actually, here, it's not simply a matter of your funds not being sufficient to cover both payments. When you spend bitcoins, you're spending _specific_ bitcoins, not just a number off of your balance. A double-spend is signing two transactions that spend the same output.  
> **username_4**: @username_3 nope, the protocol doesn't identify specific bitcoins, it really is just a number that you have. If you have two bitcoins in your account and you send out two transactions for the 'same' bitcoin then both will be accepted and you will have zero bitcoins.  
> **username_3**: @Peter ...no, you're wrong. When you create a Bitcoin transaction, you spend (destroy) one or more transaction outputs, referenced with the txid and output index, as the input, and you create one or more new transaction outputs with a value equal to or less than the sum of the inputs. If you look at any raw transaction, you can see that it spends one or more specific outputs from earlier transactions. On the protocol level, there are no such things as addresses or accounts or balances -- each transaction output is its own unit.  
> **username_2**: I don't think this is a question about unspent transaction outputs and how they become the inputs to the next transaction. I simplified to explain the issue to the OP.  

---

### Answer by username_5 on 2015-02-28. Score: 0

With Bitcoin Core, or most any local wallet, you can generate a double-spend without complex raw transaction tricks, simply by making two copies of your wallet, then doing one spend from each, using at least one of the same inputs.

You will need to make sure the second wallet is not connected to the network when you transmit the spend from the first, and transmit both before the next block.

The network will mostly ignore the double-spend (but see [Bitcoin XT](https://github.com/bitcoinxt/bitcoinxt)).

WARNING: Using more than one copy of a wallet is very dangerous. See [Can I use my wallet on different computers?](https://bitcoin.stackexchange.com/questions/490/can-i-use-my-wallet-on-different-computers)

> **Comments:**
> **username_0**: Can you clarify exactly what you mean by "ignore the double spend"?  Do you mean, it will honor one spend and ignore the others, or do you mean it will ignore both?  I'm pretty sure you mean "ignore both" but you may want to consider editing your answer to make this clear.  
> **username_5**: A Bitcoin Core node that encounters a second-spend silently drops it, and does not relay it to other nodes.  It does not forget about the first spend it saw.  

---

### Answer by username_3 on 2014-01-22. Score: 0

Double-spending is simply the act of signing two transactions that spend the same bitcoin output twice. There are a few ways one could accomplish this.

All you would need is some tool that allows you to craft transactions manually, such as <http://brainwallet.org/#tx>, Bitcoin Core's raw transaction RPC commands, or even just a test editor and knowledge of the transaction format. You would create a transaction that spends certain outputs to some address, typically controlled by yourself, and create a different transaction spending one or more of the same output(s) to whoever you're paying. It can also be possible without manual transaction creation, if you can make your wallet forget the transaction, in which case it can create a double-spend that it simply doesn't know it's doing.


---

