<p>I am currently working on a project that requires multiple users using lightning network to generate and pay invoices through my website but I want to be able to calculate each user's transaction fee when he/she wants to withdraw his/her balance from the platform central lightning balance.</p>

CC BY-SA 4.0
2023-11-06T15:42:45.120Z
What have you tried so far and how did the outcome differ from your goal? Are you stuck on calculating the size of the transaction in advance, on getting the feerate that would let the transaction confirmed in a timely fashion, or getting the fee information before building the transaction? Have you considered a flat fee? Have you had a look at other topics, e.g. https://bitcoin.stackexchange.com/a/110419/5406, https://bitcoin.stackexchange.com/a/102378/5406
Murch
CC BY-SA 4.0
2023-11-07T16:06:01.873Z
@Murch So far, I was able to get the estimated fee rate based on the number of blocks however, I need to be able to calculate the size in order to determine the fee. If there's a way I can get the number of inputs utxos for the transaction, I know fully well that the max output I can have is 2 so I can determine the fee to pay before making the transaction.
Topman
<transaction-fees><lightning-network><lightning-network-daemon><withdrawal><fee-estimation>
Determine the amount to pay to send bitcoin from lnd (lightning network) to on-chain address
Topman
# Determine the amount to pay to send bitcoin from lnd (lightning network) to on-chain address

(Asked by: username_0 on 2023-11-04)

I am currently working on a project that requires multiple users using lightning network to generate and pay invoices through my website but I want to be able to calculate each user's transaction fee when he/she wants to withdraw his/her balance from the platform central lightning balance.

**Tags:** transaction-fees, lightning-network, lightning-network-daemon, withdrawal, fee-estimation

> **Comments:**
> **username_1**: What have you tried so far and how did the outcome differ from your goal? Are you stuck on calculating the size of the transaction in advance, on getting the feerate that would let the transaction confirmed in a timely fashion, or getting the fee information before building the transaction? Have you considered a flat fee? Have you had a look at other topics, e.g. https://bitcoin.stackexchange.com/a/110419/5406, https://bitcoin.stackexchange.com/a/102378/5406  
> **username_0**: @username_1 So far, I was able to get the estimated fee rate based on the number of blocks however, I need to be able to calculate the size in order to determine the fee. If there's a way I can get the number of inputs utxos for the transaction, I know fully well that the max output I can have is 2 so I can determine the fee to pay before making the transaction.  

---

## 0 answers

