<p>Yes, Moe's transactions (both the coin creation one and the payment transaction) become invalid if Larry mines a conflicting blockchain that has more work (almost the same as longest, but not quite) than Moe's blockchain. So Curly would be without payment and Moe would have gotten himself a free pair of goggles.</p>

<p>Now if Moe and Larry were the same person this would be a Finney attack where Moe/Larry are intentionally defrauding Curly.</p>

<p>Of course there are built in safeguards to protect against this. Firstly, Moe cannot spend newly mined Bitcoins until 100 blocks have been mined on top of his block. But even if he did wait 100 blocks before transacting, Curly could still be defrauded.</p>

<p>The solution to this is for Curly to wait for the payment transaction to get a few confirmations. By waiting for confirmations, the amount of hashrate that Larry would need in order to change the blockchain to not include Moe's transaction greatly increases. After a few blocks, it is basically infeasible and thus it can be said that the transaction is permanent and cannot disappear.</p>

CC BY-SA 3.0
2018-01-02T21:49:27.537Z
"But even if he did wait 100 blocks before transacting, Curly could still be defrauded." -- yes, but that would just be a regular double spend attempt.  A reorganization of 100 blocks is unreasonable.  After that much POW you can be assured that the block that mined the coins will stay in the chain.
Jestin
CC BY-SA 3.0
2018-01-03T17:25:41.773Z
"Firstly, Moe cannot spend newly mined Bitcoins until 100 blocks have been mined on top of his block" -- what exactly prevents this?  If Moe has hte Bitcoin adn Curly chooses to accept it (after being poorly advised not to wait for 100 blocks), what safeguard is there?
Dave
CC BY-SA 3.0
2018-01-03T18:08:54.870Z
It is a consensus rule that prevents it. The transaction will be invalid. I suppose it doesn't matter if Curly accepts it even though it is unconfirmed.
Ava Chow
CC BY-SA 3.0
2018-01-03T20:53:41.350Z
But in my question Curly has accepted the Bitcoin before Larry has mined a longer block.  Or can this siutation never happen, since you mention Moe cannot spend newly mined Bitcoins until 100 blocks have been mined (which I'm guessing is part of the Bitcoin software)?
Dave
CC BY-SA 3.0
2018-01-03T20:57:28.863Z
This situation is possible but easily avoidable.
Ava Chow
CC BY-SA 3.0
2018-01-04T01:19:59.757Z
Ok, then could you explain your comment "Firstly, Moe cannot spend newly mined Bitcoins until 100 blocks".  If my situation is possible it sounds like Moe could spend his Bitcoins immediately as long as there are a few suckers out there.
Dave
CC BY-SA 3.0
2018-01-04T02:21:11.250Z
I misread your question. I thought Moe had mined a block containing that spend.
Ava Chow
CC BY-SA 3.0
2018-01-02T21:25:39.840Z
2018-01-02T21:25:39.840Z
Ava Chow
<p>Let's say miner Moe mines a block taht is accepted by the network.  Moe presumably receives some Bitcoins in his wallet for this.  So let's say Moe "spends" that Bitcoin by buying some anti-poking goggles from Curly, even though his newly mined block is at the top of the chain and has no blocks on top of it.  Curly sends the goggles to Moe via FedEx.  Then another miner Larry mines a longer block and that replaces the original one Moe mined.  So now Larry has some Bitcoins.  So does the transaction between Moe and Curly disappear and Curly is left without a pair of goggles and with no Bitcoin?</p>

<transactions><blockchain><wallet><block>
What happens to a spent Bitcoin that was earned from a chain replaced by a longer chain?
Dave
# What happens to a spent Bitcoin that was earned from a chain replaced by a longer chain?

(Asked by: username_0 on 2018-01-02)

Let's say miner Moe mines a block taht is accepted by the network. Moe presumably receives some Bitcoins in his wallet for this. So let's say Moe "spends" that Bitcoin by buying some anti-poking goggles from Curly, even though his newly mined block is at the top of the chain and has no blocks on top of it. Curly sends the goggles to Moe via FedEx. Then another miner Larry mines a longer block and that replaces the original one Moe mined. So now Larry has some Bitcoins. So does the transaction between Moe and Curly disappear and Curly is left without a pair of goggles and with no Bitcoin?

**Tags:** transactions, blockchain, wallet, block


---

## 1 answers

### Answer by username_1 on 2018-01-02. Score: 1 | Accepted answer

Yes, Moe's transactions (both the coin creation one and the payment transaction) become invalid if Larry mines a conflicting blockchain that has more work (almost the same as longest, but not quite) than Moe's blockchain. So Curly would be without payment and Moe would have gotten himself a free pair of goggles.

Now if Moe and Larry were the same person this would be a Finney attack where Moe/Larry are intentionally defrauding Curly.

Of course there are built in safeguards to protect against this. Firstly, Moe cannot spend newly mined Bitcoins until 100 blocks have been mined on top of his block. But even if he did wait 100 blocks before transacting, Curly could still be defrauded.

The solution to this is for Curly to wait for the payment transaction to get a few confirmations. By waiting for confirmations, the amount of hashrate that Larry would need in order to change the blockchain to not include Moe's transaction greatly increases. After a few blocks, it is basically infeasible and thus it can be said that the transaction is permanent and cannot disappear.

> **Comments:**
> **username_2**: "But even if he did wait 100 blocks before transacting, Curly could still be defrauded." -- yes, but that would just be a regular double spend attempt.  A reorganization of 100 blocks is unreasonable.  After that much POW you can be assured that the block that mined the coins will stay in the chain.  
> **username_0**: "Firstly, Moe cannot spend newly mined Bitcoins until 100 blocks have been mined on top of his block" -- what exactly prevents this?  If Moe has hte Bitcoin adn Curly chooses to accept it (after being poorly advised not to wait for 100 blocks), what safeguard is there?  
> **username_1**: It is a consensus rule that prevents it. The transaction will be invalid. I suppose it doesn't matter if Curly accepts it even though it is unconfirmed.  
> **username_0**: But in my question Curly has accepted the Bitcoin before Larry has mined a longer block.  Or can this siutation never happen, since you mention Moe cannot spend newly mined Bitcoins until 100 blocks have been mined (which I'm guessing is part of the Bitcoin software)?  
> **username_1**: This situation is possible but easily avoidable.  
> **username_0**: Ok, then could you explain your comment "Firstly, Moe cannot spend newly mined Bitcoins until 100 blocks".  If my situation is possible it sounds like Moe could spend his Bitcoins immediately as long as there are a few suckers out there.  
> **username_1**: I misread your question. I thought Moe had mined a block containing that spend.  

---

