Using libp2p as a communication protocol for Lightning



Summary:

The Lightning community has been asked why it doesn't use existing open source technologies and standards, such as libp2p for communication or various multiformats standards for addresses, hashes, and encodings. The community has responded that while libp2p aims to be a kind of swiss-army knife for p2p networking, it may not be the best option for security-focused use-cases. For lightning, a very simple transport with no options whatsoever is preferred. Writing connection logic and peer management is not complicated compared to HTLC state machines and other aspects of lightning. Crypto for lightning does use the noise framework, although the resulting code is so simple that it is easy to write it yourself instead of fighting with a dependency. Lastly, pulling simple connection logic into a lightning implementation makes it easier to test/fuzz/etc with the rest of a project. While building and evolving common toolkits and standards for decentralized systems could be useful for the entire community, there may not be enough time for coordination and consensus to build these types of specs. Therefore, the Lightning community prefers to use a simple transport and auditable dependencies in its lightning implementation.


Updated on: 2023-06-02T23:45:07.728204+00:00