loop/instantout
Slyghtning 508b9dfdc1
multi: require Loop Out permission for Instant Out
The InstantOut RPC accepts a caller-controlled dest_addr that becomes
the output of the cooperative sweepless sweep (and of the htlc success
sweep on the fallback path), so it is a fund-moving operation equivalent
to LoopOut. Until now it required only swap:execute, while LoopOut
requires both swap:execute and loop:out. A macaroon scoped to
swap:execute -- intended for, say, an autoloop scheduler or a quote
poller -- could therefore drain reservation balances to an attacker
address. ReservationRequest is analogous on the inbound side: it
triggers an outgoing LN prepayment, so it also belongs behind loop:out.

We also harden the address handling in instantout.Manager.NewInstantOut
to match validateLoopOutRequest:

  - sweepAddr.IsForNet(m.cfg.Network) is now enforced. btcutil
    .DecodeAddress is more permissive than IsForNet for some formats
    (notably anything that happens to share a network prefix); without
    the explicit network check cross-chain copy-paste mistakes parse
    silently and then sign over an unspendable output.
  - The address must be one of the formats Loop normally accepts: P2TR /
    P2WSH / P2WPKH / P2SH / P2PKH. Anything else (e.g. a future address
    type that the user's wallet would otherwise interpret differently)
    is rejected up front rather than failing later in the signing path.

InstantOutQuote and ReservationQuote stay on swap:read since they are
read-only.
2026-08-11 15:02:42 +02:00
..
reservation loopdb: store reservation prepay invoice 2026-08-11 14:56:59 +02:00
actions.go instantout: enforce the accepted swap fee 2026-08-11 12:16:08 +02:00
fsm.go lint: fix linter issues 2026-03-09 14:39:45 +01:00
fsm.md fsm: make diagram generation deterministic 2026-07-18 16:27:11 -03:00
instantout.go instantout: enforce the accepted swap fee 2026-08-11 12:16:08 +02:00
instantout_test.go instantout: enforce the accepted swap fee 2026-08-11 12:16:08 +02:00
interfaces.go instantout: add fsm and actions 2024-02-06 15:07:57 +01:00
log.go multi: update lnd compile-time dependency to v0.19.0 2025-03-10 22:59:49 +01:00
manager.go multi: require Loop Out permission for Instant Out 2026-08-11 15:02:42 +02:00
store.go instantout: enforce the accepted swap fee 2026-08-11 12:16:08 +02:00
store_test.go instantout: add instantout store 2024-02-06 15:07:57 +01:00