out-swap receive: invoices carry a 318-block route-hint CLTV delta; Strike and Cash App can't pay them
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
- Ambito
- backend, networking
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:
- 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.
- 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.
- Different payers, same invoice type. Paid from a self-hosted LND node, Strike (scanning the QR) and Cash App.
- Receive path. Confirmed in the daemon log that a paid invoice runs the whole flow (route hint → invoice → vHTLC funded → claimed → VTXO).
- Decoded invoice. Checked amount, expiry, route hint, fees, CLTV values and feature bits for anything unusual.
- Graph reachability. Checked that the hint node (
LOOP,021c97a9…7d0d) is public and well connected: 65 active channels, about 112 BTC capacity. - CLTV sensitivity. Ran
lncli queryrouteswith the invoice's hop hint at several--cltv_limitvalues. This only searches for a route; nothing was sent. - 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/swapsonmain.
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.gosetsdefaultCLTVExpiry = 40for the final hop.sdk/swaps/out_swap.gocopies the swap server'sRouteHintPaths, includingCltvExpiryDelta, into the invoice unchanged. So the 318 is set by the swap server's receive quote, not by the client. Nothing betweenv0.2.1andmainchanges 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
- Is a 318-block receive hint delta intended, and is the impact on custodial payers known?
- 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?
- 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?
- 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 sincev0.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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lightninglabs/wavelength
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
lightninglabs/wavelength#1565 ·
I maintainer di solito rispondono entro 1 giorno
-
actor P3
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
lightninglabs/wavelength#1120 ·
I maintainer di solito rispondono entro 1 giorno
-
P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
lightninglabs/wavelength#1085 ·
I maintainer di solito rispondono entro 1 giorno
-
`darepocli create` should fail _before_ password is entered when `wallet.type=lnd` is configuredApertacli P3 ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
lightninglabs/wavelength#601 ·
I maintainer di solito rispondono entro 1 giorno
-
automation bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
lightninglabs/wavelength#1664 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lightninglabs/wavelength
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Cojekt/LibreDental#258 ·
I maintainer di solito rispondono entro 1 giorno
-
go good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opensro-dev/opensro#4949 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 3 giorni
-
agent-execution/02 row 4: consumers Verify row lacks delivery/base binding, cannot pass post-mergeApertabug effort:s impact:low raised-by:verifier risk:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
medici-finance/assay#7946 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno