<p>There is no reason to move coins to your wallets. You should purchase something valueable (a house + a car + a pet), and reorganize the blockchain from the point when the coins were in your wallet A. So, after all you have a house + a car + a pet plus coins in wallet. Proceed with step (1) again</p>

CC BY-SA 3.0
2017-06-29T14:58:10.900Z
2017-06-29T14:58:10.900Z
amaclin
<p>Double spending is not about doubling, but about using the same UTXO twice. So, you won't gain anything by double spending coins to yourself.</p>

<p>Let me explain you, with a simple example, how double-spending works:</p>

<p>Lets <code>Alice</code> be an attacker trying to double spend some coins. <code>Alice</code> goes to <code>Bob</code>'s store to buy some goods. In order to pay for the goods, she create a transaction, <code>TX1</code>, that spends from an UTXO from a previous transaction, <code>TX0</code>, and pays to <code>Bob</code>. Later on, <code>Alice</code> generates a second transaction, <code>TX2</code>, that also spends from <code>TX0</code> but this time pays back all the money to herself. Down bellow you can see the scenario depicted.</p>

<p><a href="https://i.sstatic.net/Efcgq.png" rel="noreferrer"><img src="https://i.sstatic.net/Efcgq.png" alt="enter image description here"></a></p>

<p>Now, <code>Alice</code> has multiples ways of double-spending the transaction, depending on her hash power and on whether <code>TX1</code> has been included in the blockchain or not. Since you assumed you have a 51% of the network hash power, we can assume that <code>Alice</code> can mine a block with a greater probability than anyone else, so we will take it for granted, an analyze only the other factor, what happens with <code>TX1</code>.</p>

<p><strong>TX1 not confirmed</strong></p>

<p>If we assume that <code>TX1</code> is still not confirmed, but it has been broadcast and the nodes are aware of it, <code>Alice</code> can double spend <code>TX1</code> with <code>TX2</code> by just including <code>TX2</code> in the next block she mines. If Bob has accepted the zero-confirmation transaction as a payment and has delivered the good to <code>Alice</code> before the inclusion of <code>TX1</code> in the blockchain, <code>Alice</code> will obtain both the goods and the double-spent amount.</p>

<p><strong>TX1 confirmed</strong></p>

<p>If <code>TX1</code> gets confirmed, either because, against the odds, another miner has mined a block in which the transaction was included before <code>Alice</code> mined hers, since <code>Alice</code> has the greater hash rate she can overcome the previous block by continue mining on the top of the previous block. This will create a blockchain fork, and eventually <code>Alice</code> branch will be longer than the other, since her hash rate is bigger. Notice that if <code>Alice</code> does that frequently lots of forks will occur, in which double-spending transaction could be identified, what will undermine the trust on the currency.</p>

<p>Last, being <code>Alice</code> the most powerful miner, she could just include double-spending transaction without forking the chain, by including a <code>TX2</code> in the same branch than <code>TX1</code> was included. Notice that this violates the blockchain inclusion rules, since two transactions can not spend from the same source. Therefore, the rest of the network will not accept this block as valid. However, since <code>Alice</code> has the greater hash power she can just keep going and mine over that block. In this case two things can happen, either the trust in the currency is lost since more of the 51% of the hash power is devoted to cheating, or the branch that includes both transactions is just ignored by the rest of the network.</p>

<p>In conclusion, no good comes from someone controlling such amount of hash power. </p>

CC BY-SA 3.0
2017-06-29T18:01:53.557Z
What does it mean "will not releayed by the rest of the nodes"? I understand that I need to add a double-spend in the same block in order to succeed, is that correct?
shredding
CC BY-SA 3.0
2017-06-29T21:25:28.023Z
A block won't be valid if a transaction spends from the same source (UTXO) than a previous transaction. In the same way, two transactions included in the same block can not spend from the same source, if this happens the block will not be considered valid, since one of the transactions will double spend the other.
sr_gi
CC BY-SA 3.0
2017-06-30T07:17:59.837Z
But if this validation exists, how could i overcome it with 51? Wouldnt I just Produce invalid Blocks faster?
shredding
CC BY-SA 3.0
2017-06-30T08:24:33.993Z
I've updated the answer, maybe now it's clearer.
sr_gi
CC BY-SA 3.0
2017-06-30T18:56:08.797Z
It is clearer now. I understand it that if a double spend transaction is in the same block, other miners will understand and reject it. But they won't if they are not in the same blocks.

Right?
shredding
CC BY-SA 3.0
2017-06-30T19:02:28.617Z
Same block = reject. Different block but same block height = chain fork. Different block but different height (the doble spend is published after) = reject.
sr_gi
CC BY-SA 3.0
2017-06-29T14:57:30.280Z
2017-06-30T08:23:49.037Z
2017-06-30T08:23:49.037Z
sr_gi
<p>I try to understand what consequences double spending may have.</p>

