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-0037: Bolt 12 encoded wallet node_id #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

t-bast
Copy link
Contributor

@t-bast t-bast commented Jul 3, 2024

Bolt 12 introduces a new sciddir_or_pubkey field that can be used to identify the introduction node of a blinded path. This is primarily used to reduce the size of encoded offers, but this encoding trick can be extended to carry more information about the node it's referencing. We introduce an additional prefix to this field to tag node_ids that belong to mobile wallets.

When relaying a payment or an onion message, wallet providers usually want to offer additional features to mobile wallets. Encoding the information that the next node is a mobile wallet directly inside the onion payload makes it easy for the relaying node to efficiently insert additional steps before relaying (such as trying to wake-up the wallet if it is offline) without negatively impacting relay to normal nodes.

[Bolt 12](lightning/bolts#798) introduces a new
`sciddir_or_pubkey` field that can be used to identify the introduction
node of a blinded path. This is primarily used to reduce the size of
encoded offers, but this encoding trick can be extended to carry more
information about the node it's referencing. We introduce an additional
prefix to this field to tag `node_id`s that belong to mobile wallets.

When relaying a payment or an onion message, wallet providers usually
want to offer additional features to mobile wallets. Encoding the
information that the next node is a mobile wallet directly inside the
onion payload makes it easy for the relaying node to efficiently insert
additional steps before relaying (such as trying to wake-up the wallet
if it is offline) without negatively impacting relay to normal nodes.
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.

It seems weird that we add an encoding for the introduction node in a bLIP? Maybe I'm misunderstanding something but don't all nodes need to support reading such nodes in order to send to offers generated with such introductions?

@t-bast
Copy link
Contributor Author

t-bast commented Jul 8, 2024

It seems weird that we add an encoding for the introduction node in a bLIP?

This isn't used for the introduction node, we're only using this in encrypted_recipient_data.next_node_id. But in the BOLTs, sciddir_or_pubkey was added to reference the introduction node, so we mention that we're re-using this same encoding elsewhere.

I could probably add a requirement to explain that you MUST NOT use this new encoding case (0x04... / 0x05...) to reference introduction nodes, but it wouldn't make sense anyway, because a wallet will never be found in the public graph so it will never use itself as the introduction node of a blinded path, it will always use its LSP or another public node?

@TheBlueMatt
Copy link
Contributor

This isn't used for the introduction node, we're only using this in encrypted_recipient_data.next_node_id.

Ah, okay, that's what I thought, that makes more sense. Was just confused by the wording!

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