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

BOLT12: can't decode offer (invalid token) #7402

Open
urza opened this issue Jun 16, 2024 · 4 comments
Open

BOLT12: can't decode offer (invalid token) #7402

urza opened this issue Jun 16, 2024 · 4 comments

Comments

@urza
Copy link
Contributor

urza commented Jun 16, 2024

This is public bolt12 offer of @Sjors

lno1pg4y7ur9dcs8xmm4wf3k2gryv4mx2mr0wpkk2mn5ypjx7mnpw35k7m3qvehhygzndfhhyuc5pefk5mmjwvs9qun0wehk7um5rcsrwlufzdn408gvmlpgxw7rywsaq9g5a6jq6jxvapknrcucyglqevlsgqgf4k7rc5runmkuex8ue6jrj0r9jszltusclp4yd0z4mekwa7k8dfskd2ltdlfmcdnm6f0sv5jsrs6t3vkql8nav0vl6w4l44gmaf4c

when I try to decode it with CLN 24.05 I get:

cln decode lno1pg4y7ur9dcs8xmm4wf3k2gryv4mx2mr0wpkk2mn5ypjx7mnpw35k7m3qvehhygzndfhhyuc5pefk5mmjwvs9qun0wehk7um5rcsrwlufzdn408gvmlpgxw7rywsaq9g5a6jq6jxvapknrcucyglqevlsgqgf4k7rc5runmkuex8ue6jrj0r9jszltusclp4yd0z4mekwa7k8dfskd2ltdlfmcdnm6f0sv5jsrs6t3vkql8nav0vl6w4l44gmaf4c
{
   "code": -32602,
   "message": "string: invalid offer data: invalid token '\"lno1pg4y7ur9dcs8xmm4wf3k2gryv4mx2mr0wpkk2mn5ypjx7mnpw35k7m3qvehhygzndfhhyuc5pefk5mmjwvs9qun0wehk7um5rcsrwlufzdn408gvmlpgxw7rywsaq9g5a6jq6jxvapknrcucyglqevlsgqgf4k7rc5runmkuex8ue6jrj0r9jszltusclp4yd0z4mekwa7k8dfskd2ltdlfmcdnm6f0sv5jsrs6t3vkql8nav0vl6w4l44gmaf4c\"'"
}
@Sjors
Copy link
Contributor

Sjors commented Jun 16, 2024

Strangely my lightning-cli decode ... also says its invalid. But it comes straight from the listoffers RPC.

      {
         "offer_id": "...",
         "active": true,
         "single_use": false,
         "bolt12": "lno1...f4c",
         "used": false,
         "label": "open-source-donation"
      },

@Sjors
Copy link
Contributor

Sjors commented Jun 16, 2024

I vaguely remember the spec changed a while ago, but in that case I would expect it to marked as invalid, or maybe not active.

@urza urza changed the title BOLT12: can't decode offer BOLT12: can't decode offer (invalid token) Jun 17, 2024
@jkczyz
Copy link

jkczyz commented Jun 17, 2024

Looks like this offer is using TLV type 20 for the issuer whereas the spec was changed to use that for max quantity.

@Sjors
Copy link
Contributor

Sjors commented Jun 17, 2024

I'm happy to generate a new offer of course, but it would still be good if cln marked it as incorrect somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants