pooler / electrum-ltc

Electrum-LTC Litecoin wallet
https://electrum-ltc.org
MIT License
198 stars 102 forks source link

Transaction fee minimum question #73

Closed pingram3541 closed 6 years ago

pingram3541 commented 7 years ago

I recently received some LTC in my wallet that was a total transaction size of 226 bytes. Looking at the transaction details I can see the fee paid was only .000226 which is about 1/5 of the fee I've always known to be as .001, the minimum otherwise considered dust if any smaller.

Additionally if I try to adjust the fee to anything less than .001 the wallet forces a warning and doesn't let you proceed. At least it won't let me preview until I get the fee to .001 then I can inspect the transaction and see the size is 192 bytes.

Can you explain why someone can send me a 226 byte transaction and only pay .000226 while I send a 192 byte transaction and am forced to pay 5 x that cost?

I know currently .001 is only about .05c but just trying to reduce my micro transaction fees when sending out a lot of them. TY

pooler commented 7 years ago

Electrum-LTC currently uses a fee computation algorithm that is backwards compatible with Litecoin Core 0.10. This algorithm, which if I remember correctly was introduced in 0.8, rounds transaction sizes up to the next kilobyte. Additionally, there is a penalty for any output less than 0.001 LTC. Litecoin Core 0.14 apparently reverted to an algorithm that is closer to Bitcoin's, which explains the lower fees.

pingram3541 commented 7 years ago

So with electrum-ltc, without refactoring the wallet's code and possibly not being backwards compatible with Core0.10, .001 is the minimum fee for any transaction using this wallet?

pooler commented 7 years ago

Technically it is possible to send a transaction without a fee if the priority conditions are met. This is not recommended any more, though, because some nodes may not relay it.

pingram3541 commented 7 years ago

Ah ok, thanks for taking the time to clear this up for me. So if the coin is old enough you can force a "no fee" transaction otherwise we round up by .001 for each 1kb in the transaction? Does that mean that a transaction size of 1.1kb would also round up as well, to .002?

pooler commented 7 years ago

Basically, yes. But as I said, this is being phased out.

3ntranced commented 6 years ago

A fee limit is being phased out of electrum-ltc or transactions fees lower than 0.001 are being phased out of litecoin core? This point is unclear to me.

pooler commented 6 years ago

@3ntranced, the more complex fee algorithm which I outlined above is being phased out of Electrum-LTC because Litecoin Core abandoned it. The "new" fee system generally results in lower fees (as noted by the OP), but gets rid of the concept of priority, so zero-fee transactions are not a possibility any more.

Since the change has already been merged, I'm closing this ticket.

3ntranced commented 6 years ago

I still dont understand why with loafwallet I can send 0.1L and pay 0.000113L as fee, and electrum forces me to pay 0.001

pooler commented 6 years ago

@3ntranced: it's simply because Electrum-LTC 2.9.3.1 still conforms to the fee policy that the Litecoin network used for years until recently, while other software may not.

By the way, the amount a transaction spends has no effect on fees, so it doesn't matter if you're sending 0.1 LTC or 1000 LTC. What matters is the transaction's size in bytes (and input priority, but as I said this is being phased out).

pingram3541 commented 6 years ago

Great, can't wait. Any tips on consolidating a boat load of .25-50c inputs?

3ntranced commented 6 years ago

Yes I do understand about the irrelevance of the amount sent, I shouldn't have mentioned it. Forgive me for going on and on but I am still not quite clear though if what you are saying is that in future releases electrum-ltc will have a 0.001L fee limit or not. Reading the change in fee policy https://blog.litecoin.org/litecoin-core-v0-14-2-release-ab6d2217405f also doesn't shed much light on whats the future for fees. There is a default min fee that miners are setting, is that the case?

pooler commented 6 years ago

@3ntranced, the current Electrum-LTC code (the one in this repo) happily creates transactions with fees below 1 mLTC. The same will probably also be true for the next release.

There is a default min fee that miners are setting, is that the case?

Every miner can decide independently which transactions to include in a block, but of course defaults in the reference software do matter.

3ntranced commented 6 years ago

It does indeed, thank you

mautematico commented 6 years ago

Since the change has already been merged, I'm closing this ticket.

Could you point us to said change, please?

pooler commented 6 years ago

@mautematico, fee estimation changed quite a bit in Electrum 3. These changes are spread across several commits, but the most significant is probably b3dcc31.

ssvb commented 6 years ago

The electrum-ltc site still says Latest Version: 2.9.3.1 (released 2017-08-17), which does not contain this transaction fee reduction change. This drives the average transaction fee up for the LTC network and makes it look worse than BCH in the median and mean charts at the bitinfocharts.com site. BCH supporters/promoters are very happy about this and are using this fact to promote their coin, you can see this recent reddit post for example. Unless this is addressed ASAP, the "BCH has lower fees than LTC" myth will be very hard to debunk in the future because it is getting propagated via mainstream media now.

ssvb commented 6 years ago

What I mean is that until there is a formal electrum-ltc release with this fix included, the issue can't be considered fully resolved. Because not many people are using the latest source code from git.

ssvb commented 6 years ago

Thanks for making a formal release and pushing it out, even though it was an unrelated critical security bugfix rather than an attempt to address the fees situation. Now the median LTC transaction fee went down and remains at the expected 0.001 LTC/kilobyte (or ~0.000226 LTC/transaction) level for 3 days in a row since 2018-01-07: ltc median transaction fee 2018-01-09 https://bitinfocharts.com/comparison/median_transaction_fee-bch-ltc.html#3m

Good job! This issue is fully resolved now.