Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't create change output (uneconomical output) if not worthy #183

Open
ShookLyngs opened this issue May 21, 2024 · 0 comments
Open

Don't create change output (uneconomical output) if not worthy #183

ShookLyngs opened this issue May 21, 2024 · 0 comments
Labels
enhancement New feature or request P-Medium

Comments

@ShookLyngs
Copy link
Collaborator

ShookLyngs commented May 21, 2024

Idea

When paying fee in the BTC TX building process, there will be an extra collection if the change amount is in range of:

0 < changeAmount < minUtxoSatoshi

Here we have a new suggestion to NOT create a change output if the changeAmount is less than the cost of creating a change output, which generally equals to the value of minUtxoSatoshi. Currently, the default value of minUtxoSatoshi on the mainnet is 10,000 shannon, therefore the overall logic here is as follow:

if (changeAmount >= 10000) {
  createChangeOutput(changeAmount);
} else {
  // don't create a change output
  // treat the changeAmount as an extra fee to the miner
}

The idea was originally posted here: #176 (comment)

Reference

@Flouse Flouse added the P-Low label May 24, 2024
@Flouse Flouse added P-Medium and removed P-Low labels Jul 23, 2024
@Flouse Flouse changed the title Don't create change output if not worthy Don't create change output (uneconomical output) if not worthy Oct 13, 2024
@Flouse Flouse added the enhancement New feature or request label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P-Medium
Projects
None yet
Development

No branches or pull requests

2 participants