Welcome to the discussion thread about this lecture section. Here you can feel free to discuss the topic at hand and ask questions.
In “Accidental Forks” video at 8:17 you said that if my transaction is in a stale block then I will lose my money. But if I’m correct, that transactions will get back to mempool, so nothing is lost, just that transaction will be confirmed a bit later on the “longer”/valid chain. Am I right?
Hi, good question. I took a look at the video but didn’t actually find the part where Ivan mentioned that you will loose your money.
You are correct, the tx will go back to the mempool. What can happen however is that a payment that you have received could be taken away from you. Let’s say you’re an online store and you sell digital goods. If you get a tx sent to you, you send the product to the customer, then the tx happens to be in a stale block.
If the sender has bad intent and removed the tx from the mempool, you as a receiver of crypto have now lost your money. But this almost never happens of course. But this is one of the reasons you should wait 6 confirmations.
Thank you for the answer - now it is absolutely clear.
How can you remove your tx from mempool?
I assume you mean from the senders perspective, and not the nodes perspective. As a sender you have 2 options in order to “cancel” a transaction. There is no easy way to cancel, and no built in method to do so, so both of these are sort of workarounds.
Replace by fee. You can replace/edit your transaction if your wallet support RBF(replace by fee). Then you can edit it so that the funds just go back to you.
Double spend. You can submit a new transaction with a higher fee. This transaction spends the same UTXO as your earlier transaction, but will hopefully be confirmed before your previous tx. But this is not guaranteed.
Here’s a link to a post going into more detail about the nature of stale blocks which occur with accidental forks. It turns out that they aren’t literally “thrown away”, more “disregarded temporarily”, but they’re still kept by the nodes as valid blocks and monitored in case they need to be “re-activated”.
The post itself is within a longer thread, where I was asking about how nodes validate blocks and update their version of the blockchain. As it also delves into a more detailed analysis of stale blocks, I thought it would be helpful to include a link to it here. Check out the whole thread if you think it may be of interest