[Lightning-dev] [BOLT Draft] Onion Routing Spec

Christian Decker decker.christian at gmail.com
Mon Jul 25 16:23:15 UTC 2016


Hi all,

I took the liberty of taking apart Olaoluwa's Sphinx implementation and I
came up with a spec draft that I'd like to propose [1]. It should roughly
be Sphinx, pinning down the various key-generation and stream generation
algorithms, and adding a per-hop payload.

The per-hop payload is used to give instructions to individual hops, i.e.,
how many coins to forward to the next hop. This means that the end-to-end
payload, i.e., the message in the Sphinx protocol, is currently unused and
could be omitted.

The payloads are currently fixed size (20 bytes per-hop and 1024 bytes for
end-to-end payload) to avoid making messages collatable by their size.
However, they could easily be made variable should we decide that sending
mostly empty messages is wasteful.

The spec is implemented in Go [2] and in C [3]. The Go version is 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. I also added a small commandline tool
that allows you to write packets to stdout so that we can feed an onion
generated by the C version to the Go implementation and vice-versa :-)

Feedback is very welcome. If people like the draft I'll create
pull-requests for the spec and the implementations, but I'd like to keep
the discussion on the mailing list :-)

Cheers,
Christian

[1]
https://github.com/cdecker/lightning-rfc/blob/master/bolts/onion-protocol.md
[2] https://github.com/cdecker/lightning-onion/tree/chacha20
[3] https://github.com/cdecker/lightning/tree/chacha20
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20160725/db97ec02/attachment.html>


More information about the Lightning-dev mailing list