skillfed

bech32

Reference implementation for Bech32 and segwit addresses.

bech32 v1.2.0 519.8K downloads/30d#6,215 on PyPI20
Permissive license MIT Abandoned released

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 bech32

uv

uv add bech32

poetry

poetry add bech32

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.7

Tags

bech32 encoding decodingbitcoin segwit addresslightning invoice encodingbase32 checksum encodingbech32 reference implementation
bitcoinencoding

More Cryptography packages