HRP and Separator
HRP and Separator
The most visible difference between a legacy address and a SegWit address is the "Header." In Bech32, this is formally divided into the Human-Readable Part (HRP) and the Separator.
1. The HRP (Human-Readable Part)
The HRP tells the user and the software which network the address belongs to.
-
bc: Main Bitcoin Network (Mainnet). -
tb: Bitcoin Testnet. -
bcrt: Bitcoin Regtest (Local development).
This is a major improvement over Base58. In the legacy system, you had to decode the entire address just to find the "Version Byte" to see if it was a Testnet address. In Bech32, you can tell just by looking at the first two letters.
2. The Separator ('1')
The character 1 serves as a "Wall" between the human-readable network ID and the encoded cryptographic data.
-
The separator is Always the character
1. -
Because
1is excluded from the Base32 data alphabet, the computer knows that the very first1it sees marks the end of the HRP.
3. Why '1'?
The character 1 was chosen as the separator because it is visually distinct and rarely occurs at the start of a network name. It provides a clear visual break for the human eye, separating the "Where" (Network) from the "Who" (Encoded Hash).
4. Verification Logic
When a wallet parses bc1qar0s...:
-
It finds the last
1in the string. -
Everything to the left is the HRP (
bc). -
Everything to the right is the Data Part.
-
If the HRP is
bc, the wallet knows this transaction is intended for the Mainnet. If you try to send Mainnet funds to atb1...address, the wallet will stop you immediately.
| Network | HRP | Example |
|---|---|---|
| Mainnet | bc |
bc1q... |
| Testnet | tb |
tb1q... |
| Signet | tb |
tb1q... |
In the next section, we will analyze the Bit Grouping (5-bit chunks) process.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: