loop/looprpc
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
..
.clang-format multi: move server proto files to their own directory 2021-12-13 13:56:40 +02:00
client.pb.go looprpc: add client calls 2026-08-11 14:57:32 +02:00
client.pb.gw.go looprpc: add new method SweepHtlc 2026-01-15 03:06:22 -05:00
client.proto looprpc: add client calls 2026-08-11 14:57:32 +02:00
client.swagger.json looprpc: add client calls 2026-08-11 14:57:32 +02:00
client.yaml looprpc: add new method SweepHtlc 2026-01-15 03:06:22 -05:00
client_grpc.pb.go looprpc: add client calls 2026-08-11 14:57:32 +02:00
debug.pb.go loooprpc: replace deprecated grpc.Dial with grpc.NewClient 2025-12-19 10:03:14 +01:00
debug.proto make+looprpc: use Docker to compile and format protos 2021-07-13 09:41:28 +02:00
debug_grpc.pb.go looprpc,swapserverrpc: update Go image to 1.21.9-bookworm 2024-04-24 13:21:37 -03:00
Dockerfile looprpc: prepare for lnrpc usage 2026-02-26 09:35:59 +01:00
gen_protos.sh looprpc: prepare for lnrpc usage 2026-02-26 09:35:59 +01:00
gen_protos_docker.sh looprpc: prepare for lnrpc usage 2026-02-26 09:35:59 +01:00
go.mod multi: bump google.golang.org/grpc to v1.82.1 2026-07-23 13:13:57 -05:00
go.sum multi: bump google.golang.org/grpc to v1.82.1 2026-07-23 13:13:57 -05:00
perms.go multi: require Loop Out permission for Instant Out 2026-08-11 15:02:42 +02:00
swapclient.pb.json.go looprpc: add client calls 2026-08-11 14:57:32 +02:00