Skip to main content

BitBootPy: Fully-Decentralized Peer Discovery For P2P Network Formation

Inspired and based on the BitBoot (Javascript) project: https://github.com/tintfoundation/bitboot

BitBootPy is a Python library that enables fully-decentralized P2P network Peer Discovery and network formation. No centralized infrastructure is required to start or join a P2P network which uses BitBootPy for Peer Discovery. If you're tempted to use WebRTC for P2P network formation, you should be aware that WebRTC does require a centralized Peer Discovery server.

Key Features

  • Piggybacks on the BitTorrent network
    Makes a special entry on the BitTorrent DHT (distributed hash table) to enable robust decentralized peer discovery for your network without the need for centralized servers. As long as the BitTorrent network is running, your network will be discoverble. Can be extended to leverage other DHTs if necessary.

  • Self-Healing
    Enables networks to easily re-form even if all nodes go offline.

  • Easy-to-use
    A simple API for creating and joining decentralized networks

  • Async support
    Supports both synchronous and asynchronous operation

How it works

When you make a network using BitBoot / BitBootPy, you make an entry on the BitTorrent DHT with a unique key identifying your network. Anyone who wants to join your network then just has to search the BitTorrent DHT for that key, and then connect to your machine using the IP data contained in the DHT entry. Done and done. You now have a P2P network that is fully robust to all nodes going offline and does not require a central server for peer discovery.

Usage

To use BitBoot, simply create an instance of the AsyncBitBoot class with a unique key, and call the announce and lookup methods to join the network and discover peers. Here's a simple example:

from bitboot.async_bitboot import AsyncBitBoot

async def main():
    bot = AsyncBitBoot("unique_key")
    info_hash = await bot.announce()
    found_peers = await bot.lookup(info_hash)
    print("Found peers:", found_peers)
    bot.stop()

if __name__ == "__main__":
    asyncio.run(main())

For more examples and details on how to use BitBoot, see the examples directory.

Metadata

Release files for bitbootpy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitbootpy 0.3.0
File Size Uploaded
bitbootpy-0.3.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bitbootpy 0.3.0
File Interpreter ABI Platform
bitbootpy-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / bitbootpy-0.3.0.tar.gz

Download URL bitbootpy-0.3.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
144976dc18828a0f09ae27b987ad17889c670e90cce637eb650e5700d917a824
BLAKE2b-256 checksum
How to use checksums
08ff10b511436e21bcbcf1b0160b2304fe6a84ae7d4cfa482a81a1ef5632dc93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.5 Darwin/21.6.0

Release files / bitbootpy-0.3.0-py3-none-any.whl

Download URL bitbootpy-0.3.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc74958717a763414f577b84388ffcd2c51dbe9097d8994570a8dd54f7cbe22e
BLAKE2b-256 checksum
How to use checksums
069c9a1e88cd40f2788a1b4cff3354b82133a9b87e0da72319e0e5e7c1323835
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.5 Darwin/21.6.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page