-
Notifications
You must be signed in to change notification settings - Fork 491
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
BOLT 2: closing tx fee clarifications #194
BOLT 2: closing tx fee clarifications #194
Conversation
You can't eliminate an output and also guarantee a certain fee, so we need to define exactly how to do this. Since the output is (presumably) dust, we might as well just discard it (effectively increasing the fee). This avoids the peer directly benefiting from the elimination as well. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…l fee. The actual fee of the final tx may include eliminated outputs, which can differ between one side and the other (since they have different thresholds). Simplify this corner case by using our base fee calculation as the upper bound; it should be close enough we don't care, but disagreement here could cause negotiation breakdown. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
paying `fee_satoshis`, without populating any output which is below | ||
its own `dust_limit_satoshis`. The sender MAY also eliminate its own | ||
paying `fee_satoshis`, then removing any output which is below | ||
its own `dust_limit_satoshis`. The sender MAY then also eliminate its own |
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.
My brain hurts... 😣
Doesn't this invalidate the second either clause of the following paragraph?
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.
To me this reads as "create signature for transaction before removing output" ... "then remove the output".
Wouldn't it be better to add something similar to your comment, @rustyrussell: "we calculate fee then remove outputs, not remove outputs then calculate fee." That is much less ambiguous :)
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.
Agreed that this paragraph is pretty confusing. Here's a slightly re-worked version that I think we'll all find mouc more explicit:
The sender MUST set
signature
to the Bitcoin signature of the channel
closure transaction. The setfee_satoshi
fee should be subtracted from
the output of the node that was responsible for paying the bitcoin fees
during the lifetime of the channel. When calculating the amount of
satoshis to subtract from the fee payer's output the absolute fee should
be calculated first, then any trimmed outputs removed. Each trimmed output
should contribute to (reduce the) the fee value explicitly subtracted from
the fee payer's output. The sender MAY also eliminate its own output
from the mutual close transaction.
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.
@Roasbeef Hmm, that's backwards from what I meant. Trimming dust doesn't change inputs, so yeah, it effectively ups the fee paid. This is the same logic we use for commit txs.
But as agreed, will merge, and then the move to BOLT 3, and re-open another PR for clarification if we still need it...
Pierre-Marie Padiou <notifications@github.com> writes:
pm47 commented on this pull request.
>
The sender SHOULD set the initial `fee_satoshis` according to its
estimate of cost of inclusion in a block.
The sender MUST set `signature` to the Bitcoin signature of the close
transaction with the node responsible for paying the bitcoin fee
-paying `fee_satoshis`, without populating any output which is below
-its own `dust_limit_satoshis`. The sender MAY also eliminate its own
+paying `fee_satoshis`, then removing any output which is below
+its own `dust_limit_satoshis`. The sender MAY then also eliminate its own
My brain hurts... 😣
Doesn't this invalidate the second either clause of following paragraph?
No, this just clarifies that we calculate fee then remove outputs, not
remove outputs then calculate fee. We can still disagree with the other
side on what outputs should be removed...
We should probably move the construction of the closing tx to BOLT #3
with the other transactionsm even though it's pretty trivial. This was
a lesser change, however.
Hope that helps,
Rusty.
|
As I understand it, we are now explicitely saying that the signature sent should have outputs above the remote's I agree that this should be done in BOLT 3 |
You can't eliminate an output and also guarantee a certain fee, so
we need to define exactly how to do this.
Since the output is (presumably) dust, we might as well just discard it
(effectively increasing the fee). This avoids the peer directly benefiting
from the elimination as well.
There are two final commitment transactions, which can be different if each side has a different
dust level. Make it clear that the max fee must be less or equal to the base fee, not the actual
(post-output-elimination) fee. This means it could be marginally higher than the final fee in theory,
but in practice it's a tiny effect at worst.