Skip to main content
What Is A Public Key?

What Is A Public Key?

Your wallet computes a public key from your private key in one direction only, so the key and the address made from it can be shared without exposing the secret that signs for your coins.

Level
Beginner
Reading time
8 min
Last updated
Digital public key connected across a blockchain network illustrating how public key cryptography secures cryptocurrency transactions and wallets

Overview

Introduction

A public key is the shareable half of a crypto key pair. Bitcoin and Ethereum compute it from a 256-bit private key on an elliptic curve called secp256k1. Every node on the network then uses it to confirm that a transaction's signature came from the matching private key.

You'll rarely see one. Wallet apps show an address built from the public key, and the key itself usually surfaces only once you sign. Handing it out can't move your funds, though it can tie your payments to each other.

What Is a Public Key?

Public and private keys come as a matched pair, a setup called asymmetric cryptography. The private key produces a digital signature over a transaction, and the public key lets anyone check that signature without learning the key that made it. Neither key can do the other's job, so a public key can confirm a payment but never authorize one.

In practice, a receive address, built from the public key, is safe to hand to anyone who pays you. The private key and the seed phrase that backs it up stay with you, because either one can sign.

How Public Keys Prove Ownership

Owning coins on a blockchain means holding the private key that can sign for them, and that only works because the two keys are linked in one direction. A wallet multiplies a fixed point on the curve, the generator point G, by the private key to get the public key, then hashes the public key into an address. Each step is quick for any computer.

Going backward is computationally infeasible, because it would mean solving the elliptic curve discrete logarithm problem or inverting a hash function. Ethereum.org's developer docs state that a private key can't be derived from public keys.

A private key is 32 bytes. Its public key takes 33 bytes in compressed form or 65 uncompressed, and a bc1q Bitcoin address or an Ethereum address holds just 20 bytes taken from a hash of that key.

Private key 1, the smallest valid value, makes the chain easy to follow, because multiplying G by 1 returns G itself, the point printed in the Standards for Efficient Cryptography Group's SEC 2 standard. Anyone can repeat every step from there and take coins sent to its addresses.

From private key 1 to a public key and two addresses, one way only

Private key 1, a public teaching key, worked through secp256k1 to its public key G and on to a Bitcoin and an Ethereum address, with the byte size at each step.

Each step from private key to public key to address is quick to compute and infeasible to reverse, so sharing a public key or address never exposes the private key.

Private key 1 is a teaching value that anyone can compute, so its addresses must never hold funds. Bitcoin is shown with a native SegWit address only, and other address types encode the key differently. Solana uses Ed25519 and no hash, so it is not drawn.

Public Key vs. Private Key vs. Address

Each of the three is made from the one before it, so a wallet that stores only the private key can recompute the other two whenever it needs them.

Private keyPublic keyAddress
JobSigns transactionsVerifies signaturesReceives funds
Made fromRandom data or a seed phraseThe private keyThe public key, usually hashed
Seen byOnly youAnyone, once it's on-chainAnyone you share it with
Can signYesNoNo

An address adds network formatting on top of the hash, such as a version byte or a checksum that catches typos, and wallet address formats differ from chain to chain.

How Wallets Generate and Use Public Keys

Wallets don't make you manage keys one by one. You back up a seed phrase, and the wallet regenerates every private key, public key, and address from it.

Hierarchical deterministic (HD) derivation, defined in Bitcoin Improvement Proposal (BIP) 32, grows a tree of child keys from one root seed, with branches for each account and address. A new receive address needs no new backup, because the seed phrase already covers the whole tree. From backup to address, the path goes in this order.

  1. Seed phrase. Restores the root key material.
  2. Master private key. The top of the tree, derived from the seed.
  3. Child private keys. Sign for individual accounts or addresses.
  4. Child public keys. Let nodes verify those signatures.
  5. Addresses. The receive destinations you see, formatted for each network.

BIP 32 also defines an extended public key, or xpub, a 111-character string beginning with xpub. It holds a public key plus extra data called a chain code. From it, software can list the addresses in that branch without being able to sign, which is how watch-only apps and accounting tools track an account.

Hot wallets and hardware wallets build the same key tree. A hot wallet signs on your phone or computer. A hardware wallet signs on the device and shows the address on its own screen before you confirm, a difference to consider when you compare crypto wallets.

What Happens When You Receive or Send Crypto

Receiving involves no key on your side at all. You hand over an address, the sender builds and signs a transaction with their own key, and the coins stay at your address until you move them.

When you send, your wallet builds the transaction, signs it on your device with the private key, and broadcasts the signed result. Every node that relays or confirms it checks the signature against your public key and drops the transaction if the signature fails, or if the fee, format, or balance is wrong.

Bitcoin's pay-to-public-key-hash (P2PKH) outputs make that check in two steps. The output holds only a hash of your public key, so the spending transaction supplies the full key along with the signature. Nodes hash the supplied key to confirm it matches, and the OP_CHECKSIG operation then tests the signature against it.

Why Public Keys Are Safe to Share, and What They Still Reveal

A public key can't sign, so sharing one puts no coins at risk. Privacy works differently, because every payment to an address is recorded on a public ledger.

Reuse one address for many payments, and anyone with a block explorer can total what it received and follow where the coins went next. Tie that address to a name through a social post, a profile, or an exchange withdrawal, and the whole history attaches to you. The Bitcoin developer guide warns that reusing a public key lets others track a person's receiving and spending habits, and it asks wallet builders to discourage address reuse.

A few other habits tie more of your activity to you.

  • Giving an xpub to an app that only needs a single address
  • Sharing screenshots that show balances or full addresses
  • Mixing exchange deposit addresses and personal wallet addresses under one identity

A fresh address for every payment breaks the link between payments, and wallets designed for anonymity aim to limit what the rest of your activity reveals.

