Understanding how cryptocurrency addresses are created is fundamental for anyone interacting with blockchain technology. Both Bitcoin and Ethereum utilize a three-step generation flow: Private Key → Public Key → Address. This process ensures security through cryptographic principles.
The Core Three-Step Generation Process
The procedure for creating a wallet address is consistent across major blockchains and involves three critical stages.
- Generate a Random Private Key (32 bytes): This is a cryptographically secure random number that acts as your ultimate secret. Anyone with access to this key has complete control over the associated funds.
- Derive a Public Key from the Private Key (64 bytes): Using elliptic curve multiplication (secp256k1), the private key is used to generate a corresponding public key. This is a one-way function; you cannot reverse-engineer the private key from the public key.
- Derive an Address from the Public Key (20 bytes): The public key is hashed and encoded to create a shorter, more manageable public address for receiving funds. The specific hashing algorithm used in this step is the primary difference between Bitcoin and Ethereum.
How a Bitcoin Address is Generated
Bitcoin addresses can be derived from either uncompressed or compressed public keys, which affects the final output.
Generating an Address from an Uncompressed Public Key
This method uses the full, uncompressed form of the public key.
Step 1: Private Key Generation
A 256-bit (32-byte) random number is generated. This is your private key.
Example: 8F72F6B29E6E225A36B68DFE333C7CE5E55D83249D3D2CD6332671FA445C4DD3
Step 2: Public Key to Address (Hex)
- The private key is processed using the secp256k1 elliptic curve to produce a 65-byte uncompressed public key, prefixed with
04. - Calculate the SHA-256 hash of this full public key.
- Calculate the RIPEMD-160 hash on the result of the previous step, producing a 20-byte value.
- Add the mainnet version byte (
0x00) to the beginning of this 20-byte hash. - Compute a double SHA-256 checksum of the versioned hash.
- Append the first 4 bytes of this checksum to the versioned hash. This result is the raw address in hexadecimal format.
Step 3: User-Friendly Address
The final hexadecimal string is encoded using Base58Check to produce the familiar Bitcoin address, which avoids ambiguous characters like 0, O, I, and l.
Example: 121bWssvSgsA9SKjR4DbYncEAoJjmBFwog
Generating an Address from a Compressed Public Key
To save space, a compressed public key format can be used. Since the elliptic curve is symmetric, you can store just the X coordinate and a prefix indicating whether the Y coordinate is even (02) or odd (03).
The process from this compressed public key to the final address is identical to the uncompressed method (Steps 2 and 3 above). The only change is the input for the hashing functions is the compressed public key instead of the uncompressed one. 👉 Explore more strategies for secure key management
How an Ethereum Address is Generated
Ethereum's process shares the first step with Bitcoin but diverges significantly in how the public key is hashed to form the address.
Step 1: Private Key Generation
Like Bitcoin, a 256-bit random number serves as the private key.
Example: 18e14a7b6a307f426a94f8114701e7c8e774e7f9a47e2c2035db29a206321725
Step 2: Public Key Derivation
Using the same secp256k1 elliptic curve, the private key is converted into a 65-byte uncompressed public key (prefix 04).
Step 3: Address Derivation
- The entire uncompressed public key (without the
04prefix) is hashed using the Keccak-256 algorithm. This is a different hash function than SHA-256. - The resulting 32-byte hash is taken, and the last 20 bytes are extracted. This 20-byte string is the core Ethereum address.
- The address is presented by adding a
0xprefix, indicating it is a hexadecimal number.
Example: 0x1016f75c54c607f082ae6b0881fac0abeda21781
Key Technical Differences Summarized
| Feature | Bitcoin | Ethereum |
|---|---|---|
| Public Key to Address Hash | SHA-256 + RIPEMD-160 | Keccak-256 |
| Address Format | Base58Check encoding | Last 20 bytes of hash, hex prefixed with 0x |
| Public Key Compression | Supported (prefix 02/03) | Not typically used in address generation |
| Checksum | Built into Base58Check encoding | Requires external checksum standard (EIP-55) |
Frequently Asked Questions
What is the most important part of the address generation process?
The private key is the most critical component. It is the master secret that generates everything else. If it is lost, access to the address and its funds is lost forever. If it is stolen, the thief gains complete control.
Can two different private keys generate the same address?
The probability is astronomically low due to the vast size of the cryptographic key space (2^256 possibilities). For all practical purposes, it is considered impossible.
Why does Ethereum use Keccak-256 instead of SHA-256?
Ethereum's development was influenced by the Keccak algorithm family, which was selected as the winner of the NIST SHA-3 competition. The Ethereum protocol uses a specific variant before it was standardized, hence the differentiation.
Is a compressed or uncompressed public key better?
For Bitcoin, using a compressed public key is now standard. It reduces blockchain data size without compromising security. The resulting address is different from an uncompressed one, but both are equally secure and derived from the same private key.
How can I safely generate a private key?
Always use a trusted, audited, and cryptographically secure random number generator. For most users, this means using a well-established, open-source wallet application or a certified hardware wallet. Never use a random number generator you built yourself or found on an untrusted website.
What is the purpose of the version byte and checksum in a Bitcoin address?
The version byte specifies the network (e.g., mainnet vs. testnet) and address type. The checksum allows software to detect and prevent typos when a user enters an address, ensuring funds are not sent to an invalid destination. 👉 View real-time tools for blockchain exploration