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

blip-0039: BOLT 11 Invoice Blinded Path Tagged Field #39

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

ellemouton
Copy link
Contributor

This bLIP defines a new tagged field, b, for the payment invoice
encoding described by BOLT 11 which can be used to communicate
encoded blinded path information to the payer of the invoice. It also
introduces a new feature bit for the I context to indicate the
presence of the new field in an invoice.

Delving Post: https://delvingbitcoin.org/t/blip-bolt-11-invoice-blinded-path-tagged-field/991
Implementation: lightningnetwork/lnd#8752

@ellemouton ellemouton changed the title blip-39: BOLT 11 Invoice Blinded Path Tagged Field blip-0039: BOLT 11 Invoice Blinded Path Tagged Field Jul 8, 2024
blip-0039.md Outdated
receiver being able to select paths it knows to be more reliable. This document
proposes a carve-out to the existing [BOLT 11][bolt11] invoice format so that
advantage can be taken of the blinded paths protocol in the context of payments
in a sooner time frame. This will be done by adding a new tagged-field type to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, it doesn't allow for a faster time frame given it's rolling out yet another invoice format, but if y'all want another lnd-specific invoice format, go for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeframe 1: implement route blinding + implement b12 invoices format + implement onion messages + implement offers flow -> ok now we can make use of route blinding.

timeframe 2: implement route blinding + add new tagged field -> k now we can make use of route blinding.

timeframe 2 seems faster. It's also not a new invoice format, it's just adding a new tagged field.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implement route blinding + implement b12 invoices format + implement onion messages + implement offers flow -> ok now we can make use of route blinding.

Sure, just that everyone but lnd already did that so the total time there is now zero :)

It's also not a new invoice format, it's just adding a new tagged field.

For all intents and purposes its a new invoice format, just one that happens to share most of the same fields and format as BOLT 11. All existing senders won't support it so will fail to pay.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, just that everyone but lnd already did that so the total time there is now zero :)

There's still quite a lot of existing work unfinished w.r.t the long tail of ensuring blinded paths works well in production, eg:

  • how many introduction nodes
  • how are they chosen, path finding algo changes, etc
  • dummy hop concerns
  • mpp over blinded paths
  • CLTV and other policy buffers
  • fixed path lengths

Having a set invoice format allows implementations to hone in on the questions above in isolation. Eg: IIUC some implementations only support creating/sending to a single blinded path. For us being able to test blinded paths in isolation has enabled us to find some interesting existing edge cases in spec/implementation, and also find some new higher order use cases.

For all intents and purposes its a new invoice format

That's quite an interpretation of the phrase "invoice format" 🙃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's quite an interpretation of the phrase "invoice format" 🙃

Here I use the phrase to mean "a standard format that most, or really all, nodes can read". This is clearly a new format by that definition, just one that happens to share many of the same fields as the existing BOLT 11 one :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated this to say that it is for testing 👍

## Backwards Compatibility

BOLT 11 states that the reader of an invoice "MUST skip over unknown fields".
This means that an un-updated reader of an invoice that includes the new tagged
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? So the blinded path is informational? Wouldn't the invoice instead be signed by a random key so that you get blinding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the question?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order for blinded paths in a BOLT 11 to be useful it has to be a required feature and we have to not reveal who the recipient node is via the existing BOLT 11 recipient fields (both the pubkey and the route hints). That is what I understood was going on, but here it says that existing senders will just ignore the blinded path fields?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, if you use a blinded path, but it's optional and the invoice contains identifying information for the recipient to fallback when not using blinded paths, then that blinded path doesn't provide any privacy?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe I got this wrong: there is no routing hint anyway, so a reader that doesn't know how to read the blinded path won't have a complete enough invoice and will simply fail without attempting the payment?

Copy link
Contributor

@Roasbeef Roasbeef Jul 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe I got this wrong: there is no routing hint anyway, so a reader that doesn't know how to read the blinded path won't have a complete enough invoice and will simply fail without attempting the payment?

Yeah there would be no routing hint, a required feature bit, and also the pubkey in the invoice would be random (not actually the node ID of the node creating the invoice).

So even assuming the parsing node ignores the feature bits, they would see a node ID that appears unconnected, as it isn't found in the main public graph.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, okay, that's how I'd assumed it worked, can we clarify this in the bLIP though?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some extra info at the end - lemme know if this looks ok


## Universality