Public Keys Across Bitcoin, Ethereum, and Solana

Converting raw key data into an address by hand is easy to get wrong, so use the address your wallet generates for each network.

Each network below is paired with its key type and the way its address comes from the key.

Bitcoin

secp256k1 key, hashed to 20 bytes for pre-Taproot single-key addresses

Ethereum

secp256k1 key, with the address taken from the last 20 bytes of its Keccak-256 hash

Solana

Ed25519 key, used directly as the 32-byte address in base58

Bitcoin's hashed address types keep the public key off the chain until the first spend from that address, when the spending transaction reveals it. Taproot addresses, which start with bc1p, work differently. Under BIP 341 the output holds a 32-byte public key, a tweaked form of the wallet's own key, which puts a public key on-chain from the moment coins arrive.

Ethereum transactions don't include the public key at all. Nodes recover it from the signature, which means anyone can work out an account's public key once it has sent its first transaction. Wallets such as MetaMask show only the 0x address.

Anyone you give a Solana address to already has the account's public key, since there's no hash in between. Solana's account model also differs from Bitcoin's and Ethereum's, so check that a wallet supports it natively before you fund it, and compare the Solana wallets that do.

Public Key Risks Beginners Miss

Most of the risks below target the steps around the key, from your backup to the address you paste, and each is paired with the check that guards against it.

Phishing

Seed phrase and private key kept out of every website, chat, and form

Fake "public key" request

Address shared, and any form asking for a key or phrase closed

Clipboard malware

Full address compared after every paste

Wrong network

Asset and chain matched to the recipient’s instructions

Xpub exposure

Xpub shared only with watch-only or accounting tools

Address reuse

A fresh receive address for each payment

Quantum computing

Long-term upgrade plans, kept apart from claims of instant theft

Phishing pages and fake support agents ask for the seed phrase or private key directly. No wallet app, exchange, or support team needs either one, and any prompt that asks for them in a form, chat window, or browser pop-up is an attack.

Fake “public key” requests play the same trick under a safer-sounding name. A message claims your wallet needs verifying or syncing and asks for your key, and the form that opens then wants the recovery phrase. Looking up any wallet's balance or history takes only its address, so a request for anything more is a scam.

Clipboard malware, also called clipboard hijacking, swaps a copied address for an attacker's. Compare the pasted address with the original, middle characters included, before you confirm, even on a device you trust.

Wrong-network sends happen because one address format can be valid on several chains. ETH sent to your Ethereum address over BNB Smart Chain lands on a different network and may need extra steps to recover, so confirm the chain alongside the address.

Quantum computing is a longer-term question. The U.S. National Institute of Standards and Technology (NIST) finalized its first three post-quantum cryptography standards on Aug. 13, 2024, two of them for digital signatures, and says a sufficiently capable quantum computer could defeat current encryption. BIP 341, the Taproot proposal, calls the protection a hashed public key offers against such attacks “very weak at best.” Estimates of when such a machine might exist vary, so treat any message urging you to move coins now because of quantum risk with the same suspicion as other urgent requests.

How to Check and Protect Your Key Setup

With a custodial wallet, such as an account at a centralized exchange, the provider holds the private keys, and your withdrawals depend on its policies and security. With a self-custodial wallet, you hold the seed phrase and the keys, so backup and security fall to you, and no one else can freeze or move the funds.

Before you move a meaningful amount, check each of these.

  • Wallet type. Custodial or self-custodial, hot or cold.
  • Receive address. The network, plus characters from the start, middle, and end, before you share it.
  • Hardware display. The address on the device's own screen before you sign, as on the Trezor Safe 5.
  • Seed backup. The phrase on paper, stored offline and never typed into a website or app.
  • Small test. A small amount first, confirmed on arrival, then the full transfer.
  • Exchange account. The withdrawal process and two-factor authentication, if you use a centralized exchange.

An offline hardware wallet keeps signing off the phone or laptop you use every day, which suits a larger balance. If self-custody still feels like too much to manage, crypto exchanges for beginners hold the keys for you, along with the custody risk that comes with it.

FAQs

What is a public key in crypto?

It’s a point on an elliptic curve, which on Bitcoin and Ethereum has an x and a y coordinate. Bitcoin’s compressed form keeps only x plus a prefix byte, 02 or 03, that says which of the two possible y values applies, and the uncompressed form starts with 04 and holds both. The two forms describe the same key, yet each hashes to a different Bitcoin address, so a wallet has to use the form it gave out to find those payments.

Is a public key the same as a wallet address?

Not on Bitcoin’s 1… and bc1q… formats or on Ethereum, where the address comes from a hash of the key. A regular Solana account uses the public key itself as its address. Solana also has program-derived addresses, which are guaranteed to lie off the Ed25519 curve, so no private key exists for them, and only the program that derived one can sign for it.

Can someone steal my crypto if they have my public key?

No. Signing takes the private key, and the public key can only check signatures. The Bitcoin developer guide notes that today’s signature-comparison attacks work only when the signing software used too little randomness or leaked it, such as through a side-channel attack. That’s a flaw in the signing software, and well-built wallets avoid it.

Can a public key reveal a private key?

Not with any known method on ordinary computers, as long as the private key is random. A Bitcoin private key can be almost any 256-bit number, far too many values to search. A key a person picks, such as a small number or a memorable phrase, can be found by testing likely values, and private key 1 above is the extreme case. That’s why wallets generate keys for you.

What is an xpub and is it safe to share?

An xpub can’t sign or spend on its own. Still, BIP 32 warns that an xpub plus any one regular, non-hardened private key below it reveals the parent private key and every key in that branch. Keep an xpub apart from every private key in the same wallet.

Loading image…

The Catalyst

Know what’s moving crypto.