What is a private key? Public and private keys in crypto
A private key is the one piece of data that controls your crypto. It signs the transactions that move your coins, and anyone who holds it can spend them. Here is how public and private keys work, how they link to your wallet, and why the secret one matters most.
Published · 5 min read
A private key is a secret number that controls your crypto. It proves you own the coins sitting at an address, and it signs the transactions that move them. You can share your public key or your address with anyone. Guard the private key. Whoever holds it controls the funds.
What a private key actually is
Think of a private key as the one secret that stands between your coins and everyone else. In technical terms it is a very large random number. On Bitcoin and on Ethereum it is a 256-bit value, written as 64 hexadecimal characters, drawn from a range so vast that guessing one is not realistic. A 256-bit key means two to the power of 256 possible values, a number with 78 digits. Ethereum's own developer documentation puts it plainly. Your private key is what you use to sign transactions.
Here is the part that surprises new buyers. You do not really hold coins at all. Ethereum's documentation notes that you hold private keys, and the balance itself lives on the network's shared ledger. Control the key, and you control the money tied to it. Lose the key, and the coins stay on the ledger forever, visible to everyone and spendable by no one.
Public key, private key and address: how they connect
Every account starts with the private key. From it, your wallet derives a public key using elliptic curve cryptography, the same math Bitcoin and Ethereum both rely on. The public key is then shortened into the address you hand out to receive funds. On Ethereum, that address is the last 20 bytes of a hash of the public key, shown as 0x and 40 more characters. Bitcoin does the same job a different way, hashing the public key down into the shorter address you share.
The order only runs one way. A public key can always be worked out from a private key. The reverse is meant to be impossible, which is the whole point of the design. As Ethereum's docs state, you cannot derive a private key from public keys. Bitcoin's developer guide describes the same step as a one-way function that turns a private key into a public key, with no route back.
Why you can share one key but never the other
This split is what lets crypto work without a bank in the middle. Your public key and address are safe to post in the open. People use them to send you coins, and that is all they can do with them. When you spend, your wallet signs the transaction with the private key, and the network checks that signature against your public key. The private key itself never leaves your device. That is how a stranger can pay you while never being able to take anything back.
The secret key is the whole game. Trezor, a hardware wallet maker, puts the risk in one line. Anyone with access to your private key can move or spend all the cryptocurrency in your wallet without your consent. No support desk can undo that. No password reset exists. A stolen key is a stolen balance.
Keys, seed phrases and wallets: how they fit together
Most people never see their private key as a raw string of characters. A wallet handles it for them. What you write down at setup is a seed phrase, usually 12 or 24 plain English words, and that phrase is really your keys in human-readable form. From those words a wallet can rebuild every private key, public key and address in the account.
A wallet, then, is not a vault that stores your coins. It is a key manager. It makes your keys, keeps them safe, and signs with them when you approve a payment. For the longer version, read our guide to how a self-custody crypto wallet works, and our explainer on the seed phrase that backs those keys up.
Who holds your keys: self-custody vs an exchange
Not every crypto owner holds their own keys. When your coins sit on an exchange, the exchange holds the private keys, and you hold an IOU in its database. That setup is custodial. It is convenient, and it means the company, not you, carries the keys and the risk that comes with them.
Self-custody flips that around. You keep the private keys yourself, often on a hardware device kept offline, and no firm can freeze or misplace them for you. The trade is blunt. Full control comes with full responsibility. The phrase traders repeat, not your keys, not your coins, is just this idea in five words.
How private keys get lost or stolen
Good math does not protect a careless key. Keys on an internet-connected device can be stolen, as Bitcoin's developer guide warns, which is why large holders keep them offline. People lose keys too. Hard drives fail, phones get wiped, and seed phrases go out with the moving boxes.
A few plain rules cut the risk. Never type your seed phrase into a website or share it with anyone, including someone who claims to be support. Keep a backup of the words somewhere physical and private. Write them on paper, not in a photo or a notes app that syncs to the cloud. Treat any message that asks for your key or phrase as a theft attempt, because it is. The key is the coin, so the key is what thieves are after.
Frequently asked
What is a private key in crypto?
A private key is a secret number that controls the crypto at an address. It signs the transactions that move your coins, which proves you authorized them. The matching public key and address can be shared to receive funds, but the private key must stay secret. Anyone who gets it can spend your balance.
What is the difference between a public key and a private key?
A public key is derived from the private key and can be shared freely, usually as the address you give out to receive crypto. The private key stays secret and signs your transactions. You can always make a public key from a private key, but you cannot work backward from the public key to the private one.
What happens if someone gets my private key?
They can move or spend every coin it controls, without your permission, and the transfer cannot be reversed. No support line or password reset exists for a stolen key. Never enter your private key or seed phrase on a website, and keep your backup offline and private.
Sources, and what is behind them
- Ethereum accounts: public and private keys, Ethereum FoundationDocumentation
- Bitcoin Developer Guide: wallets and keys, Bitcoin.orgDocumentation
- Public and private keys explained, TrezorVendor announcement