Checksum

A few extra characters that catch typos in an address or key before funds leave.

Basically

A checksum is a short value made from your data. Your wallet uses it to spot mistakes in Bitcoin addresses, keys and network messages.

Key Takeaways

  • A checksum is a small value computed from data that lets software detect accidental errors. If even one character of a Bitcoin address is mistyped, the checksum will not match and your wallet will reject the transaction before any funds leave.
  • Bitcoin uses two main checksum schemes: Base58Check, which uses double SHA-256 for legacy addresses, and Bech32 or Bech32m, which use a BCH error-detecting code for SegWit and Taproot addresses. Each scheme has different error-detection guarantees.
  • Checksums detect errors but do not correct them. Bitcoin deliberately rejects invalid addresses rather than guessing the intended value, because silently "fixing" a financial address to the wrong destination would be catastrophic.

What Is a Checksum?

A checksum is a short value derived from a block of data, used to verify that the data has not been altered or corrupted. It works like a check digit on a credit card number or an ISBN: the final digits are computed from the preceding ones, so any transcription error produces a mismatch and is caught before the number is processed.

Bitcoin checksums protect addresses, private keys, seed phrases and peer-to-peer network messages from accidental corruption. When you copy a Bitcoin address and paste it into your wallet, the wallet verifies the checksum before constructing a transaction. If the checksum does not match, the wallet refuses to send, preventing funds from being lost to an address nobody controls.

Checksums are not encryption and they are not signatures. They do not hide data or prove identity. Their sole purpose is error detection: catching mistakes introduced by humans typing, copying or transmitting data.

How It Works

Bitcoin employs different checksum algorithms depending on the encoding format. The two primary schemes are Base58Check for legacy formats and BCH codes for modern Bech32 formats.

Base58Check (Legacy Addresses)

Base58Check encoding is used for legacy P2PKH addresses starting with "1" and P2SH addresses starting with "3". It also covers private keys in WIF format and HD wallet extended keys.

The 4-byte (32-bit) checksum means the probability of a random error going undetected is approximately 1 in 2^32, or roughly 1 in 4.29 billion. SHA-256 is a hash function rather than a structured algebraic code, so Base58Check offers no formal guarantee about which error patterns it will catch. It treats all errors probabilistically.

Bech32 and Bech32m (SegWit and Taproot Addresses)

Modern SegWit and Taproot addresses use Bech32, defined in BIP 173, and Bech32m, defined in BIP 350. They replace the hash-based checksum with a BCH (Bose-Chaudhuri-Hocquenghem) error-detecting code over the finite field GF(32).

The Bech32 checksum is 6 characters long, or 30 bits in base-32. Its structure provides mathematically provable detection guarantees.

A valid Bech32 address satisfies the polynomial check PolyMod(codeword) = 1. Bech32m changes this constant to 0x2bc830a3, fixing a specific vulnerability in original Bech32: whenever the last character of a Bech32 string was "p", inserting or deleting "q" characters immediately before it would not invalidate the checksum.

Version 0 witness programs, including P2WPKH and P2WSH, use original Bech32. Version 1 and above, including P2TR Taproot addresses, use Bech32m.

P2P Network Message Checksums

Bitcoin's peer-to-peer protocol also uses checksums to protect network messages from corruption in transit. Every message header includes a 4-byte checksum computed as the first 4 bytes of the double SHA-256 hash of the message payload.

Receiving nodes verify the checksum after downloading the full payload. If it does not match, the message is discarded and the node may request retransmission.

Seed Phrase Checksums

BIP-39 seed phrases embed a checksum directly in the mnemonic word sequence. After generating random entropy, your wallet computes SHA-256 of the entropy and uses the first few bits of the hash as a checksum: 4 bits for a standard 12-word phrase with 128 bits of entropy, and 8 bits for a 24-word phrase with 256 bits. The wallet appends the checksum bits to the entropy, splits the combined bit string into 11-bit groups and maps each group to one word from the 2,048-word BIP-39 wordlist, so changing any word will almost certainly break the checksum and make the wallet reject the phrase.

Error Detection vs. Error Correction

Checksums are error-detecting codes: they tell you that something went wrong but not what. An error-correcting code, by contrast, carries enough redundancy to identify and fix the corrupted bits without retransmission. Hamming codes and Reed-Solomon codes are common examples of error-correcting schemes.

Bitcoin deliberately uses detection-only checksums. In a financial system, silently "correcting" an address to the wrong value would send funds to an unintended recipient with no way to recover them. Rejecting the address and forcing you to re-enter it is far safer.

The BCH code underlying Bech32 is technically capable of locating errors, because BCH codes are a class of error-correcting code being used here in detection-only mode. BIP 173 notes that implementations may use this capability to highlight where a typo likely occurred, but must never auto-correct the address. Showing you which character might be wrong helps you fix it; changing the address for you would be dangerous.

Checksum Scheme Comparison

Base58Check has a marginally lower raw undetected-error probability, 2^-32 versus 2^-30, but Bech32's algebraic structure guarantees detection of the most common real-world error patterns: 1 to 4 character typos. Bech32 is therefore the stronger scheme in practice, and you can read the research article on Bitcoin address types from P2PKH to Taproot for a deeper comparison of address formats.

Why It Matters

Bitcoin transactions are irreversible. If you send funds to a mistyped address that happens to be valid, there is no chargeback, no customer support and no recovery mechanism. Checksums are the first and most important line of defence against this scenario.

Every wallet, exchange and payment service verifies checksums before broadcasting a transaction. This single check prevents the vast majority of accidental fund loss from transcription errors: partial copies, extra whitespace, transposed characters and dropped digits are all caught before they can cause damage. Layer 2 systems like Spark inherit these protections because they rely on the same underlying address encodings and cryptographic primitives.

Checksums Do Not Prevent Clipboard Attacks

Clipboard hijacking malware monitors the system clipboard and replaces copied Bitcoin addresses with attacker-controlled addresses. The replacement address has a perfectly valid checksum, so your wallet accepts it without complaint and your funds go to the attacker while you believe you are paying the intended recipient. Some malware families generate lookalike addresses that match the first and last several characters of the original address, making visual inspection unreliable.

Checksums protect against accidental errors, not deliberate substitution. You can defend against clipboard attacks by verifying addresses through independent channels, using hardware wallets that display the address on a separate screen, or employing tools like address poisoning detection.

No Protection Against Valid Wrong Addresses

A checksum tells you whether an address is well-formed, not whether it is the right one. If you accidentally paste a different valid address, such as your own old address, an address from a previous transaction or an attacker's address from a phishing message, the checksum will pass and the transaction will proceed.

Non-Zero Probability of Undetected Errors

No checksum is perfect, so there is always a small but nonzero chance that a corrupted address will still pass validation. For Base58Check, the odds are roughly 1 in 4.29 billion per error; for Bech32, any single error within the detection guarantee of up to 4 characters is caught with certainty, but exotic multi-character corruption patterns could theoretically slip through at a rate of roughly 1 in a billion. In practice, you are far more likely to encounter a clipboard attack than an undetected checksum collision.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.

0

← All 1876 glossary terms