bech32
Reference implementation for Bech32 and segwit addresses.
What it is and what it does
Bech32 is a reference implementation of the bech32 checksummed base32 encoding format, originally developed for Bitcoin segwit addresses and later adopted for Lightning Network invoices. The package provides functions to encode data into bech32 strings and decode them back, with built-in checksum validation to detect errors.
The implementation is a Python port of the reference specification, with a modification to remove a length limit so it can handle longer Lightning invoice payloads. Since the package has no runtime dependencies and requires Python 3.5 or later, it installs cleanly and runs with minimal overhead. However, it has been archived and receives no maintenance, so it is suitable only for projects that need stable, unchanging bech32 functionality.
Use it for:
- Encode Bitcoin segwit addresses for wallet or exchange software.
- Decode and validate bech32-encoded Lightning Network payment invoices.
- Verify bech32 checksums to detect transmission or transcription errors in encoded data.
- Integrate bech32 encoding into cryptocurrency address generation pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes bech32-formatted strings, a checksummed base32 encoding scheme used for Bitcoin segwit addresses and Lightning invoices.
Yes, if you need stable bech32 encoding and decoding for Bitcoin or Lightning applications and accept that the package will not receive updates. The implementation is mature, has no dependencies, and carries no known vulnerabilities. Do not install if you expect ongoing maintenance or compatibility updates with evolving standards.
Install
bech32 on PyPI
pip
pip install bech32uv
uv add bech32poetry
poetry add bech32Installing bech32
Before you install
Installation is straightforward with no runtime dependencies. However, the package is archived and unmaintained since February 2020, with no updates for several years. Use only if you need stable, unchanging bech32 functionality and do not expect bug fixes or security patches.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install bech32
from bech32 import bech32_encode, bech32_decode
# Encode to bech32
encoded = bech32_encode('bc', data)
# Decode bech32
hrp, decoded = bech32_decode(encoded)
Verify before relying
- Whether the implementation remains compatible with current bech32 specifications and Lightning invoice standards.
- Whether the removal of the length limit (noted in the description) is still appropriate for all use cases.
- Specific bit-width conversion capabilities and their correctness for cryptographic applications.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,370 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 519,847/month — #6,215 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bech32-1.2.0-py3-none-any.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
base32-crockfordEncodes and decodes data using Douglas…
permissive · top 15,000 on PyPI
bech32mEncodes and decodes Bech32 and Bech32m strings,…
permissive · top 15,000 on PyPI
base58checkEncodes and decodes byte arrays using the…
permissive · top 15,000 on PyPI
base58Encodes and decodes data using Base58 and…
permissive · top 5,000 on PyPI
breez-sdk-sparkPython bindings for the Breez Spark SDK,…
permissive · top 15,000 on PyPI
bitcoin-utilsA low-level Bitcoin library providing tools to…
permissive · top 15,000 on PyPI
basesProvides customizable Base-N encoding and…
unclear · top 15,000 on PyPI
bip32Implements BIP 32 hierarchical deterministic…
permissive · top 15,000 on PyPI
py-multihashEncodes and decodes multihash digests,…
permissive · top 15,000 on PyPI
py-multibaseEncodes and decodes data using the Multibase…
permissive · top 15,000 on PyPI