52 releases (breaking)

0.44.0 Nov 5, 2023
0.43.1 Aug 24, 2023
0.43.0 Jun 20, 2023
0.42.1 Mar 12, 2023
0.4.0 Mar 29, 2019

#1184 in Network programming

Download history 53015/week @ 2023-11-02 52177/week @ 2023-11-09 55243/week @ 2023-11-16 57345/week @ 2023-11-23 50755/week @ 2023-11-30 50088/week @ 2023-12-07 45513/week @ 2023-12-14 28832/week @ 2023-12-21 24413/week @ 2023-12-28 42049/week @ 2024-01-04 44572/week @ 2024-01-11 51479/week @ 2024-01-18 48185/week @ 2024-01-25 44180/week @ 2024-02-01 54670/week @ 2024-02-08 50038/week @ 2024-02-15

205,977 downloads per month
Used in 218 crates (16 directly)

MIT license

375KB
7K SLoC

Noise protocol framework support for libp2p.

Note: This crate is still experimental and subject to major breaking changes both on the API and the wire protocol.

This crate provides libp2p_core::InboundUpgrade and libp2p_core::OutboundUpgrade implementations for various noise handshake patterns (currently IK, IX, and XX) over a particular choice of Diffie–Hellman key agreement (currently only X25519).

Note: Only the XX handshake pattern is currently guaranteed to provide interoperability with other libp2p implementations.

All upgrades produce as output a pair, consisting of the remote's static public key and a NoiseOutput which represents the established cryptographic session with the remote, implementing futures::io::AsyncRead and futures::io::AsyncWrite.

Usage

Example:

use libp2p_core::{Transport, upgrade, transport::MemoryTransport};
use libp2p_noise as noise;
use libp2p_identity as identity;

let id_keys = identity::Keypair::generate_ed25519();
let noise = noise::Config::new(&id_keys).unwrap();
let builder = MemoryTransport::default().upgrade(upgrade::Version::V1).authenticate(noise);
// let transport = builder.multiplex(...);

Dependencies

~7–19MB
~278K SLoC