lightningnetwork / lightning-onion

Onion Routed Micropayments for the Lightning Network
MIT License
396 stars 125 forks source link

Update sphinx onion packet format to new spec #7

Closed cdecker closed 7 years ago

cdecker commented 7 years ago

lightningnetwork/lightning-rfc#145 changes qulite a few things around, merging the routing info with the hoppayloads and generally simplifying some things. This is my attempt at implementing the changes for lnd. I also took the liberty of flattening the onionpacket, since it was just wrapping a single MixHeader anyway.

From outside the changes should be limited to passing HopData structs instead of binary hoppayloads. These also include the short_channel_id (in serialized form since I wanted to avoud having to import lnd for it), outgoing CLTV and the forwarded amount. Finally, the next hop is now identified with the short_channel_id.

cdecker commented 7 years ago

Thanks @Roasbeef , reading through your fixes now, very instructive, I'll try to achieve the same for the next PRs :wink: