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

WIP: BOLT 7: Onion message support. #759

Open
wants to merge 4 commits into
base: master
from

Conversation

@rustyrussell
Copy link
Collaborator

rustyrussell commented Mar 20, 2020

These use onion encoding for simple one-way messaging: there are no error returns.

Any reply is done with an enclosed blinded path, a-la @t-bast .

Note that this defines the message system, not the contents of messages
(e.g. invoice requests from offers).

These use onion encoding for simple one-way messaging: there are no error returns.

Any reply is done with an enclosed blinded path.

Note that this defines the message system, not the contents of messages
(e.g. invoice requests from offers).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Mar 20, 2020
This tracks lightningnetwork/lightning-rfc#759

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1. type: 385 (`onion_message`) (`option_onion_messages`)
2. data:
* [`1366*byte`:`onionmsg`]
* [`onion_message_tlvs`:`onion_message_tlvs`]

This comment has been minimized.

Copy link
@t-bast

t-bast Mar 20, 2020

Collaborator

nit: indent


Onion messages are unreliable: in particular, they are designed to
be cheap to process and require no storage to forward. As a result,
there is no error return from intermediary nodes.

This comment has been minimized.

Copy link
@t-bast

t-bast Mar 20, 2020

Collaborator

nit:

Suggested change
there is no error return from intermediary nodes.
there is no error returned from intermediary nodes.
1. type: 385 (`onion_message`) (`option_onion_messages`)
2. data:
* [`1366*byte`:`onionmsg`]
* [`onion_message_tlvs`:`onion_message_tlvs`]

This comment has been minimized.

Copy link
@t-bast

t-bast Mar 20, 2020

Collaborator

BTW seeing that makes me realize something about the TLV extension in update_add_htlc.
For blinded paths, the update_add_htlc will have a different size from "normal" update_add_htlcs.
That means their anonymity set will be reduced and network observers could unblind paths.

I don't have a solution yet, but we should try to make all update_add_htlcs the same size, otherwise it's somewhat useless to have a fixed-size onion in it...


## The `onion_message` Message

1. type: 385 (`onion_message`) (`option_onion_messages`)

This comment has been minimized.

Copy link
@t-bast

t-bast Mar 20, 2020

Collaborator

NB: you didn't add option_onion_messages in Bolt 9 yet, is that intentional?

This comment has been minimized.

Copy link
@rustyrussell

rustyrussell Mar 29, 2020

Author Collaborator

Oops, will do.

- For the remaining `reply_path` `path`:
- MUST set `node_id` to the blinded node id to encrypt the onion hop for.
- Within `reply_path` `path`:
- MUST set `enctlv` to the ChaCha20 encryption of a valid `encmsg_tlvs` containing exactly

This comment has been minimized.

Copy link
@t-bast

t-bast Mar 20, 2020

Collaborator

ChaCha20-Poly1305?

This comment has been minimized.

Copy link
@rustyrussell

rustyrussell Mar 29, 2020

Author Collaborator

Yes, with all-zero nonce. I fixed to xref into the (not yet included!) blinded path spec.

rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Mar 29, 2020
This tracks lightningnetwork/lightning-rfc#759

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It simplifies things a little if we make field numbers match the proposed
blinded HTLC fields (esp. next_short_channel_id).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Add draft feature bit for onion_messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Make reference to the yet-to-be-merged blinded path spec part explicit.
Fix up tabs in indent, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell force-pushed the rustyrussell:onion-messages branch from 305ef45 to 6b6c5fc Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.