lightninglabs / lightninglabs/loop

Loop Out amount precision

Open
#234 11 comments 0 reactions 0 assignees View on GitHub
feature request loop out
Dominant language
Go
Stars
595
Forks
135
Avg merge
1d 8h
Merged PRs (30d)
12

Description

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!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the loop out CLI flow described by --amt and --fast, then trace how the initial swap output and later sweep amount are determined. Decide whether a sweep-fee option or automatic adjustment best satisfies the exact merchant payment requirement, and add coverage for the resulting amount and fee behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, payments
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.