libp2p/py-libp2p

Interoperability between js-libp2p and py-libp2p focused on ping protocol

Open

#630 opened on May 29, 2025

 (2 comments) (2 reactions) (0 assignees)Python (238 forks)auto 404
Interoperabilityenhancementfeaturehelp wanted

Repository metrics

Stars
 (618 stars)
PR merge metrics
 (PR metrics pending)

Description

Description

This issue tracks a cross-language interoperability test between py-libp2p and js-libp2p using the /ipfs/ping/1.0.0 protocol. The goal is to verify that a Python libp2p node can connect to a JavaScript libp2p node over TCP/WebSockets, negotiate the ping protocol, and successfully exchange a 32-byte payload.

This serves as a foundational test for validating protocol compliance, stream handling, and transport compatibility between the two implementations.

Motivation

libp2p is designed to be a modular, cross-platform networking stack that works across programming languages and runtimes. However, real-world interoperability between implementations (e.g., JavaScript and Python) requires active validation and testing.

This project aims to:

  • Ensure compatibility between py-libp2p and js-libp2p on the protocol, transport, and stream levels.
  • Provide a minimal working example to demonstrate cross-language communication using a well-defined protocol (/ipfs/ping/1.0.0).
  • Lay the groundwork for broader protocol support (e.g., identify, pubsub, DHT) and more advanced scenarios like NAT traversal and QUIC/WebRTC transports.
  • Support the libp2p community with a reproducible test suite that helps debug and verify cross-stack behavior.

Current Implementation

  • The py-libp2p repository is under active development and includes support for:

    • Basic host and peer identity setup
    • TCP transport (partial WebSocket support may be experimental or missing)
    • Stream multiplexing using mplex
    • Protocol negotiation via multistream-select
    • Preliminary /ipfs/ping/1.0.0 protocol logic (may require additional integration)
  • The js-libp2p stack is mature and fully supports:

    • Multiple transports: TCP, WebSockets, WebRTC
    • Stream multiplexers: mplex, yamux
    • Protocol negotiation and stream handlers
    • A built-in /ipfs/ping/1.0.0 responder

Currently, there is no integrated setup or test that connects a py-libp2p node with a js-libp2p node for pinging. Each stack operates in isolation, and interoperability is unverified.

Are you planning to do it yourself in a pull request ?

Maybe

Contributor guide