libbitcoin / libbitcoin-explorer

Bitcoin Command Line Tool
Other
601 stars 177 forks source link

Detect fees #673

Closed xloem closed 4 years ago

xloem commented 4 years ago

Is there some way other than trial and error to discern the minimum fees the connected node will accept?

evoskuil commented 4 years ago

You could contact the node owner. Otherwise you could wait to receive a feefilter message, though that’s not a guarantee.

xloem commented 4 years ago

This sounds like a missing interface function; would you agree?

evoskuil commented 4 years ago

No

xloem commented 4 years ago

Well, I'm trying to figure out where to plan possible PRS. Would that be as a matter of policy or effort?

evoskuil commented 4 years ago

Neither, it’s a matter of protocol.

xloem commented 4 years ago

I'm thinking it could be nice to add to the libbitcoin client/server protocol so as to retrieve the configured fees at https://github.com/libbitcoin/libbitcoin-server/blob/a64da765481528a95f9364adac7ac3b35111f89d/data/bs.cfg#L233

evoskuil commented 4 years ago

The c/s interface doesn’t currently expose an administrative interface, though it’s envisioned. But this wouldn’t help with the general question of “the connected node” because nodes utilize the p2p network interface, not the Libbitcoin c/s interface.

xloem commented 4 years ago

Sorry for using the wrong word: I meant the libbitcoin-server that libbitcoin-explorer connects to when you run bx send-tx. Wouldn't it make sense to show the configuration or at least minimum fees in the output of some bx fetch or bx settings command? It sounds like that might go near administrative controls in kind of planning it.

evoskuil commented 4 years ago

Asking the server for its configuration is what I would call administrative. But knowing the one server’s config doesn’t actually help much.

xloem commented 4 years ago

It helps to know a server will hold a transaction on the network; and the configuraton of a server indicates the configurations of other similar servers. I'll slot this idea near administrative features for libbitcoin-server, but I infer it's not your favorite feature request.

evoskuil commented 4 years ago

Actually it tells you nothing about the configuration of other servers that you couldn’t get from the documented defaults. I would expose all config through a public and/or private set of interfaces.

xloem commented 4 years ago

Well provably no, but statistically people do similar things (edit: oh saw your edit. yeah comparable to defaults, but those can change). Okay, sounds like config exposure sounds reasonable.

edit 2: For context, I used to work with the bsv network, where after some time the network-accepted transaction fees are commonly lower than the minimum accepted fees by api servers (they raise them to disincentivize use and save traffic costs). So I'm used to discerning the minimum fee of an api server, to save money. I've realized since I opened this issue that bitcoin has the opposite relation here: the minimum libbitcoin-server fees aren't really enough to get a transaction confirmed.

evoskuil commented 4 years ago

Yes, default fees are set as DOS protection. Ideally one (especially a miner) wants all valid transactions but with fees set too low the store can be overflowed at zero or low cost. Since libbitcoin doesn't store unconfirmed transactions in memory is can more reasonable accept much lower fee transactions than memory (RAM) pooling nodes.