edge-currency-bitcoin icon indicating copy to clipboard operation
edge-currency-bitcoin copied to clipboard

Custom mining fee is not properly translated due to incorrect transaction size estimate

Open Empact opened this issue 7 years ago • 1 comments
trafficstars

I set a custom mining fee of 1 sat/b, and it was rejected due to network rules. Then set the value to 2, and it passed, but on a the receiving wallet (electrum) it was listed as 1.7 sat/b.

Seems the size estimation is significantly off for the transaction type in question. This was sending from a single 3-address to a single bech32 address with a single change output.

Electrum lists the size as 165 bytes, but the fee implies a size estimate of 137 bytes.

Empact avatar Apr 21 '18 19:04 Empact

I think there is some confusion about what "bytes" mean. When dealing with segwit transactions, witness data costs less than regular data. Therefore, a transaction can have two sizes - a real size, and a price-adusted size. I think Edge is using the price-adjusted size in its sat/byte calculation, but Electrum is using real size.

It may be that the Bitcoin network itself is using the "real size" to enforce its 1 sat/byte rule. In that case, using the price-adusted size in Edge would be a mistake. @thehobbit85, are you familiar with this?

swansontec avatar Apr 22 '18 05:04 swansontec