Ethereum: How are different addresses generated from the same private key?
Mathematical Connection: How Different Addresses Are Created from the Same Private Key
In the world of cryptocurrencies, especially Ethereum, understanding how different addresses are created from a single private key is crucial to understanding the underlying mathematics. One concept that comes to mind is the relationship between private keys and their corresponding public keys, which ultimately translate into unique addresses on the blockchain.
For those unfamiliar, let’s dive into the details: when you create an Ethereum wallet, it creates two types of addresses:
- Private Key: A secret code used to sign (or “sign”) transactions.
- Public Key (or
Address): A unique string of characters that identifies and represents your Ethereum wallet.
The connection between private keys and public addresses lies in the mathematical concept of elliptic curves, which are used to encode and verify cryptographic operations on the blockchain.
From Private Key to Public Address
Consider the following steps:
- Create Pair: You create a pair of numbers (p, q) that define an elliptic curve using your private key.
- Choose e: This is a large integer (e) that determines the difficulty level of performing certain mathematical operations on the curve.
- Calculate k and n: These values are chosen so that n is (p-1), the product of q, p, and e.
From Public Key to Address
The public key consists of four hexadecimal digits: “0x[base58-encoded private key]”. To translate this into a unique address on the Ethereum network:
- Subtract 2: You need to “subtract” your base58-encoded private key from the number 2.
- Modify by e: The resulting number becomes your public key after performing the modulo operation on e.
Why multiple addresses from one private key?
Now let’s look at why you might end up with multiple addresses when creating an Ethereum wallet:
- Base58 encoding

: This step converts the private key into a compact form that can be easily stored and transmitted (base58 encoding).
- Hash function
: The base58-encoded public key is then passed through a hash function, which creates a fixed-size string.
This mathematical manipulation ensures that different addresses from a single private key are generated in a random and unpredictable manner, providing additional protection against potential attacks or unauthorized transactions.
In summary:
- A private key creates two types of Ethereum addresses: a public key (or address) and another pair of numbers (p, q) on an elliptic curve.
- The public key is further modified by subtracting 2 from the base58-encoded private key and using modulo operations using a large integer e.
- This process provides multiple unique addresses for each wallet, ensuring security and preventing attacks.
Understanding how Ethereum addresses are generated from a single private key can help you navigate the world of cryptocurrencies more confidently.
Bir cevap yazın