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

Wallet melt should not over pay risking ecash stuck in pending. #465

Open
thesimplekid opened this issue Nov 21, 2024 · 1 comment
Open
Assignees
Labels

Comments

@thesimplekid
Copy link
Collaborator

When melting the wallet can over pay the melt quote and have the change returned once the payment is complete. However in an error cash this can lead to ecash being stuck in a pending state. The wallet should select proofs and swap before a melt if it does not have proofs equal to the melt quote. Swapping before increases fees and requires an extra operation but is preferable to risking stuck ecash.

@davidcaseria just tagging you for tracking as we've talked about this before, but don't think we've fixed it.

@thesimplekid thesimplekid self-assigned this Dec 1, 2024
@thesimplekid thesimplekid assigned crodas and unassigned thesimplekid Dec 11, 2024
@thesimplekid
Copy link
Collaborator Author

@crodas and I spoke about this and my suggestion would be in the melt function we add in a check once we select input_proofs. In the case that it is a mint that does not support nut08 the value should be exactly that of the quote amount + fee_reserve. In the case that it is a mint that does support nut08 the value should be <= quote_amount + fee_reserve + some tolerance. For the tolerance we could just pick some value we're willing to risk, or be smarter about it and it could be something like the tolerance = the extra fee we would pay to swap.

Then we leave the melt_proofs function as it is since the extra logic to handle the swap is in the melt and if some wants to do their own coin selection and risk more stuck in the pending that's on them and we should allow it.

@crodas believe you're gonna take this one if not let me know and I'll reassign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants