out-swap receive: invoices carry a 318-block route-hint CLTV delta; Strike and Cash App can't pay them

Aperta
#1,663 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start with sdk/swaps/invoice.go and sdk/swaps/out_swap.go to trace how the final CLTV and swap server route hint reach the invoice; the issue says the 318-block hint is copied unchanged. Check the related send-side CLTV issues (#1238, #1472, #1509) for timing constraints. Done means identifying whether the receive hint can safely use a lower delta or multiple paths and addressing the reported failures; the cause remains unconfirmed.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Lightning invoices created by a mainnet Wavelength wallet on v0.2.1 can't be paid from Strike or Cash App. The same type of invoice is paid without trouble from a self-hosted LND node, and the receive completes normally.

The one unusual property I found in these invoices is the timelock budget. The swap server's route hint sets cltv_expiry_delta = 318. Together with the final CLTV of 40, a payer has to accept 358 blocks for the last hop alone, and about 574 blocks on a typical route. I think this goes over the CLTV limits these custodial wallets apply. Neither service publishes its limit, so this is an inference, not a confirmed cause.

Strike and Cash App are where many everyday Lightning users hold their balance. When those users can't fund a Wavelength wallet, onboarding for any app built on the SDK is blocked, so I wanted to report it early.

Environment

Wavelength daemon/SDK v0.2.1 (Android Wavewalletdk.aar, sha256 07d97821…02fb)
Network mainnet, operator wavelength.lightning.finance:443
App Android wallet forked from apps/rn-wallet-demo at v0.2.1. My changes are UI only; invoice creation is the unmodified SDK path.
Devices Android emulator (x86_64, API 34) and a Pixel 6a (Android 17)

What I tested

I tried to rule out causes on my side before reporting:

  1. App vs SDK. Ran the same source on a clean emulator and created fresh 1,000 sat invoices there. The receive path comes straight from the SDK.
  2. Wallet online. Kept the receiving wallet open and in the foreground the whole time, so a backgrounded or sleeping client can't be the cause.
  3. Different payers, same invoice type. Paid from a self-hosted LND node, Strike (scanning the QR) and Cash App.
  4. Receive path. Confirmed in the daemon log that a paid invoice runs the whole flow (route hint → invoice → vHTLC funded → claimed → VTXO).
  5. Decoded invoice. Checked amount, expiry, route hint, fees, CLTV values and feature bits for anything unusual.
  6. Graph reachability. Checked that the hint node (LOOP, 021c97a9…7d0d) is public and well connected: 65 active channels, about 112 BTC capacity.
  7. CLTV sensitivity. Ran lncli queryroutes with the invoice's hop hint at several --cltv_limit values. This only searches for a route; nothing was sent.
  8. Existing reports and source. Searched open and closed issues and PRs for this repo (cltv, route hint, hop hint, timelock, receive, custodial, Strike), and read sdk/swaps on main.

Results

Payers
Payer Result
Self-hosted LND (default max_cltv 2016) Paid; receive completed in about 20 s
Strike "Can't find route"
Cash App "Sorry, your withdrawal could not be processed," followed by an SMS saying it failed. No reason given.
Invoice decode (1,000 sat example)
Field Value
Amount / expiry 1,000 sat / 3600 s
min_final_cltv_expiry 40
Route hint 1 path, 1 hop, via LOOP (021c97a9…7d0d), virtual SCID
Hint fee 0 msat base + 2500 ppm
Hint cltv_expiry_delta 318
Features 8, 14, 17
Route probes from LND (block height 978,095)
--cltv_limit Result
300 unable to find a path to destination
1000 6-hop route; total_time_lock 978,669 (574 blocks); total_fees_msat 3105, of which 2500 is the hint
Daemon log, successful receive paid from LND (abridged)
SWAP: Received route hint from swap server ... path_count=1 path_hops=1 payer_fee_msat=2500 vhtlc_amount_sat=1000
SWAP: Invoice created for out-swap ... amount_sat=1000
SWAP: Found funded vHTLC ... amount_sat=1000
SWAP: vHTLC claimed successfully ...
OORC: ... ReceiveCompleted

Analysis

  • Where the value comes from (from the source). sdk/swaps/invoice.go sets defaultCLTVExpiry = 40 for the final hop. sdk/swaps/out_swap.go copies the swap server's RouteHintPaths, including CltvExpiryDelta, into the invoice unchanged. So the 318 is set by the swap server's receive quote, not by the client. Nothing between v0.2.1 and main changes this path.
  • Why only some payers fail (inferred). A payer with a total CLTV limit under about 358 blocks can never reach these invoices, wherever it sits in the graph. One under about 574 blocks will usually fail too. LND's default of 2016 is well clear of both. Strike's "can't find route" fits this. Cash App's error gives no reason, so its failure may come from a different check.
  • Fees look unlikely. About 0.31% in total on 1,000 sat, but I can't rule out a custodial fee cap.
  • Probably deliberate. I assume the 318 is tied to the vHTLC claim and refund timing windows, the same kind of trade-off as the send-side fixes in #1238, #1472 and #1509.

Questions

  1. Is a 318-block receive hint delta intended, and is the impact on custodial payers known?
  2. Can the receive-side delta be lowered (for example to 144 or less), or does it have to cover the full vHTLC refund window? If it does, could that window be shorter for receives?
  3. Would it help to offer more than one hint path, including one with a smaller delta, so payers with stricter limits can still find a route?
  4. Is there a list of payers known to work or fail that wallet developers could show their users?

Limitations

  • Only one amount (1,000 sat) was tested against Strike and Cash App.
  • Strike's and Cash App's limits are not public, so the CLTV explanation is my best inference.
  • I tried no other custodial payers (e.g. Wallet of Satoshi, Coinbase).
  • Not re-run on main. The source path I checked is unchanged since v0.2.1.

Related

  • #1239, #1508: send-side CLTV limits (in-swap). This report is the receive-side (out-swap) counterpart.
  • #1238, #1472, #1509: send-side CLTV bounds and reserves.

I'm happy to run further tests or provide more logs.

Lingua principale
Go
Stelle
63
Fork
19
Merge medio
1g 16h
PR unite (30g)
121

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lightninglabs/wavelength

Tutte le issue di lightninglabs/wavelength

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.