Skip to content
buybitcoinsmart

Glossary / Addresses & keys

Private key

Definition
A private key is the 256-bit secret number that authorizes spending from a bitcoin output; anyone who learns it can move the coins, and nobody can reissue it.

Ownership of bitcoin is possession of keys, not an entry in anyone's ledger. A key is a random number below roughly 1.16 times 10 to the 77th, which is why guessing one is no threat and generating one badly is. Modern wallets never show you keys: they derive every one from a 12 or 24 word backup phrase, and that phrase is what you protect.

How it works

A private key is 32 bytes, normally written as 64 hexadecimal characters, chosen at random from the range 1 up to just under the order of the secp256k1 curve. That order is 115,792,089,237,316,195,423,570,985,008,687,907,852,837,564,279,074,904,382,605,163,141,518,161,494,337, a 78-digit number. Essentially every 32-byte value is a valid key, which is what makes generation so simple and theft by brute force so hopeless.

Signing is the only thing the key does. To spend an output, your wallet produces a signature over the transaction using the key, and every node checks that signature against the public key the output demands. The signature proves the key exists without exposing it, so a confirmed spend publishes a signature and never the secret behind it. Bitcoin used ECDSA alone until Taproot; Schnorr signatures, specified in BIP-340, perform the same role for Taproot spends.

Randomness is where the real vulnerability sits. The keyspace cannot be searched, but it can be shrunk by bad software. In August 2013 the Bitcoin project issued a security advisory over a flaw in Android's random number generator that made keys on affected phones predictable, and coins were stolen as a direct result. Brain wallets, where the key came from a phrase a human invented, were emptied systematically once attackers began precomputing dictionaries. Both failures are about entropy, not about cryptography being broken.

Why this matters when you buy bitcoin

Buying on an exchange does not give you a key. It gives you a balance in the exchange's database, backed by coins the exchange holds under keys its own staff control. That is a perfectly normal arrangement while you are trading, and a bad one for savings. Mt. Gox froze withdrawals and entered bankruptcy proceedings in February 2014, and its creditors waited until July 2024 for the first repayments to arrive.

Withdrawing is the moment custody actually transfers. Your wallet derives a key from your seed, hands out the matching address, and once the exchange's transaction confirms, no company is between you and the coins. From that point the failure modes are yours: a lost backup, a photographed seed phrase, a phishing site that asks you to "validate" your wallet.

Three habits cover most of the risk. Generate keys on a device built for it, so the secret is created and used inside hardware that never exports it. Back up the recovery phrase on something that survives water and fire, and never as a photo or a cloud note. And treat any request for a key or a seed phrase as an attack, without exception, because no exchange, wallet vendor, or support agent has any use for one.

Where the key lives at each step of a first purchase

Follow a single purchase through and a private key moves in a very specific sequence. You send money to an exchange and buy: no key exists for you yet, just a ledger row. You paste in a withdrawal address: your wallet generated that address from a key derived from your seed, and the key has never left the device. The exchange broadcasts a transaction locking coins to your address: the key still has done nothing. Months later you decide to spend, and only then does the key produce its first signature, which the network verifies and records forever.

Two things follow from that sequence. A key can control coins for years before it is ever used, so a wallet that has "done nothing" is not idle or expired. And the transfer of ownership happened at withdrawal, not at purchase, which is why the withdrawal step is the one worth double-checking.

Private key vs seed phrase

A private key controls one set of coins; a seed phrase generates an entire wallet full of keys. The phrase is a human-readable encoding of the entropy behind a BIP-32 hierarchy: 12 words carry 128 bits, 24 words carry 256 bits, and from that root the wallet derives billions of keys along a derivation path. Restoring the phrase rebuilds every one of them. Restoring a single key rebuilds a single key, and any coins the wallet held elsewhere stay missing.

Private key vs Wallet Import Format

A private key is a number and Wallet Import Format is one way of writing it down. WIF wraps the same 32 bytes in a network byte, an optional compression flag, and a checksum, then encodes the lot in Base58. Nothing about the underlying secret changes, so a WIF string deserves exactly the protection the raw number does: whoever reads it can spend the coins immediately.

Not to be confused with

Frequently asked questions

Could someone guess my private key?

Not by searching. There are about 1.16 times 10 to the 77th possible keys, so brute force is out of reach of any computer that could ever be built. Keys are stolen because they were generated with weak randomness or copied off a device, never because someone found them by luck.

Does my exchange hold my private keys?

Yes, unless you have withdrawn. An exchange balance is a claim on coins the exchange controls with its own keys, which is why a failure or freeze at the exchange affects your coins. Withdrawing to a wallet you control is what transfers the keys to you.

What happens if I lose my private key?

The coins stay visible on the blockchain forever and become permanently unspendable. There is no reset, no recovery desk, and no authority that can reassign them, which is why the backup of your recovery phrase is the single most important thing you own.

Should I ever type my private key into a website?

No, under any circumstances. Legitimate wallets, exchanges and support staff never need it, and every site that asks for one is stealing coins. Import or sweep a key only inside wallet software running on a device you control.

Read next

Related terms

More in Addresses & keys