Public and Private Keys in Plain Terms

Public and private keys explained: how ECDSA asymmetric cryptography secures every Bitcoin and Ethereum transaction

TECH & NETWORKS5 min readBy AlgoSys Editorial TeamPublished Apr 25, 2026Updated Jun 26, 2026
Contents

Public and private keys are the foundation of asymmetric cryptography, a system where encryption and verification are done with different but mathematically linked keys. This technology is what lets you prove that assets belong to you and authorize a transaction without revealing anything in the process. It underpins the operation of every modern public blockchain, including Bitcoin and Ethereum.

The idea of public-key cryptography appeared as far back as the 1970s, and practical implementations spread widely in the late 1990s and early 2000s. With the arrival of cryptocurrencies, starting with Bitcoin in 2009, this key pair overturned the notion of digital ownership: assets could now be held and transferred without a bank as intermediary. Today, that same cryptographic pair defines the security model of virtually every cryptocurrency and Web3 application.

The core problem these keys solve is this: how do you reliably prove identity and authorize a transfer of funds in a decentralized environment with no central authority running the show? The answer is that only the person holding the private key controls the funds, and no central body is needed for that.

MECHANICS

A private key (private key) is a large, randomly generated number that the owner keeps secret. The wallet uses this number to sign every transaction you initiate. The signature mathematically proves that the operation was authorized by the holder of the private key, and it is impossible to forge without knowing the key.

A public key (public key) is derived from the private key through a one-way cryptographic function, for example ECDSA (Elliptic Curve Digital Signature Algorithm), which Ethereum uses. The word "one-way" is key here: computing the public key from the private key is easy, but recovering the private key from the public key is computationally impossible. That is why you can share your public key freely; its only purpose is to let anyone verify a signature made by the corresponding private key.

The process itself looks like this. You initiate a transfer, the wallet takes your private key and uses it to sign the transaction data. That signature goes out to the network alongside the transaction itself. Validators or network nodes take your public key and check whether the signature matches. If the signature is valid, the transaction is recognized as legitimate and goes through for processing.

KEY COMPONENTS

For the system to work, several connected elements must be in place:

  • Private key: a secret number used to generate signatures and control access to assets.
  • Public key: a mathematically derived key that can be shared; it is used to verify signatures.
  • Digital signature: a cryptographic proof created with the private key, confirming the authenticity of a transaction.
  • Wallet software: applications like MetaMask or Phantom that store private keys and handle signing.
  • Blockchain network: the distributed ledger (such as Ethereum or Solana) where transactions are verified and recorded.
  • Cryptographic algorithms: protocols like ECDSA or EdDSA that govern key and signature generation and verification.
  • Seed phrase: a human-readable mnemonic of 12 or 24 words from which the private key can be recovered.

APPLICATIONS

No cryptocurrency transaction happens without a key pair: it is what lets you send and receive assets like BTC or ETH. Every time you authorize a transfer or call a smart contract on networks like Arbitrum or Optimism, your private key signs the operation.

In decentralized finance (DeFi), these keys provide secure access to lending protocols, decentralized exchanges (DEXs), and yield farming tools. To work with Uniswap or Aave, for example, you sign a transaction with your private key: that is how you approve a trade or deposit liquidity.

The same applies to non-fungible tokens (NFTs). Owning an NFT on a platform like OpenSea means controlling the private key of the wallet holding that digital collectible, and that control alone gives you the right to transfer or sell it.

To make the abstraction concrete, think of a key pair as a safe-deposit box with a transparent door. The public key (the box number) can be shown to anyone: with it, anyone can see what is inside and deposit money for you. The private key (the physical key to the door) is yours alone, and it is the only thing that lets you take the contents out. If someone learns your box number, they cannot do any harm; if they get hold of your physical key, access to the contents is lost. The difference is that in blockchain there is no bank employee who can give you a duplicate: the key to the box exists in exactly one copy.

TRADE-OFFS

The primary trade-off of asymmetric cryptography is complete and unconditional responsibility for keeping the private key safe. Lose the key or have it stolen, and the assets tied to it are gone for good. That is a serious risk compared to traditional finance, where an intermediary can help with access recovery.

It is worth comparing the system with traditional finance across several dimensions, so you can see clearly what you gain and what you give up.

Property Blockchain keys Bank intermediary
Control over funds With the private key holder alone With the bank managing the account
Access recovery Impossible if key is lost Password reset via support
Intermediary required No, access is decentralized Yes, the bank confirms operations
Cost of a mistake Irreversible loss of assets Usually reversible

The system is robust but not free: generating keys and signatures requires computation, and that affects transaction speed and cost, especially when the network is congested. Newer solutions such as EIP-4337 (Account Abstraction) on Ethereum are designed precisely to smooth out these inconveniences, making key management more flexible and allowing transactions to be bundled into batches.

Alternative cryptographic methods exist, but asymmetric cryptography based on public and private keys remains the dominant security standard in blockchain. It holds that position because of a fortunate balance of three properties: strong protection, efficiency, and the ability to decentralize.

FAQ

What is the difference between a public key and a private key?

A private key is a secret number you use to create digital signatures and control access to your crypto assets. A public key is derived from your private key and can be shared openly: others use it to verify your signatures and to send you funds.

How are public and private keys generated?

Keys are typically created by cryptographic algorithms like ECDSA. A private key is first generated as a large random number, and then a public key is mathematically derived from it using a one-way function. The reverse path, from public key back to private key, is computationally impossible.

What happens if I lose my private key?

Losing your private key means permanently losing access to all the crypto assets tied to it. There is no recovery mechanism, because the system is decentralized and trustless. There is no central authority that can reset or restore your key.

Is it safe to share my public key?

Yes, that is exactly what it is for. Others use your public key to send you funds and verify your signatures, but the private key cannot be recovered from it. The only real danger comes from exposing your private key or seed phrase.

What is a seed phrase and how is it related to keys?

A seed phrase is a human-readable mnemonic phrase of 12 or 24 words from which your private key can be recovered. It is effectively equivalent to the key itself, so you must protect it just as carefully: anyone who learns the phrase gains full control over your assets.

Why is it impossible to compute the private key from the public key?

The public key is derived from the private key through a one-way cryptographic function, such as elliptic curves in ECDSA. Computing the public key from the private key is straightforward, but reversing the operation would require a brute-force search beyond the reach of any modern computer, so the relationship works in one direction only.

Put this to work in the terminal

Live charts, derivatives, on-chain and macro data, free.

Open terminal →