pybitcash/bitcash

Remove network.fees and change default fee to 1 sat/byte

Closed this issue · 5 comments

Currently, if a fee argument is not passed to send() or create_transaction(), the function network.fees.get_fee() is called and returns 2 (default fee of 2 satoshi per byte).

We could simplify the code by removing network.fees as it is no longer needed with Bitcoin Cash (the fee is always predictable and does not change over time like BTC).

Instead, we could add the default argument of fee=1 to transaction.sanitize_tx_data().

What do you think @teran-mckinney?

If we do this, 1 should still be a constant so it can be changed if needed.

What will happen if Bitcoin Cash has a backlog of transactions? Isn't it good to be able to raise your fee in that case to have priority? I realize it's a lot less likely than Bitcoin being overloaded, but it's entirely possible

Fee can still be passed as an argument of send().

For example, Key.send([outputs], fee=10) will send with a fee of 10 sat/byte.

I see. Probably could just go to a constant like DEFAULT_FEE then.

Less network access is always better, official bitcoin BCH android wallet has these settings:
low prio: doesn't say (what could be lower than 1?)
default prio: 1satoshi/vByte
high prio: doesn't say

Maybe an optional network function would be useful that returns the required fee to ensure we are included in the next block, thus fastest possible transfer, without wasted satoshi.
As I calced currently it is ~520 satoshi, not sure if that's for byte or the entire transaction.

haplo commented

low prio: doesn't say (what could be lower than 1?)

"Fractional satoshis" are in the Bitcoin Cash roadmap, it would be a necessity to keep transaction fees low if the value of BCH went up.