Skip to content

Consider recovering excess LN fee for cross account receives #710

@gudnuf

Description

@gudnuf

A cross account receive is when we melt a token from mint A and use the melt quote to pay a mint quote from mint B. Mint B is where the user wants to receive the money into.

The way that this is currently done can be seen here. A cashu-receive-quote is created in the Agicash db, but the melt operation happens purely on the client. There is a chance that mint A overestimated the lightning fee which means when the melt completes, the mint will return change. We simply forget the change.

In the case that the user does not have an account for mint A, there's not much we can do here. Sometimes if the fee reserve is large enough, then there would be sufficient funds to go through the cross account receive process again and melt the change, but then we will likely end up with change again. When the change is just a couple of sats, it will usually not be enough to cover all fees, so then there is nothing to be done here.

In the case the the user has an account for mint A, we could add the change proofs to the account.

In my opinion, the fee reserve should just be treated as the total fee and we keep things as they are with simply forgetting any change. It could be worth adding the complexity of trying to recover LN fees if mints are drastically over estimating the LN fee

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions