-
Notifications
You must be signed in to change notification settings - Fork 367
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
Onion messages v1 #1503
Onion messages v1 #1503
Commits on Aug 2, 2022
-
Add onion messages module + enable the construction of blinded routes
Blinded routes can be provided as destinations for onion messages, when the recipient prefers to remain anonymous. We also add supporting utilities for constructing blinded path keys, and control TLVs structs representing blinded payloads prior to being encoded/encrypted. These utilities and struct will be re-used in upcoming commits for sending and receiving/forwarding onion messages. Finally, add utilities for reading the padding from an onion message's encrypted TLVs without an intermediate Vec.
Configuration menu - View commit details
-
Copy full SHA for 4e5381a - Browse repository at this point
Copy the full SHA 4e5381aView commit details -
Add onion_message::Packet and adapt construct_onion_packet_with_init_…
…noise for it We need to add a new Packet struct because onion message packet hop_data fields can be of variable length, whereas regular payment packets are always 1366 bytes. Co-authored-by: Valentine Wallace <[email protected]> Co-authored-by: Jeffrey Czyz <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 33ff274 - Browse repository at this point
Copy the full SHA 33ff274View commit details -
KeysInterface: add new ecdh method
This method will help us avoid retrieving our node secret, something we want to get rid of entirely. It will be used in upcoming commits when decoding the onion message packet, and in future PRs to help us get rid of KeysInterface::get_node_secret usages across the codebase
Configuration menu - View commit details
-
Copy full SHA for 6017379 - Browse repository at this point
Copy the full SHA 6017379View commit details -
Add baseline OnionMessenger and msgs::OnionMessage and its serialization
OnionMessenger will be hooked up to the PeerManager to send and receive OMs in a follow-up PR.
Configuration menu - View commit details
-
Copy full SHA for 4c8dc2c - Browse repository at this point
Copy the full SHA 4c8dc2cView commit details -
Support sending onion messages
This adds several utilities in service of then adding OnionMessenger::send_onion_message, which can send to either an unblinded pubkey or a blinded route. Sending custom TLVs and sending an onion message containing a reply path are not yet supported. We also need to split the construct_keys_callback macro into two macros to avoid an unused assignment warning.
Configuration menu - View commit details
-
Copy full SHA for 9051c38 - Browse repository at this point
Copy the full SHA 9051c38View commit details -
Implement receiving and forwarding onion messages
This required adapting `onion_utils::decode_next_hop` to work for both payments and onion messages. Currently we just print out the path_id of any onion messages we receive. In the future, these received onion messages will be redirected to their respective handlers: i.e. an invoice_request will go to an InvoiceHandler, custom onion messages will go to a custom handler, etc.
Configuration menu - View commit details
-
Copy full SHA for bf007ea - Browse repository at this point
Copy the full SHA bf007eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for b26fb85 - Browse repository at this point
Copy the full SHA b26fb85View commit details -
Configuration menu - View commit details
-
Copy full SHA for eaff561 - Browse repository at this point
Copy the full SHA eaff561View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6500c99 - Browse repository at this point
Copy the full SHA 6500c99View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39397d4 - Browse repository at this point
Copy the full SHA 39397d4View commit details -
Fix possible incomplete read bug on onion packet decode
Pre-existing to this PR, we were reading next packet bytes with io::Read::read, which is not guaranteed to read all the bytes we need, only guaranteed to read *some* bytes. We fix this to be read_exact, which is guaranteed to read all the next hop packet bytes.
Configuration menu - View commit details
-
Copy full SHA for 17ec697 - Browse repository at this point
Copy the full SHA 17ec697View commit details