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

Encode doesn't support expiry tag or signature tag in tags.py enum #40

Open
EricPgh opened this issue Feb 18, 2024 · 2 comments
Open

Encode doesn't support expiry tag or signature tag in tags.py enum #40

EricPgh opened this issue Feb 18, 2024 · 2 comments

Comments

@EricPgh
Copy link

EricPgh commented Feb 18, 2024

Performing a sequential decode/encode on an LND invoice throws exceptions. The expiry and signature tags specifically. The Enum in tags.py doesn't appear to be in-spec with the bolt11 spec.

@dni
Copy link
Member

dni commented Feb 19, 2024

hey thanks for using that library :)!

can you be more specific on that or maybe even provide a testcase?

the expiry tag x is here: https://github.com/lnbits/bolt11/blob/main/bolt11/models/tags.py#L18

@EricPgh
Copy link
Author

EricPgh commented Feb 19, 2024

My use case might be a little pointless. I've noticed LND invoices aren't handled well by core, so I was trying to see what was a cause. I'll try to provide a testcase from my CLI when I'm back on that machine. But in more specifics, if a valid invoice comes in, including signature and expiry fields, the bolt11 decode produces those ("signature": and "expiry":) in the JSON structure. Passing the same JSON structure back into bolt11 encode first throws an exception that "expiry" is a bad char (emanating from Line 81 ). If I edit the JSON tag from "expiry" to "expire_time" that exception goes away and then the signature exception shows up (emanating from types.py ). I hope this is more clear for the moment.

Edit
Here's a mt socks invoice (expired) that can show this progression.
lnbc1800u1pj6fnl2pp5ucyqm8yjw0c88kqtpqxjaxdq0txavfu5s30krxcwg5c32nanpmrqdqqcqzzsxqrrs0fppq7czg8plqre836w3w4ea0fcm3p86p2rw3sp5q9pf9f2ar3ze0zxyypzj2yuyzdwqryj662evjtyfavsk333hyvhs9qyyssqye8asutxnxc7ar6tfd24hp2j83zfd20z328mt90g9y7jnaykqz8s960fxkmpty8m6m85kauvnt9q866tt2hk2j9ce4zze8wf3aclh9cprw50al

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

No branches or pull requests

2 participants