Public Keys and Private Keys Explained: What They Are and Why the Private Key Must Stay Private

Every crypto wallet is built on a pair of keys. The private key is a secret number that only you hold. It is what signs your transactions β€” it proves you are allowed to move the funds. The public key is derived from the private key by one-way mathematics: anyone can compute the public key from the private key, but nobody can run the calculation backwards to recover the private key. The public key is used to verify your signatures, and your address β€” the string you give people so they can send you funds β€” is derived from the public key.

That one-way relationship is the whole security model. If the private key leaks, whoever has it can sign transactions as you, and there is no way to change the key or undo what they do. If the public key or the address leaks, nothing is lost: they were designed to be public. Confusing the two is the most common beginner mistake in crypto security, and this guide exists to make the distinction permanent.

If you are new to wallets, our [beginner’s guide to crypto wallets](https://webiii3.com/crypto-wallet-beginner-guide/) explains what a wallet holds and why keys matter. [Blockchain 101](https://webiii3.com/blockchain-101-guide/) covers the ledger those keys operate on. This article answers one question in depth: what the two keys are, how they relate to each other and to your address, and why the private one must never be shared.

## The pair, in plain language

Think of the key pair the way you would think of a mailbox with a locked drop slot. Anyone can find your mailbox β€” the address is public β€” and anyone can drop a letter in. Only the person with the mailbox key can open it and take letters out. In crypto, the public key is the mailbox: it tells the world where to send things and lets anyone check that a signature is genuine. The private key is the mailbox key: it opens the box, and only the holder can use it.

The analogy is useful but imperfect in one important way: a physical mailbox key can be copied by a locksmith, and a stolen mailbox key can be replaced by changing the lock. A private key cannot be replaced. The U.S. Securities and Exchange Commission’s investor-education office states this in its custody bulletin: once a private key is created, it cannot be changed or replaced, and if you lose it, you permanently lose access to the assets in your wallet. The same bulletin explains the wallet’s role: a wallet does not store your crypto assets themselves; it stores the private keys that authorize moving them.

The rule, as NIST puts it in the Digital Signature Standard (FIPS 186-5, published February 2023), fits on one line: “Public keys may be known by the public; private keys must be kept secret. Anyone can verify the signature by employing the signatory’s public key. Only the user that possesses the private key can perform signature generation.” The standard adds that the security of the whole system depends on keeping the signer’s private key secret.

## What the private key is

A private key is a randomly generated secret number. In Bitcoin, it is a 256-bit number β€” a number so large that guessing it is not a realistic attack. The Bitcoin developer documentation states it plainly: a private key in standard form is simply a 256-bit number, and the range is governed by the secp256k1 elliptic-curve standard Bitcoin uses. On Ethereum, a private key is 64 hexadecimal characters, which is the same 256 bits written in a different form.

You will almost never see a raw private key. Wallets show it to you in friendlier forms: as a recovery phrase of 12 or 24 words that encodes the starting point for all your keys, or as a long string of characters when you export a single key. But whatever the display format, the underlying object is the same β€” a secret number that only you should hold.

Three properties of the private key matter for everything that follows:

1. **It is generated at random.** You do not choose it, and nobody else knows it. The randomness is what makes it unguessable.
2. **It is the only thing that can sign.** A transaction signed with your private key is proof, to the whole network, that the holder of the key authorized it. Without the key, no valid signature can be produced.
3. **It cannot be changed.** If it is exposed, you cannot rotate it the way you rotate a password. Your only remedy is to move your funds to a new wallet with a new key, and stop using the old one.

That third point is why the recovery phrase matters so much. The phrase is the backup of the keys: it can rebuild them if the wallet is lost. It must be guarded with exactly the same care as the private key itself, because it is functionally the same secret in a different form.

## What the public key is, and how it is made

The public key is computed from the private key using elliptic-curve mathematics. In Bitcoin’s case, the private key is a large integer, and the public key is a point on the secp256k1 elliptic curve, produced by multiplying a fixed starting point on the curve by the private key. The Bitcoin developer documentation writes the relationship as a simple equation: point(private key) equals public key. The computation runs in one direction only. Given the private key, anyone can compute the public key. Given the public key, recovering the private key would mean solving the discrete logarithm problem on that curve β€” a task that is computationally infeasible with current technology.

On Ethereum, the same idea holds with different details: the public key is generated from the private key using the Elliptic Curve Digital Signature Algorithm (ECDSA), and Ethereum’s own documentation states the key fact plainly β€” “it is possible to derive new public keys from your private key, but you cannot derive a private key from public keys.”

The public key is, by design, shareable. It is used to verify signatures, not to create them. Knowing someone’s public key tells you nothing that lets you spend their funds. In practice, you will rarely see a raw public key either: wallets keep it in the background and show you the address instead, which is derived from it.

## The address: a shorter, safer form of the public key

Your address is what you actually share with people who want to send you crypto. It is derived from the public key by hashing β€” running it through one-way hash functions and encoding the result as a short string. For a classic Bitcoin address, the public key is hashed with SHA-256 and then RIPEMD-160, producing a 20-byte value that is encoded with a built-in typo check. On Ethereum, the address is the last 20 bytes of the Keccak-256 hash of the public key, written as 42 characters: `0x` followed by 40 hexadecimal characters.

The chain runs one way only:

**private key β†’ public key β†’ address**

Each arrow is easy to compute forward and infeasible to reverse. You cannot rebuild a public key from an address, and you certainly cannot rebuild a private key from either. That is why an address is safe to post publicly, print on an invoice, or share in a chat: it identifies where funds should go, and it reveals nothing that can move them.

Two practical consequences follow. First, an address is not anonymous. Anyone who has your address can look up every transaction that ever touched it on the public blockchain β€” the ledger is open by design, as [how blockchain works](https://webiii3.com/how-blockchain-works/) explains. Sharing an address is safe; assuming it hides your activity is not. Second, an address is not the same as a public key. The address is a hashed, shortened form of it. Do not use the terms interchangeably, and do not paste a public key where an address is expected, or the other way around.

There is one more distinction worth knowing: not every address is backed by a key pair. On Ethereum, a contract account also has an address, but it has no private key β€” it is controlled by the logic of the smart contract code. Our [beginner’s guide to smart contracts](https://webiii3.com/what-is-a-smart-contract-beginner-guide/) explains what those accounts are. If you send funds to a contract address, no person holds a key that can send them back.

## What a signature does: proving ownership without revealing the secret

So far the keys have been abstract. Here is where they do their work. When you send crypto, your wallet uses your private key to produce a digital signature over that exact transaction β€” the destination, the amount, and the other details, all bundled together. That signature is attached to the transaction and broadcast to the network.

Every node on the network can then check the signature against your public key. If the signature matches, the network knows the transaction was authorized by the holder of the private key β€” without ever seeing the private key itself. The signature proves possession of the secret while keeping the secret hidden. That is the trick that makes public-key cryptography work for money: proof without disclosure.

A signature is bound to one specific transaction. Change any detail β€” the amount, the destination, the fee β€” and the signature no longer matches. It cannot be lifted from one transaction and reused on another. And it cannot be forged: producing a valid signature requires the private key, and verifying one requires only the public key. This is why the network’s record-keepers can validate your transaction without trusting you and without knowing your secret. Our [comparison of proof of work and proof of stake](https://webiii3.com/proof-of-work-vs-proof-of-stake/) explains who those record-keepers are and how they reach agreement on which transactions count.

The same mechanism is what lets you interact with smart contracts and decentralized applications. When a contract asks you to sign, you are using your private key to authorize a specific action β€” a token approval, a swap, a vote. Read what you are signing before you confirm it, because a signature is an authorization, and authorizations on a blockchain are generally irreversible.

## The five mistakes that expose a private key

Most private keys are not stolen by breaking the mathematics. They are stolen because someone was tricked into handing them over, or into typing them somewhere unsafe. The five mistakes below cover nearly all of it.

**1. Sharing the key or the recovery phrase with anyone.** No legitimate person or service needs your private key. Wallet support will never ask for it. Neither will an exchange, a developer, a “validator,” or a person offering to help you in a chat. Anyone who asks is trying to steal your funds. The recovery phrase is the same secret in another form: sharing it is sharing the key.

**2. Typing the key or phrase into a website.** A page that asks you to enter a private key or recovery phrase to “verify,” “synchronize,” “unlock,” or “secure” your wallet is a phishing page. The only legitimate place to enter a recovery phrase is the official wallet app, when you are deliberately restoring a wallet you created.

**3. Storing the key digitally.** A screenshot, a photo, a note in a cloud-synced app, an email to yourself, a file on a shared drive β€” anything reachable from the internet can be reached by an attacker who compromises that account. Keys and phrases belong offline, on paper or metal, in a physically safe place.

**4. Importing a key on a device you do not trust.** A public computer, a borrowed phone, or a device with unknown software can record what you type or copy what you paste. Only enter a private key on your own device, in the official wallet software.

**5. Signing something you have not read.** A signature request is an authorization. If a site asks you to sign a message or a transaction you do not understand, stop. The device screen of a hardware wallet shows you what you are signing before you confirm; read it. Blind-signing β€” approving without reading β€” is how people authorize transfers they never intended.

If any of these has already happened β€” if a key or phrase may have been exposed β€” the remedy is the same as for a lost phrase: create a new wallet, back up its new phrase properly, move all funds to the new wallet, and stop using the old one. Do it promptly, because there is no way to know whether someone has already copied the secret.

## A table to keep

| Item | What it is | Who can see it | What happens if it leaks |
|—|—|—|—|
| Private key | A 256-bit secret number; signs transactions | Only you β€” and usually only your wallet software | Whoever has it can move your funds; the key cannot be changed |
| Recovery phrase | 12 or 24 words that rebuild all keys in the wallet | Only you | Same as the private key: full control of the wallet |
| Public key | Derived from the private key by one-way math; verifies signatures | Anyone | Nothing β€” it was designed to be public |
| Address | A hashed, shortened form of the public key | Anyone you give it to, and everyone on the blockchain | Nothing to your funds β€” but your transaction history is visible |

The first two rows are secrets. The last two are public. If you remember nothing else from this guide, remember which rows are which.

## Why this matters beyond crypto

Public-key cryptography is not a crypto invention. It is the same family of mathematics that secures web browsing, software updates, and digital identity β€” the reason NIST maintains a Digital Signature Standard at all. What crypto does differently is put the keys directly in the user’s hands, with no company in the middle to reset them. That is the point of self-custody, and it is also the risk: the same design that removes the intermediary removes the safety net.

That is why the rule is absolute, not a guideline. The private key stays private. Not “private except for support,” not “private except when a website asks nicely,” not “private except in an emergency.” Private. The public key and the address do the public work β€” receiving funds, proving signatures, identifying your account. Let them. The private key has exactly one job, signing, and it does that job best when nobody but you, and your wallet software, ever sees it.

For the terms used here, see the [blockchain glossary](https://webiii3.com/blockchain-glossary). For how keys fit into the wider security picture β€” phishing, fake support, malicious approvals β€” see our guide to [Web3 cybersecurity and protecting your digital assets](https://webiii3.com/web3-cybersecurity-protecting-digital-assets/).

**Sources and update time.** This article was written from official public sources checked on November 18, 2026: Bitcoin developer documentation, “Wallets” (private keys as 256-bit numbers; public keys as points on the secp256k1 curve; hierarchical deterministic key derivation, point(private key) = public key; root seed as the only data needed to back up a wallet), https://developer.bitcoin.org/devguide/wallets.html; Ethereum.org, “Ethereum accounts” (private key of 64 hex characters; public key generated from the private key using ECDSA; address as the last 20 bytes of the Keccak-256 hash of the public key with a 0x prefix; a private key cannot be derived from public keys; contract accounts have no private keys), https://ethereum.org/developers/docs/accounts/; National Institute of Standards and Technology, FIPS 186-5, Digital Signature Standard (published February 3, 2023) β€” “Public keys may be known by the public; private keys must be kept secret” β€” https://doi.org/10.6028/nist.fips.186-5; U.S. Securities and Exchange Commission, Office of Investor Education and Advocacy, “Crypto Asset Custody Basics for Retail Investors” (Investor Bulletin, December 12, 2025), https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins/crypto-asset-custody-basics-retail-investors-investor-bulletin-0. The Bitcoin address construction (SHA-256 followed by RIPEMD-160, producing a 20-byte hash) follows the Bitcoin developer documentation. This article is general educational information, not advice about any specific wallet or transaction.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *