The Last Six Characters: What a Bitcoin Address Actually Checks

The final six characters of a bech32 address are the only thing standing between a typo and coins nobody can spend. Base58Check could only say no; bech32's BCH checksum can find the error. And bech32 had a hole, fixed by changing one constant.
bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4last 6 characters = checksum

Two envelopes, one checksum

I have a bad habit of reading addresses backwards. Not the whole thing — just the tail. ...vary0c5xw7kv8f3t4. Six characters at the end of a Bitcoin address that I cannot decode, cannot verify by eye, and have never once thought about, right up until the moment a wallet refuses a paste and I have to.

Here is what those six characters are: the only thing in the entire system that stands between a typo and a pile of coins that nobody can ever spend. Not the network. Not the miners. Not the confirmations. Once the transaction is broadcast, there is no address to complain to. There is no “wrong address” desk. If the string you sent to happens to be a valid address, the coins are gone to whoever holds that key, and the blockchain did its job perfectly.

So the checksum is not a formatting detail. It is the last checkpoint, and it runs on your machine, before anything leaves it. And — this is the part I did not know until I went and read the two BIPs side by side — that checksum had a hole in it. Somebody found the hole before it cost anybody money, and fixed it by changing one number.

The Last Six Characters: What a Bitcoin Address Actually Checks
National Photo Company Collection, Public domain, via Wikimedia Commons

Bitcoin addresses are not accounts. Nothing on the chain holds a balance under your name — what exists is a set of locked outputs, and an address is just a compact way of writing the lock. If that distinction feels slippery, the UTXO model piece goes through it properly.

The Two Analogies I Use

An address is easier to hold in your head if you think of it as a postal address with a national prefix, and the checksum as the check digit on a barcode. Both analogies have teeth, and each one explains a different thing.

Postal first. A Bitcoin address has a human-readable part — bc on mainnet, tb on testnet — followed by a separator 1, followed by the payload. bc1q.... That is bc + 1 + data. The prefix tells you which system this address belongs to before you look at a single payload character, the same way US or JP at the top of an envelope tells a sorting machine which country’s rules apply. It is why a testnet address pasted into a mainnet field gets caught by software rather than by luck.

Barcode second. The last six characters are computed from everything before them. Change one character anywhere in the middle and the six characters at the end stop matching. That is the same idea as the final digit on a barcode or a credit card number: it is not security, anyone can recompute it, and it detects mistakes, not attackers. A checksum cannot tell you the address belongs to the person you think it does. It can only tell you that you copied it correctly.

address = prefix + separator + payload + checksum · the last 6 characters are a function of everything before them

Base58Check: Four Bytes That Can Only Say No

The old format — the 1... and 3... addresses — works like this. You take a version byte (0x00 for pay-to-public-key-hash, which renders as a leading 1; 0x05 for pay-to-script-hash, which renders as 3), append the 20-byte hash, append four bytes of SHA256(SHA256(...)), and base58-encode the lot.

Four bytes. About 1 in 4.3 billion chance that a mangled address still validates. That sounds reassuring until you notice what it doesn’t do:

4 · 42 · 90 — bytes of Base58Check checksum · characters in a bech32 P2WPKH address · the 90-character bech32 cap

  • It cannot tell you where the error is. A failed double-SHA256 check means “somewhere in there, something is wrong.” It does not mean “character 19.”
  • It cannot fix it. Error correction is a property you cannot bolt onto a hash. The hash destroys the information you would need to recover the original.
  • The alphabet is the enemy. Base58 keeps digits and letters but drops 0, O, I and l, precisely because humans confuse them. That is a band-aid on a format where a single character substitution produces a different, perfectly valid address.
The Last Six Characters: What a Bitcoin Address Actually Checks
CC0, via Wikimedia Commons

Bech32: A Checksum That Can Actually Find the Typo

Bech32 (BIP-173) throws the hash out and uses a BCH code over GF(32) instead. Six characters, same length, but a completely different animal.

The alphabet is qpzry9x8gf2tvdw0s3jn54khce6mua7l. Thirty-two characters. Note which ones are missing: 1, b, i, o. The 1 is excluded because it is doing double duty as the separator; the other three because they are the ones people misread aloud. The whole string must be one case — all lower or all upper, never mixed — and that is deliberate: uppercase lets a QR encoder drop into alphanumeric mode and produce a materially smaller code.

