You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current implementation of the btc lib, all imbalanced transactions without non-fixed outputs, should generate a change output. This means that if there are satoshi left in the inputs, they should be returned as a change output. This can be inappropriate in some scenarios, for example, when a user wants to transfer the entire balance to another address, a change output is redundant.
Overall, the feature has two key points to be resolved:
What is the available balance for the transfer-all action?
How can the redundant change output be removed from the transaction?
What is the available balance for the transfer-all action?
If an address holds normal BTC UTXOs, RGBPP UTXOs and dust UTXOs, we should only transfer the normal BTC UTXOs and exclude the others. In this case, the sendBtc API is not suitable and we might wanna implement a new API for it.
Ideally, we can fetch the Utxo[] list of the address, and then add all BTC UTXOs to the transaction inputs, while doing this, we should also calculate the total value of the inputs. And then, we can generate an output in the transaction that it contains all the value of the transaction inputs.
How can the redundant change output be removed from the transaction?
In the current implementation of the btc lib, all imbalanced transactions without non-fixed outputs, should generate a change output. This means that if there are satoshi left in the inputs, they should be returned as a change output. This can be inappropriate in some scenarios, for example, when a user wants to transfer the entire balance to another address, a change output is redundant.
Overall, the feature has two key points to be resolved:
Related Issues
The text was updated successfully, but these errors were encountered: