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.

  • Small correction: address compression isn't part of bitcoin; it's part of OpenSSL.
    – Nick ODell
    Commented Mar 20, 2013 at 20:45

2 Answers 2


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:

  • 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.

  • Address version for the main network is 0, not 1. The rest is all true.
    – Gigi
    Commented May 26, 2013 at 15:32
  • @Gigi you are right, fixed. Commented May 30, 2013 at 15:21

Not all transactions can be decoded into an address.

For example, this transaction could be claimed by putting the genesis block in the output script. That's not a standard address type, nor will it ever be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.