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

Generate default deterministic offer #626

Merged
merged 5 commits into from
Apr 25, 2024
Merged

Generate default deterministic offer #626

merged 5 commits into from
Apr 25, 2024

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Apr 11, 2024

Add the option to generate a default, deterministic offer that can be restored based on the node's seed and the trampoline node it uses. This offer has the minimal amount of information necessary. It doesn't expire, which makes it suitable to save for long-term, recurring payments.

We also include the latest changes to the specification that allow us to create this minimal offer:

  • the offer_node_id can be omitted if a blinded path is provided
  • the offer_description can be omitted if the offer doesn't have an amount

@t-bast t-bast mentioned this pull request Apr 12, 2024
@t-bast t-bast force-pushed the deterministic-offer branch from 3ce27f4 to 6a971e5 Compare April 12, 2024 14:37
@t-bast t-bast force-pushed the deterministic-offer branch from 6a971e5 to 79bd875 Compare April 22, 2024 15:57
t-bast added 3 commits April 22, 2024 18:31
Add the option to generate a default, deterministic offer that can be
restored based on the node's seed and the trampoline node it uses.
This offer has the minimal amount of information necessary. It doesn't
expire, which makes it suitable to save for long-term, recurring
payments.
When we include a blinded path in the offer, it doesn't make sense to
include an `offer_node_id`. When receiving an `invoice_request`, we
will signed the corresponding invoice with the blinded private key
matching the blinded path used by the sender.
This allows us to deterministically generate multiple offers, with
different descriptions, based on our seed and trampoline node only.
We then don't need to store those offers in a DB since they can be
recomputed on-the-fly based on the description alone.
@t-bast t-bast force-pushed the deterministic-offer branch from 79bd875 to c1e4f9a Compare April 22, 2024 16:36
The offer description has been made optional when the offer does
not contain an amount. We leverage that in our default offer to
save a few bytes.
@t-bast t-bast marked this pull request as ready for review April 24, 2024 08:41
@t-bast t-bast requested a review from thomash-acinq April 24, 2024 08:41
@t-bast t-bast merged commit 1f0b986 into master Apr 25, 2024
2 checks passed
@t-bast t-bast deleted the deterministic-offer branch April 25, 2024 08:14
@t-bast t-bast mentioned this pull request Apr 25, 2024
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

Successfully merging this pull request may close these issues.

2 participants