Great thread! Here's the Onion Routing section of the spec for anybody that wants to dive deeper: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
One fun fact is that the routing schema is based on the Sphinx construction, which is where Sphinx.Chat got its name from.