ellemouton / website

https://ellemouton.com/
0 stars 1 forks source link

posts/normal-operation-pre-taproot/ #9

Open utterances-bot opened 12 months ago

utterances-bot commented 12 months ago

Normal operation and closure of a pre-taproot LN channel | Elle Mouton

A deep-dive into the normal operation and closure of a pre-taproot Lightning Network channel

https://www.ellemouton.com/posts/normal-operation-pre-taproot/

yuyaogawa commented 12 months ago

Great article! Thank you for writing this article.

I lost you around Step 16 to 17. Bob's staging area at Step 17 is different from the one at Step 16. Why are A1, A2 and A3 HTLCs in Bob's staging area removed with revoke_and_ack at Step 17?

ellemouton commented 11 months ago

Hi @yuyaogawa!

Ok Bob has already sent an update_fulfill, update_fail and update_fail_malformed to Alice for HTLCs A2, A1 and A3. However, in step 16, he has not received an ACK from Alice for these updates. So he does not yet know if she has received them or not so he has kept them around in his staging area tx incase Alice sends updates. Bob then sends the commitment_signed in step 16 and then in step 17 when Alice responds with revoke_and_ack, this acknowledges to Bob that his updates were received by Alice. And so he can then remove them from his staging area

vladimirfomene commented 11 months ago

Thank you Elle! For putting this out.

yuyaogawa commented 11 months ago

in step 17 when Alice responds with revoke_and_ack, this acknowledges to Bob that his updates were received by Alice. And so he can then remove them from his staging area

Ah, I got it. Thanks!

arik-so commented 10 months ago

Your post inspired me to create a Gist for my own reference whenever I'm confused about the state machine :) https://gist.github.com/arik-so/fa50dd94993241d7c1185c7789abf02e

ellemouton commented 10 months ago

oooooo very cool @arik-so!!

trevlt commented 9 months ago

Is it possible for one side to have 3 or more unrevoked commitment transactions? For instance, after step 4 Bob has 2 valid commitment transactions, but what if Alice sends new update_add_htlc and then commitment_signed. In this case Bob would have 3 valid unrevoked commitment transactions.
Is this possible? Can't find this info in the BOLTs.

ellemouton commented 9 months ago

@trevlt, so the BOLTS (specifically bolt 2) does say that once a node receives commitment_signed then it "MUST respond with arevoke_and_ackmessage.".

And even if it did not, I dont think there is an incentive for Alice to send a new commitment_signed before receiving a revoke_and_ack for the previous one since this would only be detrimental to her and cant be used in a malicious way by her

Chinwendu20 commented 2 months ago

Thanks a lot for the article, your blogs are def a holy grail for LN.