Book a free call

Public and Private Keys: How Crypto Wallets Work

A crypto wallet holds two keys: a public key you can share and a private key you must never share. Here is how the pair works and what a seed phrase does.

Hertiv engineering teamReviewed by a senior engineer
6 min read
Public and Private Keys: How Crypto Wallets Work
On this page

Short answer

A crypto wallet is a pair of keys. The public key, or the address derived from it, is what you share so others can send you funds. The private key signs transactions and proves you control those funds. Anyone with the private key can spend them, so the whole job of a wallet is to generate the pair safely, keep the private key secret and back it up.

What are public and private keys?

A public key and a private key are a matched pair of long numbers linked by cryptography: anything locked with one key can only be opened with the other. Your wallet generates the pair when you set it up, and the pair is what proves you own the funds tied to it.

The public key is the half you can share. The private key is the half you must never share, because anyone who has it can spend your funds. That single rule explains most of wallet security: the whole job of a wallet is to keep the private key secret while making the public key easy to use.

Keys are not accounts and not passwords. There is no company holding your funds and no reset button, so losing the private key means losing access, and sharing it means giving away control.

How does a public key become an address?

A wallet turns the public key into an address by running it through a one-way hash, which shrinks it into a short string of letters and numbers. The address is a fingerprint of the public key: you can share it freely, and nobody can work backwards from it to find the private key.

This is why your wallet can show a different address each time you receive funds. It derives a fresh address from the same keys, which keeps your activity harder to link together, while all the addresses still belong to the same wallet. The private key never changes, and neither does your control.

Key or itemShare it?What it does
Public keyYesLets others send you funds
AddressYesShort form of the public key
Private keyNeverSigns transactions and proves ownership
Seed phraseNeverRecreates all your keys

The features worth checking are in crypto wallet features.

How does a private key sign a transaction?

Signing is how you prove you own funds without revealing the private key. When you send crypto, your wallet uses the private key to create a unique signature for that transaction, and the network checks the signature against your public key. If they match, the transaction goes through; if not, it is rejected.

The signature is tied to the exact details of the transaction, so changing the amount or the recipient breaks it. That is why a signed transaction cannot be edited in transit: anyone who alters it invalidates the proof. The private key itself never leaves the wallet during signing, which is the point of the whole design.

Hardware wallets take this further by signing inside the device, so the private key never touches an internet-connected computer at all.

What is a seed phrase, and how does it relate to the keys?

A seed phrase is a list of 12 or 24 ordinary words that your wallet uses to recreate every key it holds. The words are generated from a large list, and their order matters: the phrase is a human-readable form of the master secret from which all your private keys are derived.

Anyone with the seed phrase can rebuild your wallet on another device and spend everything in it, so it needs the same protection as the private key itself. Keep it on paper or metal, stored in more than one safe place, and never type it into a website, a chat or a cloud note.

A seed phrase is not a password and cannot be changed. If it is exposed, the only safe move is to create a new wallet with a new phrase and move your funds before someone else does.

Custodial or non-custodial: who holds the private key?

In a non-custodial wallet, you hold the private key and nobody else can move your funds. In a custodial wallet, a company such as an exchange holds the key for you, and you access your funds through its account system. The trade-off is control against convenience: self-custody means no one can freeze your funds, but no one can recover them either.

Most beginners start custodial because it feels like a bank account, with password resets and support. Serious holders often move to non-custodial wallets once the amounts matter, because the history of exchanges shows that a company holding your keys can fail, freeze withdrawals or be hacked. Neither choice is wrong; the mistake is not knowing which one you picked.

The full comparison is in custodial vs non-custodial wallets.

How do you back up and protect a private key?

Back up the seed phrase, not the private key itself, because the phrase recreates everything. Follow these steps before you put serious funds in a wallet.

  1. Write the seed phrase on paper or metal, by hand, and check every word twice.
  2. Store copies in two separate safe places, so one fire or flood cannot take both.
  3. Never photograph the phrase, email it, or save it in a cloud note.
  4. Never type it into a website, an app you did not install yourself, or a support chat.
  5. Test the backup by restoring the wallet on a second device before you fund it.
  6. For larger amounts, move the keys to a hardware wallet and keep the phrase offline.

If a step feels slow, that is the point: a backup you can undo in seconds is a backup a thief can use too. Teams building wallets can start with crypto wallet development.

Example: restoring a wallet from its seed phrase

Example (hypothetical): a user holds funds at three addresses from one wallet: 0.4 units at the first, 0.3 at the second and 0.3 at the third, a total of 1.0 units. The phone is lost, so the wallet is gone, but the seed phrase is written on paper at home.

On a new phone, the user enters the same 12 words in the same order. The wallet recreates the same keys, derives the same three addresses, and shows the same balances: 0.4 plus 0.3 plus 0.3 equals 1.0 units. Nothing was stored on the lost phone except the keys, and the phrase rebuilt them all.

The lesson is that the phrase is the wallet. Guard the phrase and the funds follow; lose the phrase and no support team can bring them back.

What are the common mistakes?

Most key losses are not hacks. They are ordinary mistakes: a phrase photographed and synced to the cloud, a private key pasted into a fake support chat, or a backup that was never tested. Treat the phrase like the cash in a safe, not like a password you can reset.

  • Sharing the private key or seed phrase with anyone, including support staff
  • Storing the phrase in a photo, email or cloud note
  • Typing the phrase into a website or app you did not install yourself
  • Keeping large amounts in a hot wallet connected to the internet
  • Never testing the backup until the day you need it
  • Using the same password for the wallet app and your email

If you are setting up a first wallet, how to create a crypto wallet walks through the safe setup step by step.

Key takeaways

  • The public key receives funds; the private key spends them.
  • Share the address freely, and never share the private key or seed phrase.
  • A seed phrase recreates every key in the wallet, so it is the real backup.
  • Signing proves ownership without revealing the private key.
  • Custodial wallets trade control for recovery; self-custody is the reverse.

Frequently asked questions

Can someone steal my crypto with my public key?

No. A public key, or the address derived from it, can only receive funds. It cannot sign a transaction, so it cannot move anything. You can share it freely. The danger is the private key or the seed phrase: anyone with those can spend everything the wallet holds.

What happens if I lose my private key?

You lose access to the funds tied to it, unless you still have the seed phrase. The phrase recreates the keys, so it is the real backup. Without either the key or the phrase, no company and no support team can recover the funds, because there is no central account to reset.

Is a seed phrase the same as a private key?

No, but it is closely linked. A seed phrase is a list of words that recreates all the private keys in a wallet, while a single private key controls one address. Losing either one is serious, but losing the phrase is worse, because it gives away every key the wallet holds.

Can I change my private key?

Not directly. A private key is generated once, and changing it would mean changing the address it controls. What you can do is create a new wallet with a new key and a new seed phrase, then move your funds to the new address. Treat an exposed key as compromised and move quickly.

Why does my wallet show a different address each time?

Most wallets derive a fresh address from the same keys for each payment. It makes your activity harder to link together, which protects your privacy. All the addresses belong to the same wallet, so funds sent to any of them land in the same place and are controlled by the same private key.

Is a custodial wallet safer than holding my own keys?

It depends on what you fear more. A custodial wallet offers password resets and support, but the company can freeze funds, fail or be hacked. Holding your own keys removes that risk but leaves you with no recovery if you lose the phrase. Many people split funds between the two.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a crypto wallet?

A senior engineer replies within one business day. Or see our Crypto Wallet service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call