<p>It is perfectly possible, and it is why it is discouraged to take irreversible action based on transactions that are unconfirmed (=not in a block yet).</p>

<p>However, the transaction is not invalidated just because it is reversed. Another miner can still include it at a later time, unless you issue a conflicting transaction  (=double spend) with a higher fee.</p>

CC BY-SA 3.0
2017-10-15T12:33:55.370Z
thank you, but how could another miner can still include it at later time?
I thought that the transaction that I bought coffee is already on the chain (it's modified transaction, but others do not know it's fake) so they consider the transaction already validated and won't try to include it again later.
Or there's a mechanism that can help others detect the modified transaction which is already on chain, finding that its fake? If no such mechanism, does it mean that I cheat successfully(i.e. modify the transaction and push onto the blockchain, and no one knows, thus I can do double spending)
Ren
CC BY-SA 3.0
2017-10-15T12:37:16.900Z
I mean that the original transaction that paid for the coffee can always be included in a later block by another miner *unless* a double-spend was done.
Pieter Wuille
CC BY-SA 3.0
2017-10-15T11:49:13.147Z
2017-10-15T11:49:13.147Z
Pieter Wuille
<p>For example, I pay a cup of coffee with bitcoin, and later remove that transaction from the pending block that is not yet on chain. After 10 mins, I successfully and luckily solve the PoW problem, and broadcast the modified block to everyone as well as append it to the blockchain.</p>

<p>Is the scenario above possible? If it is, how is it prevented?</p>

<blockchain><proof-of-work>
Miner modify pending block (not yet on chain) and successfully solve the PoW
Ren
# Miner modify pending block (not yet on chain) and successfully solve the PoW

(Asked by: username_0 on 2017-10-15)

For example, I pay a cup of coffee with bitcoin, and later remove that transaction from the pending block that is not yet on chain. After 10 mins, I successfully and luckily solve the PoW problem, and broadcast the modified block to everyone as well as append it to the blockchain.

Is the scenario above possible? If it is, how is it prevented?

**Tags:** blockchain, proof-of-work


---

## 1 answers

### Answer by username_1 on 2017-10-15. Score: 1 | Accepted answer

It is perfectly possible, and it is why it is discouraged to take irreversible action based on transactions that are unconfirmed (=not in a block yet).

However, the transaction is not invalidated just because it is reversed. Another miner can still include it at a later time, unless you issue a conflicting transaction (=double spend) with a higher fee.

> **Comments:**
> **username_0**: thank you, but how could another miner can still include it at later time? I thought that the transaction that I bought coffee is already on the chain (it's modified transaction, but others do not know it's fake) so they consider the transaction already validated and won't try to include it again later. Or there's a mechanism that can help others detect the modified transaction which is already on chain, finding that its fake? If no such mechanism, does it mean that I cheat successfully(i.e. modify the transaction and push onto the blockchain, and no one knows, thus I can do double spending)  
> **username_1**: I mean that the original transaction that paid for the coffee can always be included in a later block by another miner *unless* a double-spend was done.  

---

