Skip to content

BIP 173

Base32 address format for native v0-16 witness outputs

Original title: Base32 address format for native v0-16 witness outputs

Status
Deployed
Type / Layer
Informational / Applications
Author
Pieter Wuille, Greg Maxwell
Assigned
Status verified
Source
github.com/bitcoin/bips/blob/master/bip-0173.mediawiki

Summary

Specifies Bech32, the address format for native SegWit outputs. Base58Check had several drawbacks: it takes a lot of room in a QR code, mixed case makes it awkward to read aloud or type, and its checksum has little theoretical grounding for error detection. A Bech32 string has three parts — a human-readable part (bc on mainnet, tb on testnet), the separator "1", and the data part — with the final six characters forming a BCH checksum. That code is guaranteed to detect any error affecting at most four characters, and the chance of missing a larger error is stated as below one in a billion. The 32-character alphabet excludes the visually confusable 1, b, i and o, and decoders reject strings that mix upper and lower case; keeping to a single case allows the address to be carried in a QR code's alphanumeric mode, which is more compact than byte mode. An address encodes a witness version (0 to 16) together with the witness program. A note added to the BIP later discloses that the scheme is not always robust against the insertion or deletion of fewer than five consecutive characters.

Why it matters

This is the specification behind addresses beginning bc1q — the part of SegWit users actually see. Its checksum makes ordinary typos almost certain to be rejected, though it can do nothing about a correctly typed address belonging to someone else. The weakness disclosed later was repaired by Bech32m in BIP350, which covers witness version 1 and above.

Related BIPs

Related articles

This page carries a summary, not a translation. The original document is authoritative, and the metadata above — including Status — was transcribed from the bips repository on the verification date shown. Always consult the original when implementing or verifying.

Read the original on bitcoin/bips