lightninglabs / lightninglabs/loop
Track armed static address HTLCs after aborted swaps
@hieblmi is already working on this.
Since Jul 9, 2026.
- Dominant language
- Go
- Stars
- 595
- Forks
- 135
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 12
Description
Static address loop-ins can leave the client with a durable safety obligation once it signs and hands HTLC transaction signatures to the server. Even if the client later aborts the swap, the server may still be able to publish one of those HTLC transactions until the selected deposit set is otherwise spent.
We should add a dedicated HTLC transaction monitor for aborted/static loop-in swaps where the client handed out, or may have handed out, HTLC signatures.
Expected behavior:
- Persist/register a swap as "armed" before or when HTLC signatures are handed to the server. This should cover ambiguous handoff failures where the server may have received signatures but the client did not receive a successful response.
- On startup, restore all armed HTLC monitors.
- For each armed swap, monitor the signed HTLC transaction/script for publication.
- If the HTLC confirms, keep the swap/deposits on the timeout-sweep path until the timeout path is swept.
- If any selected deposit is spent before the HTLC transaction is observed, stop the monitor for that armed HTLC because the all-input signed HTLC transaction can no longer be published.
- Disarm the monitor once the swap reaches a final safe state, such as successful completion, confirmed timeout sweep, or provable invalidation by deposit spend.
This should remove the need for each abort path to reason separately about whether the server still holds usable HTLC signatures.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.