What happens to your transaction if….

Hanging out in beginner fora, I have had a lot of question that begins with the above header. I thought I’d share some answers.

First thing to remember is that you as the sender decides the route your payment takes.

 

What happens if the destination goes away before the payment reaches it?

Relax: No money is transferred. The last hop will most likely send an error message back in your direction, saying “oops! I don’t know how to route this!”. Now, all reservervations will be cancelled.

But even if there is no such cancellations, there is no money transferred. When you pay an LN invoice, you don’t send money directly. You send a message which basically says: “If you can prove that you have paid it, I will pay you this amount”. The genial thing? The message you send along with the proof that’s it paid is enough to claim it, on-chain, if everyone else stops cooperating. This promise of course have a time limit, your funds will not be locked in this promise forever.

So, if the destination goes away, noone will get the “proof that it’s paid”, and noone can claim any money from you. The same claim will happen along each routing step too, so all other reservations will also go away when a payment fails to reach its destination.

What happens if a node in the middle goes away before your payment is fully done?

If a node in the middle goes away before it has forwarded the promise to pay, it will be the same situation as in the first case. Noone will be able to get the proof that it’s paid, so no money can be claimed from you.

If a node in the middle goes away after it has forwarded the promise to pay, the nodes after can get the proof that the payment is done. The node after the disappearing node can end up in the situation that he has sent a payment, to the reciever, but haven’t been able to send the proof to the sender yet. This is where the timelocks come in handy. It’s safe to wait for a while, but eventually the last node who has paid fully but haven’t yet been able to claim funds will notice that the promised funds will soon expire. The said node have enough information that it can force-close the channel with the missing node, and get all the money he is owed. Your node will not have done a payment, but the receiving end have fully gotten his payment. In this case, the missing node have in effect paid the invoice. The implication is that if you route transactions, you run the risk of having paid an invoice but not having claimed the funds if you keep your node down too long. The chance of this isn’t that high, but it’s there.

 

What happens if you go away before your channel partner can claim the funds?

This is in essence the same case as the previous question. Your channel partner will wait for as long as he deems safe, but if you don’t come back and reactivate the channel so that he can claim his funds, he’ll have to force-close the channel with you, eventually. Remember: You have given him enough information so that he can do that, if he have the proof that the payment all the way to the end is done.

Conclusion?

No payment is done before the reciever says it’s paid! Without that, everything can and will return to the original balances. If the receiver says it’s paid, but someone in the path back to the sender doesn’t respond, he will be the one losing money. Noone can steal anyones money, but by keeping your node down, you can risk not being able to claim money you’re entitled to if you have routed transactions. So, keep your node running, plan downtimes well, and minimize downtime, and you should be fine.

Leave a Reply

Your email address will not be published. Required fields are marked *