-
Notifications
You must be signed in to change notification settings - Fork 36
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
Deterministic Fee Computation #12
Comments
Do you mean we might also discard outputs in CETs? I was personally thinking of only discarding change outputs in the fund transaction. For CET and Closing, I think it makes sense to use constants, as I cannot really think of what could influence their size. For the fund transaction input size estimation, we use this function: https://github.com/cryptogarageinc/cfd-core/blob/master/src/cfdcore_transaction.cpp#L72 At the moment we assume that all input are just P2WPKH, but if we update the protocol we could easily support P2WSH as well. |
I'm quite confused as to why we wouldn't discard, for example, 0-amount outputs on CETs (in the case that one party wins all the funds). They are a pretty big privacy leak if we keep them. And if we are planning to remove them which I think we should this will affect the size of transactions and hence the fees. |
Good point, you are right that we should also discard them. Then the question is, do we take into account that there might be only CETs with single output in which case the fee added to the collaterals in the fund transaction will change, or do we always put the same fee regardless and just give the leftover to the winning party? I guess the former is a bit nicer, but also a bit more complex. |
During our meeting we decided not to change fees when outputs are removed due to them being dust. This is easier to implement as well as generally being a good idea when we move to multi-output CETs (when we have multi-party DLCs) |
Closed by #81 |
In transaction construction, both parties must always agree on the fee of a given transaction.
This requires we define a deterministic function
computeFee
that takes in an transaction and thefeerate
at time of the DLC offer message, and returns the fee in satoshis.I have opened this issue to allow there to be a place for the discussion of what this function should look like to happen.
Bitcoin-S currently uses the following static numbers to do CET and closing fee computations
Note that I haven't checked that they are correct in quite a while (and changes have been made) and also we should have different numbers when outputs are removed due to the dust threshold.
The text was updated successfully, but these errors were encountered: