Skip to content
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

Add absolute fee and fee rate sanity check in the Wallet API #1231

Open
Tracked by #87
notmandatory opened this issue Nov 28, 2023 · 3 comments
Open
Tracked by #87

Add absolute fee and fee rate sanity check in the Wallet API #1231

notmandatory opened this issue Nov 28, 2023 · 3 comments
Labels
discussion There's still a discussion ongoing enhancement New feature or request module-wallet

Comments

@notmandatory
Copy link
Member

notmandatory commented Nov 28, 2023

Describe the enhancement

A BDK wallet should check the absolute transaction fee and free rate when creating, and/or signing a transaction PSBT. There should also be a way to change or disable this fee rate check. I suggest we should make the maximum absolute fee the same as bitcoin core (0.1 BTC), and fee rate the same as what Liana chose (1_000 sats/vb), but defaults are open for discussion.

Use case

This would prevent BDK users from accidentally creating and signing transactions with very large, unreasonable transaction fees. This feature would improve our feature parity with the bitcoin core wallet.

Additional context

Discord comment from @darosior:

For what it's worth in Liana we have both an absolute fee (1BTC) and feerate (1_000 sat/vb) sanity checks: https://github.com/wizardsardine/liana/blob/7bfc53890aa1466b0fee413d7373cbd05fd22a19/src/commands/mod.rs#L213-L238. Bitcoin Core has a 0.1BTC maximum absolute fee sanity check iirc, but you can tweak it. I agree BDK should have one. Any wallet software intended to be used with real funds should have such sanity checks.

@notmandatory notmandatory added enhancement New feature or request discussion There's still a discussion ongoing labels Nov 28, 2023
@nondiremanuel nondiremanuel added this to the 1.1.0-alpha.0 milestone Dec 5, 2023
@nondiremanuel
Copy link

Assigned to 1.1 for the moment (during Lib Team Call)

@ValuedMammal
Copy link
Contributor

Another creative approach would be to warn if the fee exceeds a fixed % of the total send amount

@darosior
Copy link
Contributor

darosior commented Jan 7, 2024 via email

@notmandatory notmandatory removed this from the 1.1.0 milestone Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion There's still a discussion ongoing enhancement New feature or request module-wallet
Projects
Status: Todo
Development

No branches or pull requests

4 participants