TERM_DEF // ADDRESSES_ENCODING / HEXADECIMAL
HEXADECIMAL
Hexadecimal. Base-16 representation where each byte becomes two characters (0–9, a–f); the universal raw-byte format.
This page sits in the Addresses & Encoding section — How raw bytes become human-shareable strings — and the encoding rules that catch typos. Read on for what it is, why it exists, how it works under the hood, and what to watch out for.
This page sits in the Addresses & Encoding section — How raw bytes become human-shareable strings — and the encoding rules that catch typos. Read on for what it is, why it exists, how it works under the hood, and what to watch out for.
WHAT_HEXADECIMAL_IS
Hexadecimal — at a glance
ADDRESSES
Hexadecimal is part of the HEX family of encodings used throughout Bitcoin. Base-16 encoding using digits 0-9 and letters a-f; every byte becomes exactly 2 hex characters. Base-16 representation where each byte becomes two characters (0–9, a–f); the universal raw-byte format.
Why it exists
DESIGN
A Bitcoin address is, under the hood, a commitment to a script — usually a 20-byte hash or a 32-byte point. Asking users to copy 32 raw bytes would guarantee constant typos and lost funds. Address encodings (Base58Check, Bech32, Bech32m) turn those bytes into compact strings that include a mathematical checksum: every typo of 1–4 characters is detected before broadcast.
HOW_IT_WORKS
Mechanism
HOW IT WORKS
Legacy P2PKH addresses ("1…") use Base58Check: a version-byte-base58check/">version byte + 20-byte hash + 4-byte double-SHA-256 checksum, then encoded with a 58-character alphabet (no 0/O/I/l). P2SH ("3…") is the same recipe with a different version byte. SegWit v0 ("bc1q…") uses Bech32: a human-readable prefix, separator "1", 5-bit data, and a BCH checksum that detects up to 4 character errors. Taproot ("bc1p…") uses Bech32m, a tiny variant that fixes a length-extension vulnerability discovered in the original Bech32.
1. The script is reduced to a canonical commitment — usually HASH160(pubkey) for legacy or witness program for SegWit.
2. A version byte (P2PKH 0x00, P2SH 0x05, testnet variants) or a witness version (0 for v0, 1 for Taproot) is prepended.
3. A checksum is computed: 4 bytes of double-SHA-256 for Base58Check, or a 30-bit BCH checksum for Bech32/Bech32m.
4. The combined bytes are encoded into the chosen alphabet (58-character Base58 or 32-character Bech32).
5. The result is the address. A wallet checks the checksum on every paste; mismatched checksum → user is warned, transaction is never built.
WORKED_EXAMPLE
Hexadecimal — HEX
EXAMPLE
byte 0xFF = "ff"
255 in decimal = 0xFF in hex
advantages: 2× expansion, human-readable, case-insensitive
disadvantages: no checksum — typos are silent
KEY_PROPERTIES
CHECKSUM
A 1–4 character typo is caught client-side. No transaction is broadcast against a malformed address.
PREFIX
The first character(s) tell you the address type (legacy / P2SH / SegWit / Taproot) at a glance.
CASE-SAFE
Bech32/Bech32m are case-insensitive but always written lowercase. Base58Check is case-sensitive — copy carefully.
COMMON_PITFALLS
Things that catch people out
PITFALLS
- Sending mainnet coins to a testnet address (or vice versa) destroys them. Always verify the prefix before broadcasting.
- Some exchanges still cannot send to Taproot ("bc1p…") addresses. Have a SegWit-v0 ("bc1q…") fallback ready.
- Address reuse degrades privacy. Modern wallets generate a fresh address per receive — re-displaying the same one is an anti-pattern.
- Vanity addresses ("1Bitcoin…") are fine but use scarce randomness; never accept one from a stranger as a "proof" of identity.
WHERE_YOU'LL_SEE_IT
Pages on this site that cover Hexadecimal in more depth:
RELATED_CONCEPTS
Other terms from Addresses & Encoding — click any to read its page:
TERMINOLOGY_INDEX
TERMINOLOGY
Hexadecimal
Base-16 representation where each byte becomes two characters (0–9, a–f); the universal raw-byte format.
Address
A user-friendly string that encodes a locking script; you give it to a sender and they pay the script.
Base58
A 58-character alphabet excluding visually-confusable characters (0, O, I, l); used in legacy addresses.
Base58Check
Base58 with a 4-byte SHA256d checksum suffix; a single typo will fail the checksum.
Bech32
BIP173 address format for SegWit v0; uses a lowercase 32-character alphabet and BCH error-correcting checksum.
Bech32m
BIP350 variant fixing a Bech32 mutation issue; used for SegWit v1+ (Taproot).
Checksum
Extra bytes appended to data so a recipient can detect transmission errors with high probability.
WIF (Wallet Import Format)
Base58Check encoding of a private key with a version byte and optional flag-wif-0x01/">compression flag.