libp2p-core
Core traits and structs of libp2p
0.43.2
19M downloads/mo
#2129 most downloaded on crates.io
libp2p/rust-libp2p
What this package is like to depend on
Last release 8 months ago
22 Dec 2025
Release timing varies
gaps range from 2 weeks to 7 months
Some releases are documented
notes for 44 of 77 stable releases
1 version withdrawn
withdrawn after publishing
8 years old
81 releases · first in 2019
1 release in the last 12 months
see the full history below
Release timeline
81 releases · Jan 2019 to Dec 2025Releases
latest 60 of 81-
0.43.222 Dec 2025Release notes
Open source →Fixes #6204
PAYLOAD_TYPE: "/libp2p/routing-state-record" → [0x03, 0x01]
DOMAIN_SEP: "libp2p-routing-state" → "libp2p-peer-record"
The payload type [0x03, 0x01] is the multicodec identifier for libp2p-peer-record, as defined in:
Multicodec table
This matches the implementations in:PR Recreation Notice
This PR is a recreation of [#6205], which was automatically closed after I mistakenly deleted my fork.
It restores the exact same code and commits as before. No additional changes were made.Follow-up plan (based on discussion in the original PR)
During the previous review, the suggested direction was:
Introduce this change behind a new Cargo feature, which will be false by default.
Deprecate the current implementation, allowing users to switch gradually.
Give the ecosystem time to migrate, before potentially making the new behavior the default in the future.
Why I’m reopening now
This PR is being reopened and then I added the new optional
peer-record-interopfeature flag.Testing
Added cross-implementation interoperability tests:core/tests/peer_record_interop.rs - Tests that verify Rust can decode and verify signed peer records from Go and JS
core/tests/fixtures/ - Test fixtures with signed peer records generated by Go and JS implementations
Before the fix, these tests failed with:BadPayload(UnexpectedPayloadType { expected: [47, 108, ...], got: [3, 1] })
After the fix, all tests pass.
Breaking Change
⚠️ BREAKING CHANGE: Existing signed peer records created with Rust libp2p will not be verifiable with this change, as the domain and payload type have changed. However, this is necessary to fix interoperability with Go/JS libp2p implementations.Notes & open questions
None - this is a straightforward alignment with the standard used by other libp2p implementations.
Change checklist
[x ] I have performed a self-review of my own code
I have made corresponding changes to the documentation
I have added tests that prove my fix is effective or that my feature works
[x ] A changelog entry has been made in the appropriate cratesPull-Request: #6230.
Release notes
Open source →-
Add
*_interopmethods toPeerRecordfor cross-implementation compatibility with Go and JavaScript libp2p.PeerRecord::new_interop()- Create peer records using standard formatPeerRecord::from_signed_envelope_interop()- Verify peer records using standard format
The standard format uses libp2p-peer-record domain and multicodec identifier (0x0301) for interoperability. Existing methods (
new(),from_signed_envelope()) maintain backward compatibility with legacy Rust libp2p format.Use the
*_interopvariants when exchanging peer records with non-Rust libp2p implementations.See PR 6230.
-
-
0.43.127 Jun 2025 -
0.43.014 Jan 2025Release notes
Open source →- Added
libp2p::core::util::unreachablethat is a drop-in replacement ofvoid::unreachable. See PR 5676.
- Added
-
0.42.113 Jan 2025 withdrawnNothing published for this version
-
0.42.009 Aug 2024Release notes
Open source →- Update
Transport::dialfunction signature with aDialOptsparam and removeTransport::dial_as_listener:DialOptsstruct containsPortUseandEndpoint,PortUseallows controlling port allocation of new connections (defaults toPortUse::Reuse) -- Add
port_usefield toConnectedPoint - Set
endpointfield inDialOptstoEndpoint::Listenerto dial as a listener
- Remove
Transport::address_translationand relocate functionality tolibp2p_swarm
See [PR 4568].
- Update
-
0.41.305 Jul 2024 -
0.41.204 Dec 2023 -
0.41.112 Nov 2023Release notes
Open source →- Implement
{In,Out}boundConnectionUpgradeforSelectUpgrade. See PR 4812.
- Implement
-
0.41.005 Nov 2023Release notes
Open source →- Remove blanket-impl of
{In,Out}boundUpgradefor{In,Out}boundConnectionUpgrade. See PR 4695. - Remove deprecated functions from
ListenerId. See PR 4736. - Remove
upgrade::transfermodule. See issue 4011 for details. See PR 4788.
- Remove blanket-impl of
-
0.40.122 Sep 2023 -
0.40.020 Jun 2023Release notes
Open source →-
Allow
ListenerIdto be user-controlled, i.e. to be provided onTransport::listen_on. See PR 3567. -
Raise MSRV to 1.65. See PR 3715.
-
Remove deprecated symbols related to upgrades. See PR 3867.
-
Enforce protocol names to be valid UTF8 strings as required by the spec. We delete the
ProtocolNametrait and replace it with a requirement forAsRef<str>. See PR 3746 -
Remove
SingletonMuxer. See PR 3883. -
Add
global_only::Transportthat refuses to dial IP addresses from private ranges. See PR 3814. -
Remove
upgrade::{apply, apply_inbound, apply_outbound, InboundUpgradeApply, OutboundUpgradeApply}from public API. These are implementation details that should not be depended on. See PR 3915. -
Remove deprecated
identitymodule. Depend onlibp2p-identitydirectly instead or import it via thelibp2p::identityre-export. See PR 4040.
-
-
0.39.201 May 2023 -
0.39.112 Mar 2023Release notes
Open source →- Migrate from
prosttoquick-protobuf. This removesprotocdependency. See [PR 3312].
- Migrate from
-
0.39.024 Feb 2023Release notes
Open source →- Move
ConnectionIdtolibp2p-swarm. See [PR 3221]. - Move
PendingPointtolibp2p-swarmand make it crate-private. See [PR 3221].
- Move
-
0.38.025 Nov 2022Release notes
Open source →-
Remove deprecated functions
StreamMuxerExt::next_{inbound,outbound}. See PR 3031. -
Hide
prost::Errorfrom public API inFromEnvelopeError::InvalidPeerRecordandsigned_envelope::DecodingError. See PR 3058. -
Move
Executortolibp2p-swarm. See PR 3097. -
Update
rust-versionto reflect the actual MSRV: 1.60.0. See PR 3090. -
Update
multistream-selecttov0.12.1. See PR 3090. -
Improve error messages in case keys cannot be decoded because of missing feature flags. See PR 2972.
-
Remove
EitherErrorin favor ofeither::Either. See PR 3337. -
Remove
EitherTransportin favor of implementingTransportoneither::Either. See PR 3338. -
Remove
EitherUpgradein favor of implementingUpgradeInfo,InboundUpgradeandOutboundUpgradeoneither::Either. See PR 3339. -
Remove
EitherFuture2in favor ofEitherFuture. See PR 3340. -
Remove
EitherOutputin favor offuture::Either. See PR 3341.
-
-
0.37.014 Oct 2022 -
0.36.007 Sep 2022 -
0.35.123 Aug 2022 -
0.35.022 Aug 2022Release notes
Open source →- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler. Thus you will need protoc installed locally. See PR 2788.
- Drop
Unpinrequirement fromSubstreamBox. See PR 2762 and PR 2776. - Drop
Syncrequirement onStreamMuxerfor constructingStreamMuxerBox. See PR 2775. - Use
Pin<&mut Self>as the receiver type for allStreamMuxerpoll functions. See PR 2765. - Change
StreamMuxerinterface to be entirely poll-based. All functions onStreamMuxernow require aContextand returnPoll. This gives callers fine-grained control over what they would like to make progress on. See PR 2724 and PR 2797.
-
0.34.005 Jul 2022Release notes
Open source →-
Remove
{read,write,flush,shutdown,destroy}_substreamfunctions fromStreamMuxertrait in favor of forcingStreamMuxer::Substreamto implementAsyncRead + AsyncWrite. See PR 2707. -
Replace
Into<std::io::Error>bound onStreamMuxer::Errorwithstd::error::Error. See PR 2710. -
Remove the concept of individual
Transport::Listenerstreams fromTransport. Instead theTransportis polled directly viaTransport::poll. TheTransportis now responsible for driving its listeners. See PR 2652.
-
-
0.33.031 May 2022 -
0.32.104 Apr 2022Release notes
Open source →- Add
PeerId::try_from_multiaddrto extract aPeerIdfrom aMultiaddrthat ends in/p2p/<peer-id>.
- Add
-
0.32.022 Feb 2022Release notes
Open source →-
Remove
Network.libp2p-coreis from now on an auxiliary crate only. Users that have previously usedNetworkonly, will need to useSwarminstead. See PR 2492. -
Update to
multiaddrv0.14.0. -
Update to
multihashv0.16.0. -
Implement
DisplayonDialError. See PR 2456. -
Update to
parking_lotv0.12.0. See PR 2463. -
Validate PeerRecord signature matching peer ID. See RUSTSEC-2022-0009.
-
Don't take ownership of key in
PeerRecord::newandSignedEnvelope::new. See PR 2516. -
Remove
SignedEnvelope::payloadin favor ofSignedEnvelope::payload_and_signing_key. The caller is expected to check that the returned signing key makes sense in the payload's context. See PR 2522.
-
-
0.31.106 Feb 2022Nothing published for this version
-
0.31.027 Jan 2022Release notes
Open source →-
Update dependencies.
-
Report concrete connection IDs in
NetworkEvent::ConnectionEstablishedandNetworkEvent::ConnectionClosed(see PR 2350). -
Migrate to Rust edition 2021 (see PR 2339).
-
Add support for ECDSA identities (see PR 2352).
-
Add
ConnectedPoint::is_relayed(see PR 2392). -
Enable overriding dial concurrency factor per dial via
DialOpts::override_dial_concurrency_factor.- Introduces
libp2p_core::DialOptsmirroringlibp2p_swarm::DialOpts. Passed as an argument toNetwork::dial. - Removes
Peer::dialin favor ofNetwork::dial.
See PR 2404.
- Introduces
-
Implement
SerializeandDeserializeforPeerId(see PR 2408) -
Report negotiated and expected
PeerIdas well as remote address inDialError::WrongPeerId(see PR 2428). -
Allow overriding role when dialing. This option is needed for NAT and firewall hole punching.
-
Add
Transport::dial_as_listener. AsTransport::dialbut overrides the role of the local node on the connection . I.e. has the local node act as a listener on the outgoing connection. -
Add
override_roleoption toDialOpts.
See PR 2363.
-
-
-
0.30.207 Feb 2022Nothing published for this version
-
0.30.001 Nov 2021Release notes
Open source →-
Add
ConnectionLimit::with_max_established(see PR 2137). -
Add
Keypair::to_protobuf_encoding(see PR 2142). -
Change
PublicKey::into_protobuf_encodingtoPublicKey::to_protobuf_encoding(see PR 2145). -
Change
PublicKey::into_peer_idtoPublicKey::to_peer_id(see PR 2145). -
Change
PeerId::from_public_key(PublicKey)toPeerId::from_public_key(&PublicKey)(see PR 2145). -
Add
From<&PublicKey> for PeerId(see PR 2145). -
Remove
TInEventandTOutEventtrait parameters on most public types.TInEventandTOutEventare implied throughTHandlerand thus superfluous. Both are removed in favor of a derivation throughTHandler(see PR 2183). -
Require
ConnectionHandler::{InEvent,OutEvent,Error}to implementDebug(see PR 2183). -
Remove
DisconnectedPeer::set_connectedandPool::add(see PR 2195). -
Report
ConnectionLimiterror throughConnectionErrorand thus throughNetworkEvent::ConnectionClosedinstead of previously throughPendingConnectionErrorand thusNetworkEvent::{IncomingConnectionError, DialError}(see PR 2191). -
Report abortion of pending connection through
DialError,UnknownPeerDialErrororIncomingConnectionError(see PR 2191). -
Remove deprecated functions
upgrade::write_one,upgrade::write_with_len_prefixandupgrade::read_one(see PR 2213). -
Add
SignedEnvelopeandPeerRecordaccording to RFC0002 and RFC0003 (see PR 2107). -
Report
ListenersEvent::Closedwhen dropping a listener inListenersStream::remove_listener, returnboolinstead ofResult<(), ()>(see PR 2261). -
Concurrently dial address candidates within a single dial attempt (see PR 2248) configured via
Network::with_dial_concurrency_factor.-
On success of a single address, provide errors of the thus far failed dials via
NetworkEvent::ConnectionEstablished::outgoing. -
On failure of all addresses, provide the errors via
NetworkEvent::DialError.
-
-
-
0.30.0-rc.227 Oct 2021 pre-releaseNothing published for this version
-
0.30.0-rc.115 Oct 2021 pre-releaseNothing published for this version
-
0.29.012 Jul 2021Release notes
Open source →-
Switch from
parity-multiaddrto upstreammultiaddr. -
Update dependencies.
-
Implement
Keypair::from_protobuf_encodingfor ed25519 keys (see PR 2090). -
Deprecate
upgrade::write_one. Deprecateupgrade::write_with_len_prefix. Deprecateupgrade::read_one. Introduceupgrade::read_length_prefixedandupgrade::write_length_prefixed. See PR 2111.
-
-
0.28.326 Apr 2021 -
0.28.213 Apr 2021 -
0.28.117 Mar 2021 -
0.28.017 Mar 2021Release notes
Open source →-
Network::dial()understands/p2paddresses andTransport::dialgets a "fully qualified"/p2paddress when dialing a specific peer, whether through theNetwork::peer()API or viaNetwork::dial()with a/p2paddress. -
Network::dial()andnetwork::Peer::dial()return aDialErroron error. -
Shorten and unify
Debugimpls of public keys.
-
-
0.27.115 Feb 2021 -
0.27.012 Jan 2021Release notes
Open source →-
(Re)add
Transport::address_translationto permit transport-specific translations of observed addresses onto listening addresses. PR 1887 -
Update dependencies.
-
-
0.26.018 Dec 2020 -
0.25.202 Dec 2020 -
0.25.125 Nov 2020 -
0.25.025 Nov 2020Release notes
Open source →-
The
NetworkConfigAPI is now a builder that movesself. PR 1848. -
New configurable connection limits for established connections and dedicated connection counters. Removed the connection limit dedicated to outgoing pending connection per peer. Connection limits are now represented by
u32instead ofusizetypes. PR 1848. -
Update
multihash. -
Update
multistream-select.
-
-
0.24.009 Nov 2020Release notes
Open source →- Remove
ConnectionInfotrait and replace it withPeerIdeverywhere. This was already effectively the case becauseConnectionInfowas implemented onPeerId.
- Remove
-
0.23.120 Oct 2020 -
0.23.016 Oct 2020Release notes
Open source →-
Rework transport boxing and move timeout configuration to the transport builder. PR 1794.
-
Update dependencies.
-
-
0.22.110 Sep 2020Release notes
Open source →- Require at least parity-multiaddr v0.9.2 in order to fulfill
Ordbound onMultiaddr. PR 1742.
- Require at least parity-multiaddr v0.9.2 in order to fulfill
-
0.22.009 Sep 2020Release notes
Open source →-
Simplify incoming connection handling. The
IncomingConnectionEventhas been removed. Instead, pass theIncomingConnectionobtained fromNetworkEvent::IncomingConnectiontoNetwork::accept(). PR 1732. -
Allow any closure to be passed as an executor. PR 1686
-
Remove
PeerIdcompatibility mode for "identity" and SHA2 hashes. Historically, before 0.12,PeerIds were incorrectly always hashed with SHA2. Starting from version 0.13, rust-libp2p accepted both hashed and non-hashed keys as input. Starting from version 0.16 rust-libp2p comparedPeerIds of "identity" and SHA2 hashes equal, which made it possible to connect through secio or noise to nodes with an identity hash for the same peer ID. Starting from version 0.17, rust-libp2p switched to not hashing the key (i.e. the correct behaviour) while retaining equality between peer IDs using the "identity" hash and SHA2. Finally, with this release, that will no longer be the case and it is assumed that peer IDs whose length is less or equal to 42 bytes always use the "identity" hash so two peer IDs are equal if and only if they use the same hash algorithm and have the same hash digest. PR 1608. -
Return dialer address instead of listener address as
remote_addrinMemoryTransportListenerListenerEvent::UpgradePR 1724.
-
-
0.21.018 Aug 2020Release notes
Open source →-
Remove duplicates when performing address translation PR 1697.
-
Add
transport::Builder::multiplex_extfor further customisation duringStreamMuxercreation. PR 1691. -
Refactoring of connection close and disconnect behaviour. In particular, the former
NetworkEvent::ConnectionErroris nowNetworkEvent::ConnectionClosedwith theerrorfield being anOptionandNoneindicating an active (but not necessarily orderly) close. This guarantees thatConnectionEstablishedevents are always eventually paired withConnectionClosedevents, regardless of how connections are closed. Correspondingly,EstablishedConnection::closeis nowEstablishedConnection::start_closeto reflect that an orderly close completes asynchronously in the background, with the outcome observed by continued polling of theNetwork. In contrast,disconnecting a peer takes effect immediately without an orderly connection shutdown. See PR 1619 for further details. -
Add
ConnectedPoint::get_remote_address(PR 1649).
-
-
0.20.117 Jul 2020 -
0.20.001 Jul 2020Release notes
Open source →-
Conditional compilation fixes for the
wasm32-wasitarget (PR 1633). -
Rename
StreamMuxer::poll_inboundtopoll_eventand change the return value toStreamMuxerEvent. This newStreamMuxerEventmakes it possible for the multiplexing layer to notify the upper layers of a change in the address of the underlying connection. -
Add
ConnectionHandler::inject_address_change.
-
-
0.19.222 Jun 2020 -
0.19.125 May 2020Nothing published for this version
-
0.19.018 May 2020Nothing published for this version
-
0.18.009 Apr 2020Nothing published for this version
-
0.17.102 Apr 2020Nothing published for this version
-
0.17.001 Apr 2020Nothing published for this version
-
0.16.014 Feb 2020Nothing published for this version
-
0.15.024 Jan 2020Nothing published for this version
-
0.14.0-alpha.107 Jan 2020 pre-releaseNothing published for this version
-
0.13.202 Jan 2020Nothing published for this version
-
0.13.113 Nov 2019Nothing published for this version
-
0.13.006 Nov 2019Nothing published for this version