Encoding family

Bech32 and Bech32m

Checksummed Base32 address encodings for Bitcoin SegWit and Taproot (BIP-173, BIP-350)

standard 2 variants BIP-173; BIP-350

Overview

Bech32 is a Base32-based encoding with a strong BCH error-detecting checksum, introduced in BIP-173 for Bitcoin SegWit addresses. Bech32m, defined in BIP-350, fixes a weakness in the original checksum and is used for Taproot addresses. Neither provides any security against deliberate tampering.

A Bech32 string has a human-readable prefix such as 'bc', a '1' separator, a data part in a 32-character lowercase alphabet chosen to avoid confusable characters, and a 6-character checksum. The checksum is a BCH code over GF(32) that guarantees detection of up to four character errors and has a very low probability of missing other errors. Bech32m changes only the constant XORed into the checksum.

The original Bech32 checksum has a flaw: inserting or deleting 'q' characters before a final 'p' can leave the checksum valid. Bech32m was introduced to address this for new address versions. NextSSL includes both. Bech32 strings are case-insensitive but must not mix cases. Both encode a witness version and program for Bitcoin addresses, with Bech32 used for version 0 and Bech32m for versions 1 and above.

History

2017–2017
  1. Bech32 and Bech32m published by Pieter Wuille, Greg Maxwell

Security notes

Bech32 and Bech32m detect accidental errors but are not cryptographic; an attacker can produce any valid string. They provide no confidentiality or authenticity.

Typical uses

Bitcoin SegWit (Bech32) and Taproot (Bech32m) addressesLightning invoices and other human-typed identifiers

Variants in NextSSL

2
AlgorithmTierSizes (bytes)StandardsAPI
Bech32
bech32
standard — BIP-173 safe
Bech32m
bech32m
standard — BIP-350 safe

Frequently asked questions

Which Bech32 and Bech32m variants does NextSSL include?

NextSSL registers 2 Bech32 and Bech32m variants: bech32, bech32m.