--- id: multiaddr version: "0.2.0" license: MIT License license_treatment: permissive maintenance: active --- # multiaddr — Python implementation of jbenet's multiaddr License: permissive · Maintenance: active · Downloads: 316.5K/mo ## What it is and what it does py-multiaddr is a Python implementation of the multiaddr specification—a way to express network addresses as composable protocol stacks. Instead of separate IP, port, and protocol fields, multiaddr encodes them as a single string like `/ip4/127.0.0.1/tcp/8080/p2p/QmPeer`, making it easy to parse, validate, and manipulate complex network paths. It handles encapsulation and decapsulation (nesting protocols), DNS resolution with peer ID preservation, and wildcard expansion for server binding across network interfaces. The package targets libp2p and IPFS ecosystems but is generally useful for any application needing a unified, protocol-agnostic address representation. It depends on trio for async DNS, base58 and multihash variants for encoding, and netaddr for IP manipulation. The API is straightforward: construct a Multiaddr from a string or bytes, call methods like `protocols()`, `encapsulate()`, `decapsulate()`, or `resolve()` to work with it. Use it for: - Parsing and validating bootstrap node addresses in p2p networks with embedded peer IDs. - Expanding wildcard addresses (0.0.0.0, ::) to concrete interfaces for server binding. - Composing protocol stacks for tunneling scenarios (proxy → destination chains). - Resolving DNS and DNSADDR records while preserving peer identity across resolution. - Extracting and comparing protocol layers from complex network addresses. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses, constructs, and manipulates multiaddrs—protocol-agnostic network addresses that combine IP, DNS, transport, and peer identity into a single composable format. Yes, if you are building or integrating with libp2p, IPFS, or other multiformats-based systems. The package is actively maintained, has no known vulnerabilities, and low install friction. The pre-alpha status and small maintainer team are worth noting for production use, but the core functionality is stable and widely used in the ecosystem. ## Install pip install multiaddr uv add multiaddr poetry add multiaddr ## Installing multiaddr Before you install: Low friction: pure Python wheel with 12 runtime dependencies including trio for async DNS. Actively maintained with recent commits; marked pre-alpha but in use across the multiformats ecosystem. License in practice: Dual-licensed MIT or Apache 2.0—permissive either way, suitable for commercial and open-source projects without copyleft obligations. Quickstart: pip install multiaddr from multiaddr import Multiaddr m = Multiaddr("/ip4/127.0.0.1/tcp/8080") print(m.protocols()) print(m.to_bytes()) Requires Python 3.10+; async DNS resolution requires trio and an event loop. Verify before relying: - Whether DNS resolution performance scales to high-volume bootstrap node lookups in production p2p networks. - Stability guarantees or breaking-change policy given pre-alpha status (Development Status :: 2). ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 316.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags multiaddr parsing and construction, network address composition, DNS resolution with peer ID, protocol encapsulation decapsulation, libp2p multiaddr implementation, wildcard address expansion, thin waist address validation, p2p-networking, libp2p, address-parsing [View on SkillFed](https://skillfed.io/packages/multiaddr) · [View on PyPI](https://pypi.org/project/multiaddr/)