List of address prefixes: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
PC (talk | contribs)
Clarifying that it's not the private key that's compressed, but the corresponding public key
Wargo (talk | contribs)
Updated links
 
(21 intermediate revisions by 20 users not shown)
Line 1: Line 1:
Blockchain-based currencies use addresses, which are a [[Base58Check encoding]] of some hash, typically that of a public key. The encoding includes a version byte, which affects the first character in the address. The following is a list of some prefixes which are in use.
Blockchain-based currencies use encoded strings, which are in a [[Base58Check encoding]] with the exception of [[Bech32]] encodings. The encoding includes a prefix (traditionally a single ''version byte''), which affects the leading symbol(s) in the encoded result. The following is a list of some prefixes which are in use in the reference Bitcoin codebase.<ref>https://github.com/bitcoin/bitcoin/blob/26.x/src/kernel/chainparams.cpp#L144-L146</ref><ref>https://github.com/bitcoin/bitcoin/blob/26.x/src/kernel/chainparams.cpp#L250-L252</ref><ref>https://github.com/bitcoin/bitcoin/blob/26.x/src/kernel/chainparams.cpp#L516-L518</ref>


{| class="wikitable"  
{| class="wikitable"  
|-
|-
!Initial byte(s)
!Decimal prefix
!Leading symbol
!Hex
!Use
!Example use
!Leading symbol(s)
!Example
!Example
|-
|-
|0
|0
|00
|Pubkey hash ([[Transaction#Pay-to-PubkeyHash|P2PKH address]])
|1
|1
|Bitcoin pubkey hash
|<tt>17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem</tt>
|<tt>12CPLrAUPvhVwjZqBgww3sLdEg4Z888R1j</tt>
|-
|-
|5
|5
|05
|Script hash ([[Pay to script hash|P2SH address]])
|3
|3
|Bitcoin script hash
| <tt>3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX</tt>
|<tt>3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX</tt>
|-
|-
|48
|128
|L
|80
|Litecoin pubkey hash
|Private key ([[Wallet import format|WIF]], uncompressed pubkey)
|<tt>LhK2kQwiaAvhjWY799cZvMyYwnQAcxkarr</tt>
|5
|<tt>5Hwgr3u458GLafKBgxtssHSPqJnYoGrSzgQsPwLFhLNYskDPyyA</tt>
|-
|-
|52
|133
|M or N
|80
|Namecoin pubkey hash
|Private key ([[Wallet import format|WIF]], uncompressed pubkey, Electrum-defined<ref name="electrum-300-wif">[https://github.com/spesmilo/electrum/blob/3.0.0/RELEASE-NOTES#L42]</ref> and now deprecated<ref name="electrum-310-wif">[https://github.com/spesmilo/electrum/blob/3.1.0/RELEASE-NOTES#L58]</ref>)
|<tt>NATX6zEUNfxfvgVwz8qVnnw3hLhhYXhgQn</tt>
|5
|<tt>5TfQjD9DLFeUFmDiDrzsdtSGQss93o4pvsmQcgmjfcQVLsEgAoM</tt>
|-
|-
|95
|128
|f
|80
|Fairbrix pubkey hash
|Private key ([[Wallet import format|WIF]], compressed pubkey)
|<tt>fF6o8LeDAfswEpMbCW8BqaqmzMWS7TGgew</tt>
|K ''or'' L
|<tt>L1aW4aubDFB7yfras2S1mN3bqg9nwySY8nkoLmJebSLD5BWv3ENZ</tt>
|-
|-
|97
|129-134
|g
|80
|GeistGeld pubkey hash
|Private key ([[Wallet import format|WIF]], compressed pubkey, Electrum-defined<ref name="electrum-300-wif" /> and now deprecated<ref name="electrum-310-wif" />)
|<tt>gQ8YScyiMUTart6kUJpzhjPzAKfiYAwooc</tt>
|L
|<tt>LkUevPi661korFvRdQQUkEX35rA484oAwzsT93383q6mUqVe5cw2</tt>
|-
|-
|105
|135
|j
|80
|i0coin pubkey hash
|Private key ([[Wallet import format|WIF]], compressed pubkey, Electrum-defined<ref name="electrum-300-wif" /> and now deprecated<ref name="electrum-310-wif" />)
|<tt>jWmCr5cKeQjV4iyfUyipfLGwVML8MvXhF2</tt>
|L ''or'' M
|<tt>M3dv4iRtSKb5oHwxjZCGLai1aiZMnuLdGt7iFwjK2ncC3Vu7tRwP</tt>
|-
|-
|111
|4 136 178 30
|m or n
|0488B21E
|Bitcoin testnet pubkey hash
|[[BIP 0032|BIP32]] pubkey
|<tt>mkJ7Bf5chdfw61d1m7gnDVAQV3EQQAb8iz</tt>
|xpub
|<tt>xpub661MyMwAqRbcEYS8w7XLSVeEsBXy79zSzH1J8vCdxAZningWLdN3
zgtU6LBpB85b3D2yc8sfvZU521AAwdZafEz7mnzBBsz4wKY5e4cp9LB</tt>
|-
|-
|125
|4 136 173 228
|s
|0488ADE4
|Solidcoin pubkey hash
|BIP32 private key
|<tt>sXNaMoYBocjcQJRLK53dkaQ5mWuKfvHB9f</tt>
|xprv
|<tt>xprv9s21ZrQH143K24Mfq5zL5MhWK9hUhhGbd45hLXo2Pq2oqzMMo63o
StZzF93Y5wvzdUayhgkkFoicQZcP3y52uPPxFnfoLZB21Teqt1VvEHx</tt>
|-
|-
|127
|111
|t
|6F
|Tenebrix pubkey hash
|Testnet pubkey hash
|<tt>tUK2EQTMF6cN6vuNEfJtVf1BMqarvEZJBL</tt>
|m ''or'' n
|-
|<tt>mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn</tt>
|128
|5
|Bitcoin Private key (for uncompressed public key)
|<tt>5Htn3FzuH3b1X5VF2zLTsAQzBcyzkZNJsa2egXN8ZFJTCqQm3Rq</tt>
|-
|128
|K or L
|Bitcoin Private key (for compressed public key)
|<tt>L1aW4aubDFB7yfras2S1mN3bqg9nwySY8nkoLmJebSLD5BWv3ENZ</tt>
|-
|138
|x
|ixcoin pubkey hash
|<tt>xoKDFH4uWpyzxUcCC5jCLFujRKayv3HHcV</tt>
|-
|-
|196
|196
|C4
|Testnet script hash
|2
|2
|Testnet script hash
|<tt>2MzQwSSnBHWHqSAqtTVQ6v47XtaisrJa1Vc</tt>
|
|-
|-
|239
|239
|EF
|Testnet Private key ([[Wallet import format|WIF]], uncompressed pubkey)
|9
|9
|Uncompressed Testnet Private key
|<tt>92Pg46rUhgTT7romnV7iGW6W1gbGdeezqdbJCzShkCsYNzyyNcc</tt>
|<tt>91eWjgRmucdtYHpMdsHbn9h8UU8hdoMNSKj8p3QAj6VTLyBnjj6</tt>
|-
|-
|239
|239
|EF
|Testnet Private key ([[Wallet import format|WIF]], compressed pubkey)
|c
|c
|Compressed Testnet Private key
|<tt>cNJFgo1driFnPcBdBX8BrJrpxchBWXwXCvNH5SoSkdcF6JXXwHMm</tt>
|<tt>cNJFgo1driFnPcBdBX8BrJrpxchBWXwXCvNH5SoSkdcF6JXXwHMm</tt>
|-
|4 53 135 207
|043587CF
|Testnet BIP32 pubkey
|tpub
|<tt>tpubD6NzVbkrYhZ4WLczPJWReQycCJdd6YVWXubbVUFnJ5KgU5MDQrD9
98ZJLNGbhd2pq7ZtDiPYTfJ7iBenLVQpYgSQqPjUsQeJXH8VQ8xA67D</tt>
|-
|4 53 131 148
|04358394
|Testnet BIP32 private key
|tprv
|<tt>tprv8ZgxMBicQKsPcsbCVeqqF1KVdH7gwDJbxbzpCxDUsoXHdb6SnTPY
xdwSAKDC6KKJzv7khnNWRAJQsRA8BBQyiSfYnRt6zuu4vZQGKjeW4YF</tt>
|-
|
|
|
|Bech32 pubkey hash or script hash
|bc1
|<tt>bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4</tt>
|-
|-
|0x142, 0x143
|
|6P
|
|Encrypted private key ([[BIP 0038|BIP 38]])
|Bech32 testnet pubkey hash or script hash
|<tt> 6PRVWUbkzzsbcVac2qwfssoUJAN1Xhrg6bNk8J7Nzm5H7kxEbn2Nh2ZoGg </tt>
|tb1
|<tt>tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx</tt>
|}
|}
Note that private keys for compressed and uncompressed bitcoin public keys use the same version byte. The reason for the compressed form starting with a different character is because a 0x01 byte is appended to the private key before base58 encoding.


The following table shows the leading symbol(s) and address length(s) for 160 bit hashes for each of the possible decimal version values:
The following table shows the leading symbol(s) and address length(s) for 160 bit hashes for each of the possible decimal version values:
Line 575: Line 598:
|35
|35
|}
|}
== References ==
<references />
{{Bitcoin Core documentation}}

Latest revision as of 21:13, 7 January 2024

Blockchain-based currencies use encoded strings, which are in a Base58Check encoding with the exception of Bech32 encodings. The encoding includes a prefix (traditionally a single version byte), which affects the leading symbol(s) in the encoded result. The following is a list of some prefixes which are in use in the reference Bitcoin codebase.[1][2][3]

Decimal prefix Hex Example use Leading symbol(s) Example
0 00 Pubkey hash (P2PKH address) 1 17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem
5 05 Script hash (P2SH address) 3 3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX
128 80 Private key (WIF, uncompressed pubkey) 5 5Hwgr3u458GLafKBgxtssHSPqJnYoGrSzgQsPwLFhLNYskDPyyA
133 80 Private key (WIF, uncompressed pubkey, Electrum-defined[4] and now deprecated[5]) 5 5TfQjD9DLFeUFmDiDrzsdtSGQss93o4pvsmQcgmjfcQVLsEgAoM
128 80 Private key (WIF, compressed pubkey) K or L L1aW4aubDFB7yfras2S1mN3bqg9nwySY8nkoLmJebSLD5BWv3ENZ
129-134 80 Private key (WIF, compressed pubkey, Electrum-defined[4] and now deprecated[5]) L LkUevPi661korFvRdQQUkEX35rA484oAwzsT93383q6mUqVe5cw2
135 80 Private key (WIF, compressed pubkey, Electrum-defined[4] and now deprecated[5]) L or M M3dv4iRtSKb5oHwxjZCGLai1aiZMnuLdGt7iFwjK2ncC3Vu7tRwP
4 136 178 30 0488B21E BIP32 pubkey xpub xpub661MyMwAqRbcEYS8w7XLSVeEsBXy79zSzH1J8vCdxAZningWLdN3

zgtU6LBpB85b3D2yc8sfvZU521AAwdZafEz7mnzBBsz4wKY5e4cp9LB

4 136 173 228 0488ADE4 BIP32 private key xprv xprv9s21ZrQH143K24Mfq5zL5MhWK9hUhhGbd45hLXo2Pq2oqzMMo63o

StZzF93Y5wvzdUayhgkkFoicQZcP3y52uPPxFnfoLZB21Teqt1VvEHx

111 6F Testnet pubkey hash m or n mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn
196 C4 Testnet script hash 2 2MzQwSSnBHWHqSAqtTVQ6v47XtaisrJa1Vc
239 EF Testnet Private key (WIF, uncompressed pubkey) 9 92Pg46rUhgTT7romnV7iGW6W1gbGdeezqdbJCzShkCsYNzyyNcc
239 EF Testnet Private key (WIF, compressed pubkey) c cNJFgo1driFnPcBdBX8BrJrpxchBWXwXCvNH5SoSkdcF6JXXwHMm
4 53 135 207 043587CF Testnet BIP32 pubkey tpub tpubD6NzVbkrYhZ4WLczPJWReQycCJdd6YVWXubbVUFnJ5KgU5MDQrD9

98ZJLNGbhd2pq7ZtDiPYTfJ7iBenLVQpYgSQqPjUsQeJXH8VQ8xA67D

4 53 131 148 04358394 Testnet BIP32 private key tprv tprv8ZgxMBicQKsPcsbCVeqqF1KVdH7gwDJbxbzpCxDUsoXHdb6SnTPY

xdwSAKDC6KKJzv7khnNWRAJQsRA8BBQyiSfYnRt6zuu4vZQGKjeW4YF

Bech32 pubkey hash or script hash bc1 bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
Bech32 testnet pubkey hash or script hash tb1 tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx

Note that private keys for compressed and uncompressed bitcoin public keys use the same version byte. The reason for the compressed form starting with a different character is because a 0x01 byte is appended to the private key before base58 encoding.

The following table shows the leading symbol(s) and address length(s) for 160 bit hashes for each of the possible decimal version values:

Decimal version Leading symbol Address length
0 1 up to 34
1 Q-Z, a-k, m-o 33
2 o-z, 2 33 or 34
3 2 34
4 2 or 3 34
5-6 3 34
7 3 or 4 34
8 4 34
9 4 or 5 34
10-11 5 34
12 5 or 6 34
13 6 34
14 6 or 7 34
15-16 7 34
17 7 or 8 34
18 8 34
19 8 or 9 34
20-21 9 34
22 9 or A 34
23 A 34
24 A or B 34
25-26 B 34
27 B or C 34
28 C 34
29 C or D 34
30-31 D 34
32 D or E 34
33 E 34
34 E or F 34
35-36 F 34
37 F or G 34
38 G 34
39 G or H 34
40-41 H 34
42 H or J 34
43 J 34
44 J or K 34
45-46 K 34
47 K or L 34
48 L 34
49 L or M 34
50-51 M 34
52 M or N 34
53 N 34
54 N or P 34
55-56 P 34
57 P or Q 34
58 Q 34
59 Q or R 34
60-61 R 34
62 R or S 34
63 S 34
64 S or T 34
65-66 T 34
67 T or U 34
68 U 34
69 U or V 34
70-71 V 34
72 V or W 34
73 W 34
74 W or X 34
75-76 X 34
77 X or Y 34
78 Y 34
79 Y or Z 34
80-81 Z 34
82 Z or a 34
83 a 34
84 a or b 34
85 b 34
86 b or c 34
87-88 c 34
89 c or d 34
90 d 34
91 d or e 34
92-93 e 34
94 e or f 34
95 f 34
96 f or g 34
97-98 g 34
99 g or h 34
100 h 34
101 h or i 34
102-103 i 34
104 i or j 34
105 j 34
106 j or k 34
107-108 k 34
109 k or m 34
110 m 34
111 m or n 34
112-113 n 34
114 n or o 34
115 o 34
116 o or p 34
117-118 p 34
119 p or q 34
120 q 34
121 q or r 34
122-123 r 34
124 r or s 34
125 s 34
126 s or t 34
127-128 t 34
129 t or u 34
130 u 34
131 u or v 34
132-133 v 34
134 v or w 34
135 w 34
136 w or x 34
137-138 x 34
139 x or y 34
140 y 34
141 y or z 34
142-143 z 34
144 z or 2 34 or 35
145-255 2 35

References