New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When does receiver revoke? #567

Open
OrfeasLitos opened this Issue Feb 4, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@OrfeasLitos
Copy link
Contributor

OrfeasLitos commented Feb 4, 2019

Consider a channel between Alice and Bob. Alice sends update_add_htlc, Bob replies with commitment_signed and Alice revokes her old state with revoke_and_ack. But Bob hasn't revoked.

When will he revoke? Is Alice supposed to send a commitment_signed, to which he will reply with revoke_and_ack?

If it is so, where exactly is it specified? If not, what should happen instead?

@ysangkok

This comment has been minimized.

Copy link
Contributor

ysangkok commented Feb 20, 2019

It doesn't make sense to say that Bob replies to update_add_htlc with commitment_signed. That HTLC is to be committed in Bob's ctx before it can be committed in Alice's, and since commitment_signed signs the other's ctx, a commitment_signed sent after receiving an update_add_htlc will not include the HTLC.

It makes sense to revoke right after receiving commitment_signed, since you'd want the other party to have the progress of the channel confirmed. It would make sense to close channels with peers that don't send revoke_and_ack in a timely manner. Probably the reason why some of this is not specified is because it follows from the game theory. At any point in the protocol can any party stop cooperating, but the protocol has been designed such that if you implement proper checks and timeouts, you can close and thereby avoid wasting time on broken peers. You can always count on people acting in a way that maximises their gains.

BOLT-02 does contain "MUST respond with a revoke_and_ack message.".

Is Alice supposed to send a commitment_signed, to which he will reply with revoke_and_ack?

Yes

@OrfeasLitos

This comment has been minimized.

Copy link
Contributor Author

OrfeasLitos commented Feb 20, 2019

Thanks for the explanation. There's one thing I'm not sure:

That HTLC is to be committed in the Bob's ctx before it can be committed in Alice's

Why the before? If I were Bob, I'd be very happy if Alice irrevocably commited to a ctx that contains an htlc that potentially pays me; that's an improvement compared to the previous state, where the htlc coins simply belonged to Alice. (Of course I'd also like to have the ability to unilaterally redeem that htlc in case I learn its preimage, so I'll be even happier when I receive Alice's commitment_signed, but that shouldn't be directly relevant.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment