lightninglabs / taproot-assets

A layer 1 daemon, for the Taproot Assets Protocol specification, written in Go (golang)
MIT License
439 stars 106 forks source link

[feature]: Estimate transaction fee after Bitcoin UTXO input selection #902

Open vanditshah99 opened 1 month ago

vanditshah99 commented 1 month ago

It would be of great help to estimate onchain fees for sending asset to an address, fields like total sats and sats/vbyte or sats/kw would help us estimate what the fees citing to number of inputs used to felicitate the transactions.

guggero commented 1 month ago

Thanks for creating the issue.

Some context from chat: Main issue is that it is not easy to figure out how many on-chain inputs are required to spend enough assets to a given Taproot Asset address, as multiple asset carrying inputs might need to be spent. So under the hood this RPC should fund the address send, see how many inputs and outputs are required and then return a total fee amount (and the fee rate used to calculate, based on lnd/bitcoind's estimated fee rate).