Post
Topic
Board Development & Technical Discussion
Merits 13 from 6 users
Re: Mastering the Lightning Network book
by
Rath_
on 13/01/2023, 22:56:08 UTC
⭐ Merited by BlackHatCoiner (4) ,ETFbitcoin (4) ,Welsh (2) ,darkv0rt3x (1) ,n0nce (1) ,DdmrDdmr (1)
So to avoid it you need to broadcast the most up-to-date settlement transaction to the network.
Again, there's a period of time after B broadcasts such a state (closes the channel unilaterally), during which you can come back online and provide a newer state (state 2).

Actually, you don't broadcast another commitment transaction. If that was the case then there would not be any punishment.

Every commitment transaction has at least two outputs (to_local and to_remote).

to_remote refunds the other party their share of funds. This output can be spent immediately.
to_local refunds the person who broadcast the commitment transaction their balance. This output can be spent:

1) after X number of blocks have been mined since this commitment transaction was confirmed, where X is usually 144 blocks by default,
2) immediately using revocation private key and other party's signature.

So if A attempts to cheat and broadcasts an outdated commitment transaction, B can construct a penalty transaction which consumes A's to_local output and sends it to their wallet.

How does B know the revocation private key? Well, it's complicated. Long story short, when both parties sign a new commitment transaction, they exchange secrets (in a specific order) which can be used to generate the revocation private key.