Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Update closing_signed fee requirement #847
Update closing_signed fee requirement #847
Changes from all commits
69a11c2
f029164
8683525
c990020
034486c
aaae6bc
92d2af0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this imply that you are allowed to send multiple
closing_signed
messages without "waiting your turn" if you send bad fee ranges? If so, this interacts with musig2+taproot channelsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is not a turn-based protocol, the initiator may send another
closing_signed
with a different fee range.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, legacy coop close is turn-based, but fee_range isn't?
What is the rationale to make this not turn-based? Shouldn't the recipient of a fee_range ensure that the sent fee_range has overlap, or else don't send one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,
fee_range
allows the funder to update itsfee_range
if the fundee doesn't respond or sent a warning.If you make it strictly turn-based you end up with exactly the previous closing protocol, which
fee_range
tries to simplify.But that's exactly the "don't send one" part that creates the issue and requires the protocol to allow the sender to send a new one out of turn. The only other option is to force-close, which is undesirable.
I don't see why this is an issue for Taproot. If a sender sends a second
closing_signed
, it just throws away the previous state and the receiver does the same. There is an issue if the receiver was concurrently sending itsclosing_signed
, but in practice 1) it's very unlikely 2) it will result in a force-close which is okay-ish.A better longer term plan is to migrate closing to use the
interactive-tx
protocol.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reading the spec the non-turn-based aspect wasn't immediately clear to me.
specifically for taproot there is no issue, but for the proposal here #995 it is incompatible with fee_range unless some amount of nonces are shared up front or a deterministic nonce scheme is used (I think determinism is undesirable since if you mess up the scheme and re-use a nonce, you've leaked your private key).
the issue boils down to:
closing_signed
until the receiver has sent theirclosing_signed
. This is because the sender has effectively used up one of the receiver's nonces and does not know which nonce to use next. This isn't a problem if the flow is turn-based as the receiver will send over the nonces that the sender can use next. This issue doesn't exist during regular channel operation since a sender cannot send twocommit_sig
in a row without arevoke_and_ack
in between.that said, my question is answered so i'll have to think a bit more on what to do re #995
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now that you've answered my question in that A (funder) is the one that sends multiple closing_signed if B sends a
warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry for the late reply. There are two possible flows for
fee_range
closing. The first is the happy flow:closing_signed
closing_signed
inside thefee_range
proposed by A (B is not allowed to answer with a fee outside of A'sfee_range
)closing_signed
with the same fee as the previous messageThe second possible flow is the unhappy flow where B isn't satisfied with A's
fee_range
:closing_signed
fee_range
, sends awarning
closing_signed
warning
closing_signed
fee_range
, responds withclosing_signed
closing_signed
with the same fee as the previous messageWe can make that strictly turn-based by having Bob send a new message (e.g.
reject_closing_signed
) to express his disagreement with thefee_range
(instead of awarning
), in which case we could have nonces in both messages.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is also the 2-message case where:
fee_range
[100, 200],fee_satoshis
=150fee_range
[120, 180],fee_satoshis
=150The previous idea I was working with was to get rid of signatures in some cases, but it turns out to be complicated given the different message flows. I think a reject message is actually better, but A must only be able to send
closing_signed
after receipt, so it is essentially coop close v3.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind doing a coop close v3 for taproot, with a more strictly specified protocol if it's easier than tacking it on to the existing one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right I dont mind either, I can draft some coop changes to add onto @Roasbeef taproot proposal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to gravedig, but what is meant by overlap here? Is it the union of the two ranges or the intersection? If it's the intersection of the two ranges, then the statement a bit above
if fee_satoshis matches its previously sent fee_range:
could make this "overlap" statement redundant by changing the SHOULD to a MUST?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, overlap means intersection. We can make the
SHOULD
aMUST
, that would make sense.