breadwallet / breadwallet-android

The Android version of the Bread bitcoin wallet.
MIT License
387 stars 424 forks source link

[Educational] how the wallet manages the network fees? #178

Closed dabitdev closed 3 years ago

dabitdev commented 3 years ago

hi,

I would like to have more visibility about what classes/files are involved in the calculation of the network fee and if there is server api involved in the process of exposing to the user the Economy, Regular and Priority. Finally, how it is everything working when there is a high congestion on the BTC network.

Best, David

DrewCarlson commented 3 years ago

Fee data is provided by Blockset and maintained by WalletKit at runtime. Application code uses a duration for each fee tier (e.g. Economy=7h or Priority=1m) and attempts to find the value which will allow the transaction to completed in that time. Times for the fee tiers are in the TransferSpeed. You can see the realtime fee values from Blockset here.

dabitdev commented 3 years ago

Thank you DrewCarlson! you are always helpful.