Jay Taylor's notes

back to listing index

Python p2p libraries and frameworks

[web search]
Original source (blog.rfox.eu)
Tags: python library framework p2p blog.rfox.eu
Clipped on: 2021-01-22

Bystroushaak's blog / English section / Explorations / Python p2p libraries and frameworks

Python p2p libraries and frameworks


I've explored the scene of the Python libraries and frameworks for peer to peer networking.

tldr; Its not that great.

Note: asyncio-only code is considered disadvantageous. See What Color is Your Function? for explanation why. Basically it is a cancer that spreads through your whole program until everything is asyncio, and I like multiprocessing based on messages much more.



PyP2P is a simplified networking library for building peer-to-peer networks in Python. The library is designed to solve the pain of finding nodes and bypassing NATs so you can focus on writing your application code.

  • Automated port forwarding with UPnP and NATPMP
  • Support for TCP hole punching / simultaneous open
  • Reverse connect (tell a node to connect to you)
  • Fail-safe proxying (planned feature)
  • Python 2 (tested on 2.7 - experimental) & 3 (tested on 3.3)
  • Linux and Windows - yep

Somehow related to Storj.


Requires rendezvous server.

Last commit 2016

No documentation, some examples.



Peer-to-peer networking stack (used by IPFS and others).

The one-liner pitch is that libp2p is a modular system of protocols, specifications, and libraries that enable the development of peer-to-peer network applications.


Last commit 2020.

Backed by ethereum grant.

Implementation of https://libp2p.io/, multiple languages supported.

Has some theory & capable people behind it. Looks mature enough.



Not much documentation.

Some weird addressing stuff /ip4/



What is IPv8 ?

IPv8 aims to provide authenticated communication with privacy. The design principle is to enable communication between public key pairs: IP addresses and physical network attachment points are abstracted away. This Python 2/3 package is an amalgamation of peer-to-peer communication functionality from Dispersy and Tribler, developed over the last 13 years by students and employees of the Delft University of Technology. The IPv8 library allows you to easily create network overlays on which to build your own applications.

IPv8 Objectives

  • Authentication. We offer mutual authentication using strong cryptography. During an IPv8 communication session, both parties can be sure of the other party’s identity. IPv8 users are identified by their public key. The initial key exchange is designed so that secrets are never transmitted across the Internet, not even in encrypted form. We use a standard challenge/response protocol with protection against spoofing, man-in-the-middle, and replay attacks.
  • Privacy. IPv8 is specifically designed for strong privacy protection and end-to-end encryption with perfect forward secrecy. We enhanced the industry standard onion routing protocol, Tor, for usage in a trustless environment (e.g. no trusted central directory servers).
  • No infrastructure dependency. Everybody is equal in the world of IPv8. No central web server, discovery server, or support foundation is needed.
  • Universal connectivity. IPv8 can establish direct communication in difficult network situations. This includes connecting people behind a NAT or firewall. IPv8 includes a single simple and effective NAT traversal technique: UDP hole-punching. This is essential when offering privacy without infrastructure and consumer-grade donated resources.
  • Trust. You can enhance your security if you tell IPv8 which people you know and trust. It tries to build a web-of-trust automatically.


Last commit 2020

Looks like it solves many problems.





I seek a library that can make a simple P2P network. This library enables you create P2P application.


  • Asynchronous IO
  • Pure Python code
  • TCP and UDP connection
  • Automatic network build
  • Python 3.6+


Last commit 2020.

Pure python code.


Asyncio based

"simple" in the description.

Not much documentation, some examples.

Looks weird and amateurish.



Zyre provides reliable group messaging over local area networks.


Last commit 2020.

Bindings for various languages.


Requires bunch of C libraries.

Looks like it is meant for the LAN networks.

devp2p / ethereum



Client for the ethereum network.

Doesn't seem to be easily use-able for standalone projects.



Old library for lowlevel ethereum p2p.

pydevp2p is the Python implementation of the RLPx network layer. RLPx provides a general-purpose transport and interface for applications to communicate via a p2p network. The first version is geared towards building a robust transport, well-formed network, and software interface in order to provide infrastructure which meets the requirements of distributed or decentralized applications such as Ethereum. Encryption is employed to provide better privacy and integrity than would be provided by a cleartext implementation.


Last commit 2018.



Tandem is a decentralized, collaborative text-editing solution. Tandem works with native text editors, works across different editors, and uses peer-to-peer connections to facilitate communication.

Tandem exists as a set of plugins for native text editors. We currently support Sublime Text 3 and Neovim. We also unofficially support Vim.

Collaborating is as easy as installing the plugin on your editor and creating a Tandem Session. Invite other people to your session, and get typing in tandem!


Requires rendezvous server

Meant as plugin for text editors, would probably require significant amount of work.



The elastic database system. A database designed for P2P-like scenarios, where potentially millions of computers send database updates around.

The Distributed Permission System, or Dispersy, is a platform to simplify the design of distributed communities. At the heart of Dispersy lies a simple identity and message handling system where each community and each user is uniquely and securely identified using elliptic curve cryptography.


No longer maintaned.



Banyan is a simple peer to peer application protocol for File Sharing over LAN.

The workflow is organized as follows

  1. Initialization - Peer Starts up with a friendly name, which is visible on local network
  1. Peer Discovery - Peer Sends a broadcast to all other hosts in local network. Other peers will respond to it.
  1. Synchronization - Peer Receives file list from all other Peers
  1. Transfer - Peer can receive file from any other Peer


LAN only.

Last commit 2019.

Not really mature, no longer developed.



Python Peer-to-Peer Framework.


Amateurish stuff (3 commits), no longer developed (last commit 2017).