-
Notifications
You must be signed in to change notification settings - Fork 117
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
Loop Out amount precision #234
Comments
This is possible with some provisos The complicating factor is that you would need to potentially raise the fee of your swap if it's taking too long to confirm, and where do those funds come from? We normally take the funds from the swap itself to raise the on-chain fee. One possible solution is to make the 2nd transaction pay to two addresses: the address you want to pay to, and then an additional change address. If the fee needs to be raised, then the requisite increase funds may simply be reduced from the change address output. |
I'd be happy with the second transaction paying to 2 addresses, only downside is you now have on-chain funds you dont want. Or if it's be possible to ask for a small additional off-chain payment, similar to the pre-payment. |
You could Loop In the excess if that's what you mean |
I considered that too, definitely an option, but the minimum loop in is like 250k sats, which is much higher than a typical chain fee. |
Yeah although that could conceivably be adjusted lower as well |
Second output which is a change address looks like the smallest change. So on initiation of the swap, you'd need to specify two amounts: the exact amount to eventually pay out and the swap amount, which needs to be higher. The difference between the two is the maximum expected chain fee. Would you prefer to specify the swap amount manually or let it be calculated automatically based on a fee estimate? The workaround for all of this is of course to do a third transaction. So
If 3 uses the unconfirmed output of 2, the duration of the whole process shouldn't be different from using a change address. It is slightly more expensive with one additional input though. What is the main reason that makes the workaround less attractive? Is it the additional cost or the inconvenience of executing another step? |
Mostly the inconvenience. When doing a loop out for an on-chain payment, I already know that it is 2-3 blocks away before the final transaction is published. I don't want to wait around an hour, and then finally then send the on-chain payment. 1st Preference: If on-chain fee bumping is required, obtain that fee in another off-chain payment. This way we aren't creating small unwanted UTXOs. 2nd Preference: Create swap with a max on-chain fee, and a base on-chain fee. Create two UTXOs from the swap, one a payment, one change. Potentially lower loop-in minimums, so we can eliminate unwanted on-chain UTXOs. |
The sweeping of the htlc is entirely your process. So there is no-one to pay that off-chain bump amount too, or how did you envision this? |
That makes sense. Since that is the case, I want the sweep amt to equal to my "payment", and the fee to be a fixed number of sat/byte, therefore knowable at the start of the swap.
This is just an idea, still getting my head around the constraints we are dealing with here. |
bos already has a feature that does this if you want to see it in action.
|
This was proposed here: lightninglabs#234 (comment)
This was proposed here: lightninglabs#234 (comment)
This was proposed here: lightninglabs#234 (comment)
This was proposed here: lightninglabs#234 (comment)
Thought of this earlier today. Use case is wanting to use Loop Out w/ an external addr to complete a precise send on chain. Today it works, but we over allocate in the HTLC to pay for fees, and you end up paying more than the amount in the sweep (send) transaction. As mentioned above, we can either:
|
One of the largest barriers/sources of friction for people to use Loop Out for on-chain payments, is the lack of precision in setting the target UTXO size.
Merchant Invoice: 1000000 sats
loop out --amt=1000000 --addr={merchant address} --fast
This results in a transaction "TXswap" in the mempool like so:
UXTO1 (swap): 1000000 sat
UTXO2 (loops change): ??? sat
Once TXswap has confirmed, loopd will sweep UTXO1 in another transaction:
UTXO3 (payment): 999500 sat
Because of the fee, the end result is slightly underpaying the merchant invoice. This usually requires hours of back and forth, and waiting for a refund and trying again. Most likely just on-chain this time around...
I don't know if is feasible to add a --sweep_fee_sats flag, where I can specify I want the sweep to be 1000 sats, and then I'll just increase my total payment by 1000 sat. Or if it makes more sense just automatically increase the initial payment, to account for the sweep fee.
Loop out already gives some friction, by requiring 1-2 blocks to go by before the final TX is broadcast. This gives headaches for BitPay, and also CoinKite stores, which gives a timeout for when it expects the transaction to be broadcasted. At least if we can make the output payment amounts correct, we'd be getting closer to the feeling that BTC is "unlocked" in a channel instead of "locked" in a channel.
Thanks!
The text was updated successfully, but these errors were encountered: