A private key is a secret 256-bit number that lets you sign transactions, and whoever knows it controls the funds. A public address is derived from it in one direction: the private key produces a public key, and hashing the public key produces the address you share to get paid. No one can work backwards to the private key. Never type or paste your private key into any website, form or chat.
What are the three pieces, and what does each one do?
A crypto account is built from three linked values, each made from the one before it. Knowing which is which tells you what is safe to share.
| Private key | Public key | Address | |
|---|---|---|---|
| What it is | A secret random number | A point on an elliptic curve, computed from the private key | A short hash of the public key |
| Size (Ethereum) | 32 bytes, shown as 64 hex characters | 64 bytes, plus a prefix byte in some formats | 20 bytes, shown as 0x plus 40 hex characters |
| Who should see it | Only you | Anyone; it is revealed when you sign | Anyone; you share it to receive funds |
| What it lets someone do | Spend everything | Verify your signatures | Send you funds and view your history |
| Bank analogy | Your signature and PIN combined | A way for others to check that signature | Your account number |
The private key is the only one that matters for control. A crypto wallet stores keys, not coins. The coins are entries on a blockchain, and the key is what lets you move them.
How big is a private key, and why can't anyone guess it?
Bitcoin and Ethereum both use an elliptic curve called secp256k1, and a private key is simply a number in a fixed range on that curve. The range ends just below a number called the curve's order, which is about 1.16 × 10^77.
That range is too large to search. Mastering Bitcoin describes the key space of roughly 10^77 and compares it with the estimated 10^80 atoms in the visible universe. If a key is picked at random, nobody will ever land on it by guessing.
The catch is the phrase "at random." The same book warns that any process that is less than completely random can significantly weaken a key, and that wallets should use a cryptographically secure random number generator. Keys fail in practice when the randomness fails, not when the math does.
How does a private key become a public address?
The derivation runs in one direction only, in three steps.
- Pick the private key. Call it k, a random number in the valid range.
- Multiply to get the public key. The wallet computes K = k × G, where G is a fixed starting point on the curve, using elliptic curve multiplication. As Mastering Bitcoin puts it, the relationship "can only be calculated in one direction, from k to K." Going back would mean solving the elliptic curve discrete logarithm problem, which no known classical computer can do for keys this size.
- Hash the public key to get the address. A hash function turns any input into a fixed-length fingerprint. Ethereum takes the Keccak-256 hash of the public key and keeps the last 20 bytes. Bitcoin's original addresses use SHA-256 and then RIPEMD-160, which also gives 20 bytes. How hashing works is covered in what a hash function is.
The hash adds a second one-way step. Even if someone has your address, they don't have your public key until you sign something with it.
A worked example with a deliberately broken key
Here is the whole process with the smallest possible private key: the number 1. We computed each step ourselves using the published curve parameters.
- Private key:
0x000...0001, which is 63 zeros followed by a 1. - Public key: 1 × G is just G itself, the curve's published starting point. Its x-coordinate is
79BE667E...16F81798and its y-coordinate is483ADA77...FB10D4B8. - Keccak-256 of the public key:
c0a6c424ac7157ae408398dffollowed by7e5f4552091a69125d5dfcb7b8c2659029395bdf. - Ethereum address: the last 20 bytes,
0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf.
The mix of upper and lower case in step 4 is a checksum, which lets wallets catch most typing errors.
This example shows why randomness matters. Key number 1 is valid, but it's public knowledge, and so is its address. Anyone who sends funds there is giving them to whoever moves fastest. Never use a key you have seen written down anywhere, including here.
What does it mean to sign with a private key?
A digital signature is a short piece of data that proves the holder of a private key approved one exact message. When you send a transaction, your wallet signs it with the key, and the key itself never leaves the wallet.
Signatures have three useful properties:
- Anyone can verify them. Nodes check the signature against your public key before accepting a transaction.
- They're tied to one message. Change a single digit of the amount or recipient and the signature no longer matches.
- They can't be forged. Producing a valid signature without the private key is not feasible.
On Ethereum, a signature also lets others derive the public key that made it, so a transaction doesn't need to carry the public key separately. That's also why your public key becomes visible the first time you send from an address. Tools that let you inspect this are covered in how to read a transaction on a block explorer.
Not every signature request is a payment. A website can ask you to sign a message, and some messages grant permissions over your tokens. That is how wallet drainers steal funds without ever learning the key.
How do private keys relate to a seed phrase?
Most modern wallets don't show you a raw private key at all. They show a seed phrase, usually 12 or 24 words, which can regenerate a whole family of private keys and addresses. Backing up the phrase backs up every key derived from it, which is why keeping a seed phrase safe matters as much as guarding a single key.
Some accounts reduce dependence on one key. Smart contract wallets can require several approvals or allow recovery, as explained in what account abstraction is. A hardware wallet keeps keys inside a dedicated device that signs without exposing them.
How do private keys get stolen?
The math is rarely the weak point. Keys are lost through people, software and bad randomness:
| How it happens | What goes wrong | Protection |
|---|---|---|
| Phishing and fake support | Someone persuades you to enter a key or phrase into a site or chat | Never share a key or phrase with anyone, for any reason |
| Malware | Software on your device reads keys or swaps copied addresses | Keep large amounts on a hardware wallet, and check addresses on its screen |
| Weak key generation | A tool picks keys from too small a range | Use well-known wallets, never home-made or "vanity" generators |
| Lost backup | The key exists only on one device that breaks | Back up the seed phrase offline in more than one safe place |
Weak generation has caused large losses. In September 2022, the trading firm Wintermute lost $160 million from its Ethereum vault. Analysts traced it to an admin address made with Profanity, a tool for generating "vanity" addresses with patterns such as leading zeros. A security disclosure shortly before had warned that keys from that tool could be recovered by brute force. Wintermute had not published a post-mortem at the time.
Longer term, a large quantum computer could in theory derive a private key from a public key. That risk and the proposed fixes are covered in whether quantum computers could break Bitcoin.
What is safe to share?
Your address is meant to be shared, with one privacy caveat: anyone who has it can see that address's whole public history. Your public key is safe to share and becomes public anyway once you send a transaction.
Your private key and seed phrase are never safe to share. No real exchange, wallet maker, airdrop or support agent needs them. If anyone asks, it's a scam. If you think a key has been exposed, move the funds to a new wallet with a fresh seed phrase straight away.
Before sending to an address, check every character, not just the first and last few, because look-alike addresses are a known trick described in address poisoning. More guides are in our cryptography hub, and the Ethereum hub covers the chain used in the worked example.
Key takeaways
- A private key is a secret random number, the public key is computed from it, and the address is a hash of the public key.
- Each step works in one direction only, so sharing an address or public key doesn't reveal the private key.
- A signature proves the key holder approved one exact message, and anyone can verify it without learning the key.
- Keys are safe only if they are generated with strong randomness. Weak generators, like the Profanity vanity tool, have led to large thefts.
- Never type, paste or share a private key or seed phrase. Anyone who asks for one is trying to steal from you.
Sources
Get the weekly commit
New blockchain deep dives every week.

