-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add LNURL-pay drain #559
Comments
This was referenced Nov 11, 2024
Merged
This is because the Boltz service fees use a
|
@dangeross if we follow the Boltz calc logic, what exactly is the problem? This should behave like "best effort" to drain, so it's ok to leave change if there's no way to drain everything. |
Also, what's the difference between lnurl and on-chain? |
Draft
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Calculate an invoice inversing the Boltz fees in a way to drain the wallet. If the invoice returned contains an MRH request a new invoice without Boltz fees.
Some findings
Calculating the inverse fee can be tricky. Every time the invoice amount goes from x000 to x001 (e.g 2000 -> 2001) the total amount skips a number. It means we could not create a drain tx for that amount (unless we hack the drain tx and increase the fee out by 1 sat)
So if the wallet total is 2031 sats, lockup fee is 14 sats its not possible to create an invoice that will result in 2017 sats (invoice amount + boltz fee + network fee) for the drain
(again unless you change the lockup fee tx output to 15 sats in this case)
2031 total - 15 lockup fee = 2016
2016 - 14 network fee - 2 boltz fee = 2000
The text was updated successfully, but these errors were encountered: