lndk-org / lndk

MIT License
73 stars 19 forks source link

Bug: Unable to pay to Bolt 12 offers to CLN node #103

Open mrfelton opened 2 months ago

mrfelton commented 2 months ago

Describe the bug I seem to be unable to pay to a Bolt 12 invoice generated by CLN.

Should be able to pay the offer.

Generate a Bolt 12 invoice on CLN

bolt12-playground on  cln [!?] via 🐳 desktop-linux via 🐍 v3.11.8 (zap-devenv-py3.11) via ❄️  impure (devenv-shell-env) took 18s
❯ ./bin/clncli offer 10000 "test offer from cln"
{
   "offer_id": "6e322a6450edc31661b8376e6f2a25f23ef9eefa8f984914e7ab9537eb5034e2",
   "active": true,
   "single_use": false,
   "bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqgn3qzsnw3jhxapqdanxvetjypn8ymmdyp3kcmskyypd6pxmsez7v27lrzkya86ktztm534cnp23g2d2l5yyy8t5t3ygnfg",
   "used": false,
   "created": true
}

Decode the invoice using LNDK

bolt12-playground on  cln [!?] via 🐳 desktop-linux via 🐍 v3.11.8 (zap-devenv-py3.11) via ❄️  impure (devenv-shell-env)
❯ ./bin/lndk-cli decode lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqgn3qzsnw3jhxapqdanxvetjypn8ymmdyp3kcmskyypd6pxmsez7v27lrzkya86ktztm534cnp23g2d2l5yyy8t5t3ygnfg
Decoding offer: lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqgn3qzsnw3jhxapqdanxvetjypn8ymmdyp3kcmskyypd6pxmsez7v27lrzkya86ktztm534cnp23g2d2l5yyy8t5t3ygnfg.
Decoded offer: Offer { bytes: [2, 32, 6, 34, 110, 70, 17, 26, 11, 89, 202, 175, 18, 96, 67, 235, 91, 191, 40, 195, 79, 58, 94, 51, 42, 31, 199, 178, 183, 60, 241, 136, 145, 15, 8, 2, 39, 16, 10, 19, 116, 101, 115, 116, 32, 111, 102, 102, 101, 114, 32, 102, 114, 111, 109, 32, 99, 108, 110, 22, 33, 2, 221, 4, 219, 134, 69, 230, 43, 223, 24, 172, 78, 159, 86, 88, 151, 186, 70, 184, 152, 85, 20, 41, 170, 253, 8, 66, 29, 116, 92, 72, 137, 165], contents: OfferContents { chains: Some([06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f]), metadata: None, amount: Some(Bitcoin { amount_msats: 10000 }), description: "test offer from cln", features: [], absolute_expiry: None, issuer: None, paths: None, supported_quantity: One, signing_pubkey: PublicKey(a589485c741d4208fdaa29145598b846ba9758569f4eac18df2be64586db04dd64a93e8286d617aa8db2a030bcc67f1493f4543d3fe4c1c4710251832cbb1983) } }.

Attempting to pay the offer from lndk

bolt12-playground on  cln [!?] via 🐳 desktop-linux via 🐍 v3.11.8 (zap-devenv-py3.11) via ❄️  impure (devenv-shell-env)
❯ ./bin/lndk-cli pay-offer lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqgn3qzsnw3jhxapqdanxvetjypn8ymmdyp3kcmskyypd6pxmsez7v27lrzkya86ktztm534cnp23g2d2l5yyy8t5t3ygnfg
2024-05-05T10:40:46.688023260+00:00 INFO lndk - Starting lndk for node: 03f42b31c4ee1870a75762c84c165bb74991f3e78818baaf4ad3f908804edda018.
2024-05-05T10:40:46.689176718+00:00 INFO lndk::onion_messenger - Consume messenger events received: messenger event: 02dd04db8645e62bdf18ac4e9f565897ba46b898551429aafd08421d745c4889a5 connected, onion message support: true.
2024-05-05T10:40:46.794970760+00:00 INFO lndk::onion_messenger - Sending outgoing onion message to 02dd04db8645e62bdf18ac4e9f565897ba46b898551429aafd08421d745c4889a5.
2024-05-05T10:42:26.759055+00:00 ERROR lndk - Did not receive invoice in 100 seconds.
Error paying for offer: InvoiceTimeout

Logs from CLN:

cln1-1      | 2024-05-05T10:40:46.796Z DEBUG   02dd04db8645e62bdf18ac4e9f565897ba46b898551429aafd08421d745c4889a5-hsmd: Got WIRE_HSMD_ECDH_REQ
cln1-1      | 2024-05-05T10:40:46.797Z DEBUG   hsmd: Client: Received message 1 from client
cln1-1      | 2024-05-05T10:40:46.797Z DEBUG   02dd04db8645e62bdf18ac4e9f565897ba46b898551429aafd08421d745c4889a5-hsmd: Got WIRE_HSMD_ECDH_REQ
cln1-1      | 2024-05-05T10:40:46.797Z DEBUG   hsmd: Client: Received message 1 from client
cln1-1      | 2024-05-05T10:40:46.798Z DEBUG   lightningd: Got onionmsg reply_path
cln1-1      | 2024-05-05T10:40:46.798Z DEBUG   lightningd: Calling onion_message_recv hook of plugin offers
cln1-1      | 2024-05-05T10:40:46.807Z DEBUG   hsmd: Client: Received message 25 from client
cln1-1      | 2024-05-05T10:40:46.808Z DEBUG   plugin-offers: sendonionmessage gave JSON error: {\"code\":-1,\"message\":\"Unknown first peer\"}
cln1-1      | 2024-05-05T10:40:46.808Z DEBUG   lightningd: Plugin offers returned from onion_message_recv hook call

Environment

Please do not include private information in bug reports!

To Reproduce

See https://github.com/LN-Zap/bolt12-playground - follow the README.

orbitalturtle commented 2 months ago

@mrfelton thanks for giving this a test run! Yeah hopefully once the CLN issue that you pointed to is resolved we'll be able to pay CLN offers. Eclair works, and I believe LDK produced offers should work with the latest release as well, though I still need to test/confirm with ldk-sample or something

mrfelton commented 2 months ago

Yes - can confirm I do have this working with Eclair, so can confirm the issue looks to be with CLN specifically.