ONION Routing (Lightning Network Privacy)
1 min read
Pronunciation
[uhn-yuhn roo-ting]
Analogy
Like sending a sealed envelope within several nested envelopes; each post office only removes one layer and doesn’t know the final destination.
Definition
A privacy technique in Lightning where payment routing information is encrypted in multiple layers (onion) so each intermediary only knows its predecessor and successor, hiding end‑to‑end details.
Key Points Intro
Onion routing secures Lightning payments by encrypting route hops in layers.
Key Points
Sphinx packets: Standard format for layered encryption.
Hop‑by‑hop: Each node decrypts one layer to reveal next hop.
Unlinkability: No node sees full path or payment value.
Replay protection: Unique per‑payment session keys.
Example
Alice pays Bob over Lightning via nodes X and Y: Alice constructs Sphinx packet, X learns only Alice→Y, Y learns only X→Bob.
Technical Deep Dive
Use Sphinx: derive per‑hop shared secret via ECDH, encrypt routing info with symmetric key, build packet with routing header and MAC. Each hop processes `onion_forward` decompressing one layer.
Security Warning
Compromised nodes on path can link adjacent hops; choose diverse high‑uptime nodes.
Caveat
Onion encryption adds latency and packet overhead.
ONION Routing (Lightning Network Privacy) - Related Articles
No related articles for this term.