Skip to content

loopout: Accept blinded invoices for Loop Out - #1255

Merged
hieblmi merged 3 commits into
lightninglabs:masterfrom
hieblmi:hai/blinded-loopout-invoices
Oct 22, 2026
Merged

hieblmi merged 3 commits into
lightninglabs:masterfrom
hieblmi:hai/blinded-loopout-invoices

Conversation

@hieblmi

@hieblmi hieblmi commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Loop Out currently requires a visible invoice payment address to authenticate
swap RPCs, so it cannot accept a bLIP 39 blinded swap invoice. Advertise
accept_blinded_invoices, accept a separate 32-byte payment_address from
the server, and persist it for cancellation, routing reports and cooperative
sweeping, including after restart.

LND receives the complete swap and prepay invoices and handles blinded path
routing. Destination-based Loop routing plugins are bypassed for blinded
invoices; fee limits, timeouts, outgoing channel restrictions and multipart
limits are preserved. Invoice hash, swap fee and prepayment checks still
apply. Missing or malformed payment addresses are rejected, and separately
supplied addresses must match ordinary invoices.

This client change can ship independently of server support. Existing servers
ignore the additive capability flag and keep returning ordinary invoices.
Servers can enable blinded invoices later for clients that advertise support,
while keeping ordinary invoices for older clients. Existing swaps retain their
invoice-derived authentication address. No LND or lndclient change is needed;
Loop's existing minimum LND v0.19.0-beta supports blinded invoice payments,
including MPP. Path discovery, ranking and invoice construction remain server
responsibilities.

Includes SQLite/PostgreSQL and legacy-store persistence, protocol documentation
and release notes. Client tests cover blinded swap and prepay payments, payment
limits, routing reports, cancellation of either payment, database restart and
a complete cooperative sweep. The client unit fixtures use encoded invoices
with placeholder ciphertext; actual network forwarding is LND's responsibility.

Validation:

  • make fmt
  • go test -race ./... -timeout=10m
  • go test -race -tags=test_db_postgres ./loopdb -run TestSqliteLoopOutStore -count=1
  • golangci-lint run --concurrency=4 (zero issues)
  • go mod tidy -diff
  • make commitmsg-lint range='upstream/master..HEAD'

@hieblmi hieblmi changed the title loopout: Support blinded invoices with persistent RPC secrets loopout: Accept blinded invoices for Loop Out Oct 21, 2026
@hieblmi
hieblmi marked this pull request as ready for review October 21, 2026 07:24

@claravanstaden claravanstaden left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👏🏻 Only one comment.

Comment thread sweepbatcher/sweep_batcher.go
Blinded invoices hide the payment address that Loop uses to authorize
cancellation, routing reports and cooperative sweep signing. Accept the
address separately from the authenticated server response and persist it
with the swap so these operations also work after restart.

Advertise support explicitly, preserve legacy invoice-derived addresses,
and leave introduction-node pathfinding to LND for blinded payments.
Cover cancellation, routing reports and cooperative sweeping with
blinded swap and prepay invoices so client compatibility can release
before the server enables blinded paths. Preserve payment limits and
contract checks, record the supported LND floor, and fix dependency and
lint checks.
Read the stored swap secret when a manual cooperative sweep uses a
blinded invoice, so recovery follows the same authentication path as
normal sweeping. Cover successful signing and missing secrets, and
deprecate the invoice-only helper without breaking external callers.
@hieblmi
hieblmi force-pushed the hai/blinded-loopout-invoices branch from 73331c9 to 7a9c753 Compare October 22, 2026 12:01

@bhandras bhandras left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good! 🎉

@hieblmi
hieblmi merged commit ef1c5f5 into lightninglabs:master Oct 22, 2026
12 checks passed
@hieblmi
hieblmi deleted the hai/blinded-loopout-invoices branch October 22, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants