Skip to content

Latest commit

 

History

History
58 lines (32 loc) · 4.15 KB

004-noise-handshake-implementations.md

File metadata and controls

58 lines (32 loc) · 4.15 KB

libp2p Noise handshake implementations

Motivation and context

Secure channels are a critical feature of any modern p2p network, and libp2p mandates that all traffic between peers be encrypted and authenticated.

The SecIO secure channel was developed by the libp2p community to provide authenticated key exchange and secure transport between peers. We are working on industry-standard alternatives to SecIO, like TLS 1.3 and Noise handshakes.

The specification for the Noise handshake is still being drafted, and it would be of great assistance to the spec'ing process for someone to develop proof-of-concept implementations of the latest ideas in various languages.

Value

Benefits (if addressed)

Noise is a lightweight cryptographic framework (even lighter than TLS 1.3) that is well-vetted and soundly designed. It defines a vocabulary and syntax for Diffie-Hellman operations, composed in a variety of patterns whose properties can be assessed by formal verification, and whose code can be autogenerated to avoid rolling your own crypto.

Ethereum 2.0 has tentatively picked the Noise Protocol Framework to conduct its cryptographic handshakes in mainnet. This decision is reflected in the Ethereum 2.0 networking spec. Implementing noise-libp2p will materially contribute to bring ETH2.0 a little bit closer to reality.

Risks (if not addressed)

Not implementing noise-libp2p would be a missed opportunity to improve libp2p's tech stack and grow the libp2p community, and may impact the roadmap for the Ethereum 2.0 mainnet launch.

Expected output and constraints

The ideal output is a working implementation of the noise-libp2p spec for one, or several, of the more mature libp2p implementations at the time: Go, JS, Rust, or Python.

As the noise-libp2p spec is not yet finalized, interested teams should read and comment their findings on the working draft as they develop their implementations against the current state.

A complete implementation will support all handshake patterns required by the spec and should include unit tests and API documentation.

Relevant discussion

The in-progress draft spec is the place to be for ongoing discussion, and will be the source of truth once finalized. There's also some discussion in the issue proposing the spec, as well as an earlier public proposal for a hack project.

Design/implementation notes

The draft spec is largely inspired by the existing experimental implementation in rust-libp2p, and updating rust-libp2p to conform to the spec will likely be the most straightforward project if you're a Rust developer.

The Noise Explorer command line tool is capable of generating Noise protocol implementations in Go, Rust and WebAssembly, and may form the basis of the go-libp2p implementation. We're very keen to get a Go implementation working.

The NoiseExplorer wasm target could be potentially used in a javsascript implementation as well, or there's noise-c.wasm, which compiles the noise-c implementation into wasm using Emscripten.

Python devs should look at noiseprotocol.

Potential funders

ETHBerlinZwei, Protocol Labs, Ethereum Foundation, Cosmos, Polkadot.