-
Notifications
You must be signed in to change notification settings - Fork 311
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
Feerate should be returned from Transaction construction #524
Comments
|
Just want to comment to say that this is also a feature I'd use if implemented. |
I am giving this issue a try and have a few thoughts: Transaction size can be useful since you can calculate the fee_rate with it. When using create_tx does it make sense to have Some(Transaction) always returned so its easy to calculate size? Or we can just have size as a field in TransactionDetail? fee_rate helps too but feels repetitive since there is already a fee field. Edit: (weight + max_satisfaction_weight)* instead of size* |
Even if you did that tx doesn't have the correct weight since it is missing signatures. |
The max satisfaction weight from the descriptor would give you that, right? |
If all the inputs are yours and you know which input had which descriptor. But in general no. |
I think we're bumping into a related issue when we attempted to RBF bump a transaction on bdk-ffi/Kotlin. BIP 125 says that nodes will relay transactions for which the fees are bumped by at least the amount of the minimum transaction relay rate, i.e. if the minimum is 1 sat/vbyte your "currently paying" 3.0 sat/vbyte transaction will need to have a replacement transaction with at least 4.0 sat/vbyte to be related by nodes. But since we don't know the feerate, calculating how much fees should be added to the RBF replacement transaction is not straightforward (I assume it's doable by looking at nominal fee paid and raw transaction size but having it returned explicitly as part of the transaction would make it much easier). |
@LLFourn we've been looking at ways to provide this fee rate to the user in the bindings. Is #728 helpful for your use case? It's not providing the fee rate before the user signs the tx, but it's making it easy to retrieve it from the signed PSBT (as opposed to opening up the |
@thunderbiscuit I think you wan to know the feerate before you sign it so you know what you are actually signing. Having those methods on PSBTs seems useful but doesn't quite solve this issue. |
When you get TransactionDetails from
tx_builder.finish()
it has the fee for the overall transaction but does not include the feerate of the resulting transaction. There is no simple way for the caller to replicate this information since the transaction does not have witness data at this point. This is annoying because after constructing the psbt the user should know the feerate before signing it.This can either be done by returning another value from
builder.finish()
or by adding a (perhaps optional) field toTransactionDetails
.The text was updated successfully, but these errors were encountered: