lightning icon indicating copy to clipboard operation
lightning copied to clipboard

Unable to pay my Test node from Phoenix wallet with a bolt12 offer

Open hMsats opened this issue 3 weeks ago • 8 comments

Main node and Test node both: CLN v25.12

Edit: bolt12 offer payments: Payment Main node -> Test node: success Payment Test node -> Main node: success Payment Phoenix -> Main node: success Payment Test node -> Phoenix: success Payment Phoenix -> Test node: fail (Edit: with bolt11 success!)

Lightning configuration:

3 CHANNEL BALANCES IN MILLISATOSHI 

Main node 1,369,507,479 <=> 30,492,521 Kraken 🐙⚡
ACINQ 1,225,623,011 <=> 174,376,989 Main node
Main node 55,283,032 <=> 44,716,968 Test node

Main node to Test node:

lightning-cli xpay lno1zcss92wmc9eyanwdjsmyjgxq98x9kfsqs823frtxnqeglrw88val5r7d 10000
# ->02a9dbc1724ecdcd94364920c029cc5b260081d5148d6698328f8dc73b3bfa0fcd->020000000000000000000000000000000000000000000000000000000000000001: Success: preimage=319942578aa8a73ab7b90e0466fde3237c875e57ca91abae44d354fcf44004e1
{
   "payment_preimage": "319942578aa8a73ab7b90e0466fde3237c875e57ca91abae44d354fcf44004e1",
   "amount_msat": 10000,
   "amount_sent_msat": 10000,
   "failed_parts": 0,
   "successful_parts": 1
}

Test node to Main node:

lightning-cli xpay lno1zcssxxtelekwpe57eekenf9uffanpmfz4r9cwq7a0hfdltmpncr3ylst 12000
# ->031979fe6ce0e69ece6d99a4bc4a7b30ed22a8cb8703dd7dd2dfaf619e07127e0b->020000000000000000000000000000000000000000000000000000000000000001: Success: preimage=39a4acfa2beef3d004b3488580d84e7fc15a53a559ba0a42620be61fb2d449ef
{
   "payment_preimage": "39a4acfa2beef3d004b3488580d84e7fc15a53a559ba0a42620be61fb2d449ef",
   "amount_msat": 12000,
   "amount_sent_msat": 12000,
   "failed_parts": 0,
   "successful_parts": 1
}

Phoenix to Main node (from lightning-cli listinvoices):

     {
         "label": "f28cdaa1ddfea199a1a614cd320c797c0f450d974699f9260f9be0cfcdbb326d-0307e1e059e6332fb13d92b3dc2d4b58e928349b7b668881a7673f0b9daf5ad6d6-0",
         "bolt12": "lni1qqs9hsxdtc6f8mthr2tm0wnrj446lhl9qmy2ns7dmmxfpk7mn95rvlqgqvqa32q2y9cxcctev4e97mts8ymnwwrkwfehydrtd4nk6an4wekkwdrrvdchqeqkyyp3j707dnswd8kwdkv6f0z20vcw6g4gewrs8hta6t067cv7quf8uz6syph79rq2kmcmxukp563ydtnr7a8ex85rvhs45zyudrtpjqqqqqqqq5srq8v2s4qrqgqqqkppqvr7rczeucejlvfaj2eact2ttr5jsdym0dng3qd8vulsh8d0tttdvkfqu2pt7emjv9cx2umgd9e8gvpcgpcxsmm9de5hsampd3kx2apwd4j6pxqrr9ulum8qu60vumve5j7y57esa5323ju8q0whm5kl4aseupcj0c9s9xdek0pz90k48xyrc5f46s0sfu7yj2gqsk50s7x2q7ty3sk768w5qyppeqwzqxmuht9skmcrxm06ywryuc40un4y33f6am9rznk5m5knmmqqx2v3z3lgu6966eax3h6e2pv78mptmmde5wdqm5gmwfq9j0qe8ncwj4sxl82s670w356u87q8e89ma2u4uz3pcqqqqqqqqqqqqqqpyqqqqqqqqqqqqqwjfvkl43fqqqqqqzjqg6fn6tt6sgzavztqgfe83cerzzsjuud784ejlrxpsjn0r9qg7z8euek8f0yjrz4qxqwc4zhqxqsqqzczzqce08lxec8xnm8xmxdyh398kv8dy25vhpcrm47a9ha0vx0qwyn7p0cyqxws44ahfms22tvp2ttg04vvm7d8vz8m9277mh55f6qexc9cc7r9tgey37e3rgjax0yvhqnspp06z0yxgy6rm4ev0lc7xv6gkgghc5cq",
         "payment_hash": "5d60960427278e32310a12e71be3d732f8cc184a6f19408f08f9e66c74bc9218",
         "amount_msat": 121000,
         "status": "paid",
         "pay_index": 1384,
         "amount_received_msat": 121000,
         "paid_at": 1765003992,
         "payment_preimage": "e2f2ecf48d77907e27fae16494fe53e50253d12b4394927e25015c0c7350e3ea",
         "description": "player_mp9778vrsr4kmgmvuvmg4ccqpd",
         "expires_at": 1765011191,
         "local_offer_id": "f28cdaa1ddfea199a1a614cd320c797c0f450d974699f9260f9be0cfcdbb326d",
         "invreq_payer_note": "₿[email protected]",
         "created_index": 4700,
         "updated_index": 4684
      }

