Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mrfelton opened this issue May 5, 2024 · 9 comments
Open

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

mrfelton opened this issue May 5, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@mrfelton
Copy link
Contributor

mrfelton commented May 5, 2024

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

  • Expected Behavior:

Should be able to pay the offer.

  • Actual Behavior:

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

  • LND Version: v0.18.0-beta.rc1
  • LNDK Version: 0f9b3c2
  • Operating System: Docker

_Please do not include private information in bug reports! _

To Reproduce

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

@mrfelton mrfelton added the bug Something isn't working label May 5, 2024
@mrfelton mrfelton changed the title Bug: Unable to pay to Bolt 12 offer from CLN Bug: Unable to pay to Bolt 12 offers May 5, 2024
@mrfelton mrfelton changed the title Bug: Unable to pay to Bolt 12 offers Bug: Unable to pay to Bolt 12 offers to CLN node May 5, 2024
@orbitalturtle
Copy link
Collaborator

@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
Copy link
Contributor Author

mrfelton commented May 6, 2024

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

@AndySchroder
Copy link

I'm having issues with CLN as well. Here are some test results.

This case fails (CLN sender: "WIRE_INVALID_ONION_BLINDING (reply from remote)"):

                    BOLT12 offer with blinded paths                                  
   sender                                                                   receiver 
+-----------+   public   +-----------+   public     +--------+   private   +--------+
|   CLN     |   channel  |  public   |   channel    |  LND   |   channel   |  CLN   |
|   v24.08  |   ------>  |  network  |   ------->   |  LNDK  |  ------->   | v24.08 |
+---------- +            +-----------+              +--------+             +--------+

This case fails (LND sender: "failed: InvalidOnionHMAC"):

                    BOLT12 offer without blinded paths        
  receiver                                            sender  
+-----------+   public   +-----------+   public     +--------+
|   CLN     |   channel  |  public   |   channel    |  LND   |
|   v24.08  |   <------  |  network  |   <-------   |  LNDK  |
+---------- +            +-----------+              +--------+

This case fails (Strike sender: "We were unable to find a payment route"):

                    BOLT12 offer without blinded paths        
  receiver                                            sender  
+-----------+   public   +-----------+   public     +--------+
|   CLN     |   channel  |  public   |   channel    | strike |
|   v24.08  |   <------  |  network  |   <-------   |        |
+---------- +            +-----------+              +--------+

This case succeeds:

                    BOLT12 offer without blinded paths                              
  receiver                                                                   sender  
+-----------+   public   +-----------+   public     +--------+   private   +--------+
|   CLN     |   channel  |  public   |   channel    |  LND   |   channel   |  CLN   |
|   v24.08  |   <------  |  network  |   <-------   |  LNDK  |  <-------   | v24.08 |
+---------- +            +-----------+              +--------+             +--------+

This case succeeds:

                    BOLT12 offer with blinded paths                              
  receiver                                                                                   sender  
+---------------------------+      ?     +-----------+   public     +--------+   private   +--------+
|   [email protected]    |   channel  |  public   |   channel    |  LND   |   channel   |  CLN   |
|    probably LDK?          |   <------  |  network  |   <-------   |  LNDK  |  <-------   |        |
+-------------------------- +            +-----------+              +--------+             +--------+

This case succeeds:

                    BOLT12 offer with blinded paths                              
  receiver                                                            sender  
+---------------------------+      ?     +-----------+   public     +--------+
|   [email protected]    |   channel  |  public   |   channel    |  LND   |
|    probably LDK?          |   <------  |  network  |   <-------   |  LNDK  |
+-------------------------- +            +-----------+              +--------+

@AndySchroder
Copy link

AndySchroder commented Oct 4, 2024

I did some more tests:

This case succeeds:

                    BOLT12 offer with blinded paths                              
  receiver                                                                     sender  
+-------------+      ?     +-----------+   public     +--------+   private   +--------+
|   phoenix   |   channel  |  ACINQ    |   channel    |  LND   |   channel   |  CLN   |
|    wallet   |   <------  |           |   <-------   |  LNDK  |  <-------   |        |
+------------ +            +-----------+              +--------+             +--------+

This case succeeds:

                    BOLT12 offer with blinded paths                              
  receiver                                              sender  
+-------------+      ?     +-----------+   public     +--------+
|   phoenix   |   channel  |  ACINQ    |   channel    |  LND   |
|   wallet    |   <------  |           |   <-------   |  LNDK  |
+-------------+            +-----------+              +--------+

@AndySchroder
Copy link

This case fails:

                    BOLT12 offer without blinded paths        
  receiver                                            sender  
+-----------+   public   +-----------+   ?          +---------+
|   CLN     |   channel  |  public   |   channel    | phoenix |
|   v24.08  |   <------  |  network  |   <-------   | wallet  |
+---------- +            +-----------+              +---------+

@AndySchroder
Copy link

This case fails:

                    BOLT12 offer with blinded paths                              
   sender                                                                     receiver  
+-------------+      ?     +-----------+   public     +--------+   private   +--------+
|   phoenix   |   channel  |  ACINQ    |   channel    |  LND   |   channel   |  CLN   |
|    wallet   |   ------>  |           |   ------->   |  LNDK  |  ------->   |        |
+------------ +            +-----------+              +--------+             +--------+

@AndySchroder
Copy link

AndySchroder commented Oct 4, 2024

This case fails (also because of #123 ?) :

 BOLT12 offer with blinded paths                                  
   sender                receiver 
+--------+   private   +--------+
|  LND   |   channel   |  CLN   |
|  LNDK  |  ------->   | v24.08 |
+--------+             +--------+


@AndySchroder
Copy link

AndySchroder commented Oct 4, 2024

@TheBlueMatt can you confirm what type of node your offer stored at [email protected] uses? Since I've used it as a test case above, would like to be able to clarify what that test case represented. I'm guessing this is LDK? If so, can you pay CLN offers from LDK?

@TheBlueMatt
Copy link

TheBlueMatt commented Oct 4, 2024

Yes it's LDK. It's a bit of an old LDK but it should work I don't think we've changed any BOLT 12 compat stuff in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants