<p>I believe that the earlier format that you are referring to is the Hash160 which is formed by taking the <code>sha256</code> of the public key followed by taking the <code>ripemd160</code> of the result:</p>

<ul>
<li><code>Hash160 = ripemd160(sha256(pubkey))</code></li>
</ul>

<p>Further, what we usually refer to as a Bitcoin address is formed by first concatenating the Hash160 with four checksum bytes (to make it extremely unlikely that you can type the wrong address into a bitcoin client by accident). Then, a network identifier (0x00 for main network) is prepended and the string is <a href="https://en.bitcoin.it/wiki/Base58Check_encoding" rel="nofollow">base58 encoded</a>:</p>

<ul>
<li><code>address = base58(0x00 + Hash160 + checksum)</code></li>
</ul>

<p>As you can see these two formats can easily be converted from one to the other. In addition the public key can be encoded either compressed or uncompressed. This results in two different addresses. However, since you can obtain the public key from neither the Hash160 nor the base58 address it is not possible to convert an address of an uncompressed public key to the address corresponding to the compressed public key, and vice versa.</p>

CC BY-SA 3.0
2013-05-26T15:32:54.673Z
Address version for the main network is 0, not 1. The rest is all true.
Gigi
CC BY-SA 3.0
2013-05-30T15:21:32.073Z
@Gigi you are right, fixed.
Jon Lund Steffensen
CC BY-SA 3.0
2013-03-20T18:59:52.133Z
2013-05-30T15:20:49.163Z
2013-05-30T15:20:49.163Z
Jon Lund Steffensen
<p>Not all transactions can be decoded into an address.</p>

<p>For example, <a href="https://en.bitcoin.it/wiki/Script#Transaction_puzzle" rel="nofollow">this transaction</a> could be claimed by putting the genesis block in the output script. That's not a standard address type, nor will it ever be.</p>

CC BY-SA 3.0
2013-05-30T17:11:33.820Z
2013-05-30T17:11:33.820Z
Nick ODell
<p>I'm creating an offline index to report off of the block chain.  I plan on indexing each transaction based on the address displayed in the TX.</p>

<p>Are all addresses Base58?   I believe I also read about a compact address and an address type that was used in the beginning of the blockchain before Satoshi knew of/implemented address compression using Base58.</p>

CC BY-SA 3.0
2013-03-20T20:45:50.650Z
Small correction: address compression isn't part of bitcoin; it's part of OpenSSL.
Nick ODell
<address><public-key><multi-signature>
How many different formats can a public address take?
makerofthings7
# How many different formats can a public address take?

(Asked by: username_0 on 2013-03-13)

I'm creating an offline index to report off of the block chain. I plan on indexing each transaction based on the address displayed in the TX.

Are all addresses Base58? I believe I also read about a compact address and an address type that was used in the beginning of the blockchain before Satoshi knew of/implemented address compression using Base58.

**Tags:** address, public-key, multi-signature

> **Comments:**
> **username_1**: Small correction: address compression isn't part of bitcoin; it's part of OpenSSL.  

---

## 2 answers

### Answer by username_2 on 2013-03-20. Score: 2 | Accepted answer

I believe that the earlier format that you are referring to is the Hash160 which is formed by taking the `sha256` of the public key followed by taking the `ripemd160` of the result:

* `Hash160 = ripemd160(sha256(pubkey))`

Further, what we usually refer to as a Bitcoin address is formed by first concatenating the Hash160 with four checksum bytes (to make it extremely unlikely that you can type the wrong address into a bitcoin client by accident). Then, a network identifier (0x00 for main network) is prepended and the string is [base58 encoded](https://en.bitcoin.it/wiki/Base58Check_encoding):

* `address = base58(0x00 + Hash160 + checksum)`

As you can see these two formats can easily be converted from one to the other. In addition the public key can be encoded either compressed or uncompressed. This results in two different addresses. However, since you can obtain the public key from neither the Hash160 nor the base58 address it is not possible to convert an address of an uncompressed public key to the address corresponding to the compressed public key, and vice versa.

> **Comments:**
> **username_3**: Address version for the main network is 0, not 1. The rest is all true.  
> **username_2**: @username_3 you are right, fixed.  

---

### Answer by username_1 on 2013-05-30. Score: 1

Not all transactions can be decoded into an address.

For example, [this transaction](https://en.bitcoin.it/wiki/Script#Transaction_puzzle) could be claimed by putting the genesis block in the output script. That's not a standard address type, nor will it ever be.


---

