How Ethereum Addresses Are Generated

·

Understanding how Ethereum addresses are created is essential for anyone diving into blockchain technology, cryptocurrency security, or decentralized applications. At its core, the process follows a well-defined cryptographic sequence: private key → public key → address. While similar in structure to Bitcoin’s address generation, Ethereum implements a few key differences—particularly in hashing and formatting—that make it unique.

This article breaks down the technical journey from private key to Ethereum wallet address, explains how it compares with Bitcoin, and explores practical implications for users managing multiple cryptocurrencies.


The Cryptographic Foundation: Secp256k1 Elliptic Curve

Both Ethereum and Bitcoin rely on the same elliptic curve cryptography standard: Secp256k1. This algorithm ensures that a private key can deterministically generate a corresponding public key, while making it computationally impossible to reverse-engineer the private key from the public one.

👉 Discover how cryptographic security protects your digital assets today.

The process begins when a user generates a random 256-bit number—their private key. This number must remain secret at all times, as it grants full control over any funds associated with the resulting address.

From this private key, the public key is derived using elliptic curve multiplication—a one-way function that leverages the properties of Secp256k1. The resulting public key is 64 bytes long (128 hexadecimal characters) and represents a point on the curve.


From Public Key to Ethereum Address: Keccak-256 Hashing

Once the public key is generated, Ethereum applies a specific hashing method to create the final address:

  1. Hash the public key using Keccak-256, a variant of SHA-3.
  2. Take the last 20 bytes (40 hex characters) of the resulting 64-character hash.
  3. Prepend 0x to indicate it's a hexadecimal Ethereum address.

Unlike Bitcoin, which uses multiple hashing steps (including SHA-256 and RIPEMD-160) and Base58 encoding to produce addresses, Ethereum simplifies the process by relying solely on Keccak-256 and truncating the output.

For example:

This streamlined approach reduces complexity and improves consistency across wallets and tools.


Generating an Ethereum Address with Python

You don’t need internet access or a wallet app to generate a valid Ethereum address—everything can be done offline using cryptographic libraries.

Here’s a simple Python script that demonstrates the full process:

import binascii
import sha3
from ecdsa import SigningKey, SECP256k1

# Generate private key
priv = SigningKey.generate(curve=SECP256k1)

# Derive public key
pub = priv.get_verifying_key()

# Perform Keccak-256 hash on public key
keccak = sha3.keccak_256()
keccak.update(pub.to_string())

# Create address from last 20 bytes of hash
address = "0x" + keccak.hexdigest()[24:]

# Convert keys to hex format
priv_key = binascii.hexlify(priv.to_string()).decode()
pub_key = binascii.hexlify(pub.to_string()).decode()

print("Private key:", priv_key)
print("Public key:", pub_key)
print("Address:", address)

Running this script will output something like:

Private key: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Public key: d061e9c5891f579fd548cfd22ff29f5c642714cc7e7a9215f0071ef5a5723f69...
Address: 0x9156a7cdab767ffe161ed21a0cb0b688b545b01f

This demonstrates that address generation is entirely client-side and secure, provided the private key remains protected.


Cross-Chain Compatibility: Same Private Key, Multiple Currencies

One fascinating aspect of using the Secp256k1 curve across both Ethereum and Bitcoin is cross-chain compatibility. Since both networks use the same underlying math, you can use the same private key to control both Bitcoin and Ethereum addresses.

👉 Learn how unified key management simplifies crypto portfolio control.

For instance, take this uncompressed public key originally derived from Bitcoin via OpenSSL:

04d061e9c5891f579fd548cfd22ff29f5c642714cc7e7a9215f0071ef5a5723f691757b28e31be71f09f24673eed52348e58d53bcfd26f4d96ec6bf1489eab429d

To convert it for Ethereum use:

import sha3
import binascii

_openssl_pub_key = "04d061e9c5891f579fd548cfd22ff29f5c642714cc7e7a9215f0071ef5a5723f691757b28e31be71f09f24673eed52348e58d53bcfd26f4d96ec6bf1489eab429d"
_pub_key = _openssl_pub_key[2:]  # Remove '04'
_pub_hex = binascii.unhexlify(_pub_key)

keccak = sha3.keccak_256()
keccak.update(_pub_hex)
address = "0x" + keccak.hexdigest()[24:]

print(address)  # Output: 0x9156a7cdab767ffe161ed21a0cb0b688b545b01f

This means:

However, this convenience comes with risk.


Security Implications of Shared Keys

While using one private key across chains simplifies management, it also increases exposure. If your private key is ever compromised:

🔐 Best Practice: Never reuse private keys across high-value wallets. For enhanced security, use separate keys or hierarchical deterministic (HD) wallets that derive unique keys per chain.

Frequently Asked Questions (FAQ)

Q: Can I generate an Ethereum address without internet access?
A: Yes. Ethereum address generation is entirely offline and relies only on cryptographic operations. No network connection is needed.

Q: Is Keccak-256 the same as SHA-3?
A: Not exactly. Keccak-256 was the original algorithm selected for SHA-3 but was later modified. Ethereum uses the pre-standardization version—Keccak-256—not FIPS-202 SHA-3.

Q: Why does the Ethereum address use only the last 20 bytes of the hash?
A: It balances security and efficiency. A 160-bit address provides sufficient collision resistance while keeping address length manageable.

Q: Can I derive an Ethereum address from a Bitcoin wallet?
A: Technically yes, if both use Secp256k1. However, most wallets isolate keys by chain for security reasons.

Q: What happens if I lose my private key?
A: You permanently lose access to your funds. Unlike traditional banking, there’s no recovery option—backup your keys securely.

Q: Are Ethereum addresses case-sensitive?
A: No, but they support checksum encoding (EIP-55), where capitalization indicates validity and helps prevent errors.


Final Thoughts

Ethereum address generation combines robust cryptography with elegant simplicity. By leveraging the widely trusted Secp256k1 curve and Keccak-256 hashing, it ensures strong security while enabling interoperability with other blockchains like Bitcoin.

Whether you're building decentralized apps, managing digital assets, or exploring blockchain fundamentals, understanding how addresses are formed gives you deeper insight into how trustless systems operate.

👉 Secure your crypto journey with tools built for modern blockchain users.

By mastering these foundational concepts—and applying best practices in key management—you empower yourself to navigate the evolving world of web3 safely and confidently.