nbd-wtf / trustedcoin

A lightningd plugin that replaces bitcoind with trusted public explorers.
MIT License
61 stars 15 forks source link

different/changing fee estimates #9

Closed ghost closed 3 years ago

ghost commented 3 years ago
  1. if you type lightning-cli estimatefees multiple times - the fees jump from one second to the other. i guess this is because the 3 esplora instances return different feerates
  2. the estimates are different from what bitcoind would give as a backend which can lead to some side effects (peers not agreeing on fees for example, leading to closed channels)

the first point i could solve with just using one esplora backend (which kind of makes it less reliable if that backend goes bust, but would be kind of okay) - but i am not sure about the second point. would it be possible to use bitcoind for the estimatefees call and the esplora instances for the rest, especially getting the blocks? i would like to use trustedcoin with a pruned bitcoind backend

i also looked into btc-rpx-proxy (which would support getting missing blocks), but failed to run it on openbsd

edit: maybe i could use something like https://github.com/Toorop/go-bitcoind edit2: maybe i can tweak trustedcoin itself here to get similar feerates

fiatjaf commented 3 years ago

Yeah, I wanted that too actually. Use bitcoind to publish transactions, get block hashes and estimate fees, but trustedcoin to fetch the full blocks. However that requires an entirely new plugin.

The default bcli thing to be rewritten and then we just swap out the blocks part for the trustedcoin one. It's easy, but I didn't have time yet.

If you want to tackle that, I would recommend maybe copying code from trustedcoin and from this bcli rewrite: https://github.com/niftynei/glightning/blob/master/examples/plugin/pl_btc/btc.go

ghost commented 3 years ago

awesome - thanks for the link. i will see what i can do and if it is also easy for me to implement. will update here if i have something to show

ghost commented 3 years ago

i implemented this in the most reckless way (depending only on blockstream.info and not verifying blocks) - it works for some hours now with my node. will probably add something similar used by trustedcoin (more explorers and validate the blocks): https://git.dalliard.ch/trustme/

will close this, because it is not really an issue with trustedcoin