Test node to Phoenix:

lightning-cli xpay lno1zrxq8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwa3w0uk0h7vytuuytqemllkhfnaux2f2lwe0k4zhnxeu7gvz7pv2qsraavdg00v4xmpjdm7sah7qrjn06eq9tqk2jr3axlszglfct38sjxqqv7ca9z7qyjxg6jq7t900nswque9uznddry9kksky62v303pr4wzyw3pvaeqwncysfzx7qt7myhv8f4v9pf8qw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhujqqstzv26hlksmcr5efxtplpz7fswg 23000
# ->031979fe6ce0e69ece6d99a4bc4a7b30ed22a8cb8703dd7dd2dfaf619e07127e0b->03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f->020000000000000000000000000000000000000000000000000000000000000001: Success: preimage=e2f6a25f9e849909aa177d98f66c144fb8abe09f1566d7512e4fd0596fb09c6b
{
   "payment_preimage": "e2f6a25f9e849909aa177d98f66c144fb8abe09f1566d7512e4fd0596fb09c6b",
   "amount_msat": 23000,
   "amount_sent_msat": 24002,
   "failed_parts": 0,
   "successful_parts": 1
}

Phoenix to Test node (50 sats):

Payment has failed

*Could not retrieve payment details within a reasonable time.*
*The recipient may be offline or unreachabel.*

Phoenix logs:

2025-12-06 08:01:54,337 INFO  f.a.p.a.p.s.o.SendOfferViewModel  - sending amount=50000 msat random=true message= for offer=lno1zcss92wmc9eyanwdjsmyjgxq98x9kfsqs823frtxnqeglrw88val5r7d
2025-12-06 08:01:54,355 INFO  f.a.lightning.io.Peer  - sending OnionMessage(pathKey=0301895a9966a3dcf7ca2ca4a65cc7c88e81cb3550d667cd245a298764e0a40734, onionRoutingPacket=OnionRoutingPacket(version=0, publicKey=025555f1b263581eb06d76cba26efccf2f5ef8ae962780a5af4d2d184bad572080, payload=<0 bytes>, hmac=94bfb70484567889e1df2552b384fa1b99fb9785eb2f17026500dee14fe58cdf)) (truncated payload)
    remoteNodeId: 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f
    connectionId: 1765004494968
2025-12-06 08:02:05,128 INFO  f.a.lightning.io.Peer  - checking for timed out htlcs for channels: 0a3993a3b57423c830a87d69cd839f2e9d56fa1ebabca97240f8f3066e2ef3fc
    remoteNodeId: 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f
2025-12-06 08:02:05,129 INFO  f.a.l.c.s.ChannelState  - checking htlcs timeout at blockHeight=926630
    remoteNodeId: 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f
    state: Normal
    channelId: 0a3993a3b57423c830a87d69cd839f2e9d56fa1ebabca97240f8f3066e2ef3fc
    commitments: active=[1] inactive=[]
    balances: toLocal=37853788 msat toRemote=80043212 msat capacity=117897 sat
2025-12-06 08:02:24,356 WARN  f.a.lightning.io.Peer  - paymentId:951841d9-7c56-466e-a999-e7c56a7d8150 pathId=adaa93e04b6949cc4e4e45f83347eba561fa567dd64ad479c9358aa0c1aeadfe invoice request timed out
    remoteNodeId: 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f

Config Main node

bind-addr=192.168.1.20:9735
announce-addr=1.2.3.4:1234
bitcoin-datadir=/media/ssd/.bitcoin/
alias=bitcoinserver.nl
network=bitcoin
proxy=127.0.0.1:9050
fee-base=0
fee-per-satoshi=0
allow-deprecated-apis=false
important-plugin=/home/user/plugins_cln/backup/backup.py
experimental-splicing
bitcoin-rpcclienttimeout=900
xpay-handle-pay=true

Config Test node:

bind-addr=192.168.1.20:6837
announce-addr=2.3.4.5:2345
bitcoin-datadir=/media/ssd/.bitcoin/
alias=shecret
network=bitcoin
proxy=127.0.0.1:9050
fee-base=0
fee-per-satoshi=0
allow-deprecated-apis=false
important-plugin=/home/user/plugins_cln/backup/backup.py
experimental-splicing
bitcoin-rpcclienttimeout=900
xpay-handle-pay=true

hMsats avatar Dec 06 '25 07:12 hMsats