This proposal is a temporary measure that will allow users to start making use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to call out that this is really just for testing and won't be broadly adopted - I don't think "temporary" means it shouldn't be in the BOLTs, but rather "not everyone can/will/should adopt this". "Temporary and most people won't adopt this cause it's for testing and everyone else already shipped offers" clearly meets that bar, "it's temporary" doesn't assuming there's some reason why everyone actually needs to adopt it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "temporary" and "forecasted temporary use of the new field" implies this already no? Feels like writing "this wont be broadly adopted" is a bit to "hard" since we cant dictate via the spec that it wont be adopted broadly right? So here the wording implies: that this wasnt designed to be used long term but without actually making predictions re how it will be used. It does also say later on "Once the Offers protocol along with its new invoice format has been widely deployed, then there will be no use for this BOLT 11 carve-out."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood this was really more for testing (ie it makes sense that its just gonna be an lnd thing cause its for lnd users to test blinded paths or for use in other contexts where everyone involved is running lnd and they know everyone supports this feature via some prenegotiation), is that not the intent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a piece at the end re this being for testing - lemme know if that looks ok?

Copy link
Contributor Author

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking an initial look at this @TheBlueMatt 🙏 responded to your comments. One comment was unclear to me.

blip-0039.md Outdated
receiver being able to select paths it knows to be more reliable. This document
proposes a carve-out to the existing [BOLT 11][bolt11] invoice format so that
advantage can be taken of the blinded paths protocol in the context of payments
in a sooner time frame. This will be done by adding a new tagged-field type to
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeframe 1: implement route blinding + implement b12 invoices format + implement onion messages + implement offers flow -> ok now we can make use of route blinding.

timeframe 2: implement route blinding + add new tagged field -> k now we can make use of route blinding.

timeframe 2 seems faster. It's also not a new invoice format, it's just adding a new tagged field.

## Backwards Compatibility

BOLT 11 states that the reader of an invoice "MUST skip over unknown fields".
This means that an un-updated reader of an invoice that includes the new tagged
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the question?


## Universality

This proposal is a temporary measure that will allow users to start making use
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "temporary" and "forecasted temporary use of the new field" implies this already no? Feels like writing "this wont be broadly adopted" is a bit to "hard" since we cant dictate via the spec that it wont be adopted broadly right? So here the wording implies: that this wasnt designed to be used long term but without actually making predictions re how it will be used. It does also say later on "Once the Offers protocol along with its new invoice format has been widely deployed, then there will be no use for this BOLT 11 carve-out."

@ellemouton ellemouton force-pushed the bolt11-blinded-path branch from d4e6787 to 599759c Compare July 29, 2024 09:58
Copy link
Contributor Author

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the concerns :)

blip-0039.md Outdated
receiver being able to select paths it knows to be more reliable. This document
proposes a carve-out to the existing [BOLT 11][bolt11] invoice format so that
advantage can be taken of the blinded paths protocol in the context of payments
in a sooner time frame. This will be done by adding a new tagged-field type to
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated this to say that it is for testing 👍


## Universality

This proposal is a temporary measure that will allow users to start making use
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a piece at the end re this being for testing - lemme know if that looks ok?

## Backwards Compatibility

BOLT 11 states that the reader of an invoice "MUST skip over unknown fields".
This means that an un-updated reader of an invoice that includes the new tagged
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some extra info at the end - lemme know if this looks ok

Copy link
Contributor

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a well-formed spec that is not targeting broad adoption, which meets the requirements for a bLIP. Didn't carefully read all of it but there's enough here someone could probably implement it, so makes sense to land.

blip-0002.md Outdated
| 54/55 | `keysend` | A form of spontaneous payment | N | `var_onion_optin` | [bLIP 3](./blip-0003.md) |
| 256/257 | `hosted_channels` | This node accepts requests for hosted channels | IN | | [bLIP 17](./blip-0017.md) |
| 258/259 | `dns_resolver` | This node accepts DNSSEC proof requests | N | | [bLIP 32](./blip-0032.md) |
| 260/261 | `bolt11_blinded_path` | This invoice may contain a new blinded path tagged field | I | `option_route_blinding` | [bLIP 39](./blip-0039.md) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with the feature bits in #27!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oooo great catch! thank you!

@ellemouton
Copy link
Contributor Author

updated to 262/263 - thanks @carlaKC 🙏

@ellemouton ellemouton force-pushed the bolt11-blinded-path branch from bb06b52 to 8415112 Compare August 12, 2024 08:42
Copy link
Contributor

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎍

@Roasbeef Roasbeef merged commit 9a1bd0a into lightning:master Aug 14, 2024
@ellemouton ellemouton deleted the bolt11-blinded-path branch August 14, 2024 04:21
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.

5 participants