What you get in exchange is a checksum that can detect up to four character errors, and, unlike a hash, one that has enough structure to be used for locating them. The spec caps the total at 90 characters.

def bech32_checksum(hrp, data, const):
    # const = 1 for bech32 (witness v0) · 0x2bc830a3 for bech32m (v1+)
    polymod = bech32_polymod(hrp_expand(hrp) + data + [0] * 6) ^ const
    return [(polymod >> 5 * (5 - i)) & 31 for i in range(6)]
# that single XOR is the entire difference between bc1q and bc1p
Base58Check, on a typo

Something in here is wrong. I can’t tell you where.

Bech32, on the same typo

Up to four errors, and I can point at them.

You, holding a rejected paste

Only one of these two can tell me where to look.

The Hole, and the Number That Closed It

This is the part I think everybody who writes about address formats skips, and it is the best story in the whole specification.

Bech32’s checksum has a known weakness: if the last character of the address is a p, then inserting or deleting any number of q characters immediately before it leaves the checksum valid. Not “might” — does. It comes out of how the polymod interacts with the constant used to finalize the checksum.

Witness version 0 addresses dodged this by accident. P2WPKH is always 42 characters and P2WSH is always 62, so an insertion or deletion fails the length check before it can do any damage. The length was doing the work, not the checksum. That protection evaporated the moment anyone wanted a witness program of variable length — which is exactly what witness version 1 and above wanted.

BIP-350 fixes it by changing one number. The final XOR constant goes from 1 to 0x2bc830a3. Every other line of the algorithm is untouched.

bech32 → constant 1 · bech32m → constant 0x2bc830a3 · witness v0 → bech32 · witness v1+ → bech32m

The two variants are deliberately incompatible. A bech32 string will not validate as bech32m and vice versa. That is not an oversight; it is the point. Software that does not know about bech32m fails closed — it refuses an address it does not understand, rather than cheerfully encoding a Taproot output it has no business producing.

I like this fix a lot. It is the kind of engineering I respect: someone sat down, found a defect in a checksum that had not yet cost anyone a satoshi, and the entire patch was a constant. No new field, no version negotiation, no flag day.

FormatLooks likeChecksumError handlingUse it?
Base58Check P2PKH1...4 bytes, double-SHA256Detect only, no locationNo — legacy
Base58Check P2SH3...4 bytes, double-SHA256Detect only, no locationOnly for old counterparties
Bech32bc1q...6 chars, BCH over GF(32)Up to 4 errors, locatableYes
Bech32mbc1p...6 chars, constant changedSame, no p/q holeYes
The Last Six Characters: What a Bitcoin Address Actually Checks
cogdogblog, CC BY 2.0, via Wikimedia Commons

What This Means When You Actually Send Something

None of the above will recover coins sent to a valid address that is not the recipient’s. That failure mode exists; the checksum does not address it and cannot. What the checksum does is narrow the field to a single class of error — “you typed it wrong” — and catch that class locally, on your machine, before broadcast.

So, concretely:

  • Receive to bc1q or bc1p. Not for the fee discount (though there is one), but because those formats have a checksum that can find a typo instead of just rejecting it.
  • Stop receiving to 1... and 3.... They exist for compatibility with software that should have been updated years ago. Every coin parked in one is a fee bill deferred, not avoided.
  • Never retype an address. Paste it. If you are retyping, you are relying on a checksum to catch a class of error you could have simply not made.
  • If a wallet rejects a bc1p address, that is information. In 2026 that wallet does not implement BIP-350. The network has understood it since 2021; the program in front of you is telling you how much attention its engineering gets.

The last six characters are boring on purpose. Boring is what you want from the thing standing between a paste and a permanent loss.

(The End)

Bitcoin

300 MB, 336 Hours, No Queue: What the Bitcoin Mempool Actually Is

2026-10-18 7:53:51

Bitcoin

One Seed, 2,147,483,648 Forks: How a Wallet Grows Every Key You Will Ever Use

2026-10-20 7:34:10

❯
Profile
Cart
Coupons
Search