btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.1k stars 2.31k forks source link

Higher fee: TX rejected: transaction 0f076...00c8 has insufficient priority #1992

Open lenhatquang97 opened 1 year ago

lenhatquang97 commented 1 year ago

Situation

I have created custom transaction with embedding file like the way Ordinals works for my thesis. However, transaction fee is very high so that I need a lot of money in testnet for confirmation. How can I calculate the fee in an correct way and how can I decrease the fee in btcd?

Example

A transaction with 339 KB with Ordinals costs 85750 satoshi, while the fee in btcd can be up 494000 satoshis (with the formula feeRate * tx.SerializedSize() (feeRate is taken from EstimateFee API and multiply with 100000 to convert from BTC/KB to satoshi/byte).

Error

-26: TX rejected: transaction 0f076c7a0fa6e300596041b1f85df6e707630b9141445fc4e77f9915b52e00c8 has insufficient priority (9924.459770114943 <= 5.76e+07)