This PR replaces draft PR 29442 as a simpler alternative that only adds new coin selection parameters, primarily add_excess_to_recipient_position
.
I am opening this PR as a draft to get feedback and suggestions on the concept and my implementation.
I have also included two additional coin selection parameters to this PR for specifying the target change amount and for disabling different coin selection algorithms. I can break them out into individual PRs if the primary excess amount coin selection option would be easier to review on its own. These additional parameters can also help lower fees for the LSP liquidity provider use case.
motivation
A changeless transaction may select inputs with excess value over what is needed to reach the desired fee rate and output targets. Currently that excess value is considered waste and burned as fees. In some situations you may prefer to add any excess value to an output you control. When fees are high the cost of adding a change output increases and so does the amount of potential excess value spent as fees. One example of a situation where excess value should be added to the output amount is when splicing in value to a Lightning channel because the excess value is retained off-chain.