lightning-dev

[BOLT Draft] Onion Routing Spec

[BOLT Draft] Onion Routing Spec

Original Postby Christian Decker

Posted on: July 25, 2016 16:23 UTC

Christian has proposed a spec draft for an implementation similar to Sphinx, with various key-generation and stream generation algorithms.

This new implementation would also add a per-hop payload that is used to give instructions to individual hops on how many coins to forward to the next hop. The end-to-end payload, which is the message in the Sphinx protocol, is currently unused and could be omitted. Payloads are fixed size at 20 bytes per-hop and 1024 bytes for end-to-end payload to avoid making messages collatable by their size, but they could easily be made variable. The spec has been implemented in Go and C, with the Go version being an adaptation of Olaoluwa's implementation, with some minor speedups, removing some duplicate information, stripping the header, and switching to ChaCha20 for stream generation and encryption. Christian has added a small command-line tool that allows packets to be written to stdout, enabling an onion generated by the C version to be fed to the Go implementation and vice versa. Feedback is welcome, and if people like the draft, pull-requests will be created for the spec and implementations, but discussion should remain on the mailing list.