<p>Let's assume I own 51% of the network and own three bitcoins wallets. If I double spend the coins from Wallet A to B and C - would I have doubled my coins?</p>

<p>I know that they are not really doubled, but if no one would noticed, would I be able to e.g. send them to Coinbase wallet and convert the double amount to USD?</p>

<p>If not, how does an attacker actually make money from a double spending?</p>

<doublespend>
Is something gained by double spending myself on a 51% attack?
shredding
# Is something gained by double spending myself on a 51% attack?

(Asked by: username_0 on 2017-06-29)

I try to understand what consequences double spending may have.

Let's assume I own 51% of the network and own three bitcoins wallets. If I double spend the coins from Wallet A to B and C - would I have doubled my coins?

I know that they are not really doubled, but if no one would noticed, would I be able to e.g. send them to Coinbase wallet and convert the double amount to USD?

If not, how does an attacker actually make money from a double spending?

**Tags:** doublespend


---

## 2 answers

### Answer by username_2 on 2017-06-29. Score: 7 | Accepted answer

Double spending is not about doubling, but about using the same UTXO twice. So, you won't gain anything by double spending coins to yourself.

Let me explain you, with a simple example, how double-spending works:

Lets `Alice` be an attacker trying to double spend some coins. `Alice` goes to `Bob`'s store to buy some goods. In order to pay for the goods, she create a transaction, `TX1`, that spends from an UTXO from a previous transaction, `TX0`, and pays to `Bob`. Later on, `Alice` generates a second transaction, `TX2`, that also spends from `TX0` but this time pays back all the money to herself. Down bellow you can see the scenario depicted.

[![enter image description here](https://i.sstatic.net/Efcgq.png)](https://i.sstatic.net/Efcgq.png)

Now, `Alice` has multiples ways of double-spending the transaction, depending on her hash power and on whether `TX1` has been included in the blockchain or not. Since you assumed you have a 51% of the network hash power, we can assume that `Alice` can mine a block with a greater probability than anyone else, so we will take it for granted, an analyze only the other factor, what happens with `TX1`.

**TX1 not confirmed**

If we assume that `TX1` is still not confirmed, but it has been broadcast and the nodes are aware of it, `Alice` can double spend `TX1` with `TX2` by just including `TX2` in the next block she mines. If Bob has accepted the zero-confirmation transaction as a payment and has delivered the good to `Alice` before the inclusion of `TX1` in the blockchain, `Alice` will obtain both the goods and the double-spent amount.

**TX1 confirmed**

If `TX1` gets confirmed, either because, against the odds, another miner has mined a block in which the transaction was included before `Alice` mined hers, since `Alice` has the greater hash rate she can overcome the previous block by continue mining on the top of the previous block. This will create a blockchain fork, and eventually `Alice` branch will be longer than the other, since her hash rate is bigger. Notice that if `Alice` does that frequently lots of forks will occur, in which double-spending transaction could be identified, what will undermine the trust on the currency.

Last, being `Alice` the most powerful miner, she could just include double-spending transaction without forking the chain, by including a `TX2` in the same branch than `TX1` was included. Notice that this violates the blockchain inclusion rules, since two transactions can not spend from the same source. Therefore, the rest of the network will not accept this block as valid. However, since `Alice` has the greater hash power she can just keep going and mine over that block. In this case two things can happen, either the trust in the currency is lost since more of the 51% of the hash power is devoted to cheating, or the branch that includes both transactions is just ignored by the rest of the network.

In conclusion, no good comes from someone controlling such amount of hash power.

> **Comments:**
> **username_0**: What does it mean "will not releayed by the rest of the nodes"? I understand that I need to add a double-spend in the same block in order to succeed, is that correct?  
> **username_2**: A block won't be valid if a transaction spends from the same source (UTXO) than a previous transaction. In the same way, two transactions included in the same block can not spend from the same source, if this happens the block will not be considered valid, since one of the transactions will double spend the other.  
> **username_0**: But if this validation exists, how could i overcome it with 51? Wouldnt I just Produce invalid Blocks faster?  
> **username_2**: I've updated the answer, maybe now it's clearer.  
> **username_0**: It is clearer now. I understand it that if a double spend transaction is in the same block, other miners will understand and reject it. But they won't if they are not in the same blocks.  Right?  
> **username_2**: Same block = reject. Different block but same block height = chain fork. Different block but different height (the doble spend is published after) = reject.  

---

### Answer by username_1 on 2017-06-29. Score: 2

There is no reason to move coins to your wallets. You should purchase something valueable (a house + a car + a pet), and reorganize the blockchain from the point when the coins were in your wallet A. So, after all you have a house + a car + a pet plus coins in wallet. Proceed with step (1) again


---

