0

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?

1

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.

  • 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 Oct 15 '17 at 12:33
  • 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. – Pieter Wuille Oct 15 '17 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.