bitcoindevkit / coin-select

Tool to help you select inputs for making bitcoin transactions.
Other
12 stars 6 forks source link

Rename `Drain` to `Change` #22

Open LLFourn opened 7 months ago

LLFourn commented 7 months ago

When I originally named change outputs "drain" outputs I thought I was being clever because sometimes you use these kinds of outputs to drain value to things that are not technically change addresses. However the conversation over here led me to think about what you would do if you wanted to drain a bunch of funds to an output e.g. sweep a wallet or something and my conclusion was that you would actually not use the Drain system but rather:

  1. Set an output whose value is above dust
  2. Select all the things somehow
  3. Set the value of the output to the excess

The main point being that "drain" system we have is really an optional output system to take excess otherwise known as change output or it is at least close enough it's unhelpful to name it something else.