With bolt12 you need to be able to send onion messages between source and destination. lnd nodes in particular do not support that by default afaik. So if your phoenix wallet can't find a route with onion routing to your destination it will try to connect directly to your destination. I think this happens with your test node. Since it has a bogus ip announced it can't connect directly and you get

The recipient may be offline or unreachabel.

That is my guess as to what is happening.

daywalker90 avatar Dec 06 '25 11:12 daywalker90

@daywalker90 sounds like a good explanation but why can't Phoenix (Eclair) find a route to the Test node while the Test node can easily find a route to Phoenix?

hMsats avatar Dec 06 '25 22:12 hMsats

I don't know, it should.

daywalker90 avatar Dec 06 '25 22:12 daywalker90

FYI;

From Unable to pay my Test node from Phoenix wallet ACINQ/phoenix#783:

Paying 50 sats with a bolt11 invoice from Phoenix -> Test node worked:

{
     "label": "lab",
     "bolt11": "lnbc500n1p5ndvuvsp58w4vf4ymct66aznnql60wr5jxy3a40dtlc076v33z3mj6davugfspp5xw5kxp2xwd2u6ccw2wghsdm63xrsyalk8teyhngyjlp7zsa9x78qdq8w3jhxaqxqyjw5qcqpjrzjqvvhnlnvurnfanndnxjtcjnmxrkj92xtsupa6lwjm7hkr8s8zflqkrw9vyqqtkgqqqqqqqqqqqqqqqqqyg9qxpqysgqmzgwy6lwkdffa9z69wruev57h5nrjxgcwr8g38nlpy7u6khwsnthmx7dm4ndd9re2rznlyemky64jlku6z09v45mfpgksm0xp8cysaspu3t62m",
     "payment_hash": "33a96305467355cd630e539178377a89870277f63af24bcd0497c3e143a5378e",
     "amount_msat": 50000,
     "status": "paid",
     "pay_index": 431,
     "amount_received_msat": 50000,
     "paid_at": 1765192649,
     "payment_preimage": "5ef29f0bcff9cb83cf6068a1ee72401852abef2a711c9264f8c4881484774645",
     "description": "test",
     "expires_at": 1765797391,
     "created_index": 481,
     "updated_index": 481
  }

Paying 50 sats with the bolt12 offer for any amount: lno1zcss92wmc9eyanwdjsmyjgxq98x9kfsqs823frtxnqeglrw88val5r7d, from Phoenix to Test node failed again

When I pay my Main node from Phoenix (with an offer), I see the corresponding invoice appear at my node. When I pay my Test node from Phoenix, no invoice is created at my node. So the problem isn't the payment itself but getting the invoice from my Test node. I try to look for differences between my Main node and my Test node at my side but can't find any.

Any suggestions over here?

hMsats avatar Dec 09 '25 10:12 hMsats

That confirms my suspicion that it's the onion messaging used to transmit the invoice. Since your main node is connected to ACINQ because of your channel it has no problem. Your test node has no channel with ACINQ and a bogus ip so they can't connect for the purpose of fetching the invoice. Usually ACINQ would use the hop of your main node to forward the onion messages but i suspect they don't try that?

daywalker90 avatar Dec 09 '25 11:12 daywalker90

@daywalker90 The reason I use a bogus ip is that I don't want anymore connections to my lightning nodes. Unfortunately, as far as I know, there isn't a standard way to signal this to other nodes or make extra connections impossible, only tricks. I will give my Test node a real ip and see if that resolves the issue.

hMsats avatar Dec 09 '25 11:12 hMsats

Now running my Test node with:

announce-addr=87.209.243.33:9739
min-capacity-sat=2100000000000001

hMsats avatar Dec 09 '25 12:12 hMsats

Using my real IP didn't solve the issue!

lightning-cli getinfo:

{
   "id": "02a9dbc1724ecdcd94364920c029cc5b260081d5148d6698328f8dc73b3bfa0fcd",
   "alias": "shecret",
   "color": "02a9db",
   "num_peers": 10,
   "num_pending_channels": 0,
   "num_active_channels": 1,
   "num_inactive_channels": 0,
   "address": [
      {
         "type": "ipv4",
         "address": "87.209.243.33",
         "port": 9739
      }
   ],
   "binding": [
      {
         "type": "ipv4",
         "address": "192.168.1.20",
         "port": 6837
      }
   ],
   "version": "v25.12",
   "blockheight": 927286,
   "network": "bitcoin",
   "fees_collected_msat": 0,
   "lightning-dir": "/media/ssd/.lightning_test/bitcoin",
   "our_features": {
      "init": "800898880a8a59a1",
      "node": "808898880a8a59a1",
      "channel": "",
      "invoice": "02000002024100"
   }
}

Unrelated but something I noticed while pasting this:

Why does listinfo show lightning-dir and points to /media/ssd/.lightning_test/bitcoin instead of /media/ssd/.lightning_test ?

hMsats avatar Dec 10 '25 15:12 hMsats