-
Notifications
You must be signed in to change notification settings - Fork 910
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
Experimental onion message support #3573
Closed
rustyrussell
wants to merge
25
commits into
ElementsProject:master
from
rustyrussell:guilt/onion-messages
Closed
Experimental onion message support #3573
rustyrussell
wants to merge
25
commits into
ElementsProject:master
from
rustyrussell:guilt/onion-messages
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Does the allocation and copying; this is useful because we can avoid being fooled into doing giant allocations. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
These just run the test vectors and add a test for the devtools/onion tool so we don't accidentally break them.
We will later use these to generate RV compressed onions and to opt into the rendezvous style generation.
Adds the `--rendezvous-id` option allowing the caller to specify the node_id of the rendez-vous node, and opting into the compressed onion generation.
This one generates a compressed onion, decompresses it, and then proceeds with normal processing.
Also implements a way to decompress an onion using the devtools/onion tool Changelog-Added: devtools: The `onion` tool can now generate, compress and decompress onions for rendez-vous routing
Expands the interface to play with onions a bit more. Potentially a bit slower due to allocations, but that's a small price to pay. It also allows us to avoid serializing a compressed onion to `u8*` if we process it right away.
Suggested-by: Rusty Russell <@rustyrussell> Signed-off-by: Christian Decker <@cdecker>
It also removes the duplicate compression code and serialization code.
Suggested-by: Rusty Russell <@rustyrussell> Signed-off-by: Christian Decker <@cdecker>
We're going to use this for messages, not just rendezvous. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This avoid the requirement to use a temporary file. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is in preparation for messages, which want this as their assocdata. Plus, it's a bit cleaner rather than creating a tmp tal array. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
I needed them to debug the onion messages API, so might as well record them somewhere. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
The Sphinx paper calls this "payload", but we've already used that liberally in "per-hop payload": The payload of the message is kept separate from the mix header used to perform the routing. It is decrypted at each stage of mixing using a block cipher with a large block size (the size of the entire message), such as LIONESS [1]. In case the adversary modifies the payload in transit, any information contained in it becomes irrecoverable. Sender-anonymous messages contain the final address of the message, as well as the message itself as part of the payload, and so any modification destroys this information. Since we don't want to add a block cypher, we use chacha20poly1305 with the shared secret as the key instead. This is described in a BOLT proposal: lightning/bolts#755 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
For messages, we use the onion but payload lengths 0 and 1 aren't special. Create a flag to disable that logic. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We'll need these to encrypt the end-to-end payload. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
The message construction is subtle, so I left it to userspace (after several attempts). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell
added
protocol
These issues are protocol level issues that should be discussed on the protocol spec repo
Optech Make Me Famous!
Look! Look! Look! COOL NEW FEATURE!
labels
Mar 6, 2020
CLosing, we're going to use a different approach for messaging... |
rustyrussell
removed
the
Optech Make Me Famous!
Look! Look! Look! COOL NEW FEATURE!
label
Mar 10, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
protocol
These issues are protocol level issues that should be discussed on the protocol spec repo
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See lightning/bolts#755
This is a pre-requisite (in some form!) for offers, a.k.a more powerful invoices, but it's also much more efficient than abusing HTLCs to send messages (unless you want to send a payment as well anyway).