A Bitcoin address is generated starting from the public key, following this algorithm:
- A public key is generated
- The private key associated to that public key is generated
- The private key is multiplied by a number (ECDSA), which generates .
- is generated by double hashing
- A version is generated, which is a hex number (0x03 for private key and 0x00 for public key).
- The checksum is computed by double hashing concatenated to with SHA256.7. We take the first 4 bits of the checksum;8. We generate the address by doing where is the concatenation The Base58 is equal to the Base64 encoding, but excluding the characters:
- Uppercase i (I)
- Lowercase L (l)
- Uppercase o (O)
- The zero (0)
- The symbols + and /.
Because those symbols can be confusing when inserted by hand.
The checksum is needed in order for the protocol to verify if the inserted address is a valid one, otherwise we might send money to an non existing address, and so money will be lost.
It’s possible to get from , since both adn are fixed length, and the operation is two way. Of course we cannot get the private key from .
It’s also possible to personalize an address, if the address is not yet chose, but it’s not safe. The more random the address is, the better.