D CryptoHome
lang: zh en ja ko
Home Wiki Categories Download Download Register

What Are Public and Private Keys? How Is Cryptocurrency Security Ensured?

Download Binance APP to Start Trading

Android users can download APK directly without VPN.

Public and Private Keys Explained: The Foundation of Cryptocurrency Security

Public key cryptography is the cornerstone of blockchain and cryptocurrency security. In this system, every user holds a key pair — a private key and a public key. The private key is used to sign transactions and prove ownership of assets, while the public key is used to generate wallet addresses and verify signatures. Understanding how public and private keys work is the first step toward protecting your crypto assets.

1. Cryptography Fundamentals

1.1 Symmetric vs. Asymmetric Encryption

In cryptography, encryption falls into two broad categories:

Symmetric encryption: The same key is used for both encryption and decryption — AES is a classic example. It is fast, but distributing the key securely is a challenge: how do you safely hand the key to the other party?

Asymmetric encryption (public key cryptography): Uses a key pair — a public key and a private key. The public key can be shared openly; the private key must remain secret. Data encrypted with the public key can only be decrypted with the corresponding private key, and vice versa.

Blockchains primarily use asymmetric encryption for digital signatures rather than for encrypting data.

1.2 Elliptic Curve Cryptography (ECC)

Most blockchains use Elliptic Curve Cryptography to generate key pairs. Bitcoin and Ethereum both use the secp256k1 curve.

Core properties of ECC:

  • A public key can be computed one-way from a private key (mathematically straightforward)
  • A private key cannot be derived from a public key (computationally infeasible)
  • Compared to traditional algorithms like RSA, ECC provides equivalent security with much shorter key lengths

2. Private Keys

2.1 What Is a Private Key

A private key is a 256-bit (32-byte) random number, typically represented as 64 hexadecimal characters. For example:

e9873d79c6d87dc0fb6a5778633389f4453213303da61f20bd67fc233aa33262

The number of possible private keys is approximately 2^256 — an astronomical figure (roughly 10^77), exceeding the estimated number of atoms in the known universe. The probability of two people randomly generating the same private key is effectively zero.

2.2 Private Key Generation

The security of a private key depends entirely on its randomness. Reliable private key generation must use a Cryptographically Secure Pseudo-Random Number Generator (CSPRNG).

Secure generation methods:

  • Hardware wallets with true random number generators
  • Cryptographically secure random number APIs provided by the operating system
  • Audited wallet software

Insecure practices:

  • Using simple numbers or words as a private key
  • Using non-cryptographic random number generators
  • Generating keys on untrusted websites or environments

2.3 The Central Role of Private Keys

"Control your private key, control your assets" — this is the first law of cryptocurrency security.

  • Possessing the private key = complete control over all assets at the corresponding address
  • Private key leak = anyone who obtains it can transfer your assets
  • Private key loss = assets are permanently unrecoverable (no customer support, no recovery mechanism)

3. Public Keys and Addresses

3.1 From Private Key to Public Key

The public key is derived from the private key through elliptic curve multiplication:

Public Key = Private Key x G (the base point on the elliptic curve)

This operation is one-way:

  • Private key to Public key: simple computation (milliseconds)
  • Public key to Private key: computationally infeasible (even the most powerful computers would need an unimaginable amount of time)

3.2 From Public Key to Address

A wallet address is generated by hashing the public key, and is used to receive crypto assets.

Bitcoin address generation:

  1. Hash the public key with SHA-256
  2. Hash the result with RIPEMD-160
  3. Add a version prefix
  4. Compute a checksum (double SHA-256, take the first 4 bytes)
  5. Encode with Base58Check

Ethereum address generation:

  1. Hash the public key with Keccak-256
  2. Take the last 20 bytes (40 hexadecimal characters)
  3. Add the "0x" prefix
  4. Optionally apply the EIP-55 mixed-case checksum

3.3 The Key Derivation Chain

Mnemonic -> Seed -> Private Key -> Public Key -> Address
           (one-way derivation, irreversible)
Element Public or Private Role
Mnemonic Absolutely private Back up and restore all keys
Private key Absolutely private Sign transactions, control assets
Public key Can be public Verify signatures
Address Can be public Receive assets

4. Digital Signatures

4.1 How Signatures Work

Digital signatures are the most important application of private keys. When you initiate a cryptocurrency transaction:

  1. Create the transaction: Contains sender address, recipient address, amount, and other details.
  2. Hash the transaction: Hash the transaction data to produce a "digest."
  3. Sign with private key: Use the private key to sign the transaction digest, producing a digital signature.
  4. Broadcast the transaction: Broadcast both the transaction data and the signature to the network.
  5. Verify the signature: Network nodes use the sender's public key to verify the validity of the signature.

4.2 Properties of Digital Signatures

  • Authentication: Proves the transaction was genuinely initiated by the private key holder.
  • Tamper-resistance: If transaction data is modified, the signature becomes invalid.
  • Non-repudiation: The signer cannot deny having signed the transaction.
  • Private key never exposed: Verification requires only the public key; the private key is never revealed.

4.3 ECDSA and Schnorr Signatures

ECDSA (Elliptic Curve Digital Signature Algorithm): The signature algorithm originally used by Ethereum and Bitcoin. Each signing operation produces a different output (using a random nonce k), with signatures around 71-73 bytes in length.

Schnorr signatures: Introduced in Bitcoin's Taproot upgrade in 2021. Compared to ECDSA:

  • Supports signature aggregation (multiple signatures merged into one)
  • Linear properties make multisig schemes more efficient
  • Fixed signature length of 64 bytes

5. Mnemonic Phrases (BIP-39)

5.1 What Is a Mnemonic Phrase

A mnemonic phrase is a sequence of 12 or 24 English words — a human-readable backup form of a private key. The BIP-39 standard selects words from a predefined list of 2,048 English words.

Example (12-word mnemonic):

abandon ability able about above absent absorb abstract absurd abuse access accident

5.2 From Mnemonic to Keys

The BIP-39/BIP-32/BIP-44 standards define the hierarchical deterministic (HD) derivation path for generating multiple addresses from a mnemonic:

  1. Mnemonic to Seed: The mnemonic phrase plus an optional passphrase is passed through PBKDF2 to generate a 512-bit seed.
  2. Seed to Master key: The seed is processed through HMAC-SHA512 to generate a master private key and chain code.
  3. Master key to Child keys: A hierarchical derivation path (e.g., m/44'/60'/0'/0/0) generates an unlimited number of child key pairs.

This means:

  • A single mnemonic can manage multiple addresses across multiple chains
  • Backing up the mnemonic is sufficient to recover all derived keys and addresses

5.3 Passphrase (The 25th Word)

BIP-39 supports an optional passphrase as an additional security layer on top of the mnemonic:

  • Same mnemonic + different passphrase = a completely different set of keys
  • Even if the mnemonic is stolen, the assets remain inaccessible without the passphrase
  • However, if the passphrase is forgotten, the assets are equally unrecoverable

6. Key Security Threats

6.1 Common Attack Vectors

Attack Type Description Defense
Phishing Fake websites or support agents trick users into revealing their mnemonic or private key Never enter your mnemonic on any website
Malware Trojans steal keys stored on the device Use a hardware wallet to isolate private keys
Man-in-the-middle The recipient address in a transaction is tampered with Confirm addresses on the hardware wallet screen
Social engineering Fake officials request sensitive information No legitimate service will ever ask for your private key
Brute force Attempting all possible private key combinations The 256-bit key space makes brute force infeasible
Supply chain attacks Hardware devices pre-loaded with malicious firmware Purchase hardware wallets only from official channels

6.2 The Quantum Computing Threat

In theory, a sufficiently powerful quantum computer could derive a private key from a public key using Shor's algorithm. However, as of now:

  • Current quantum computers are far from reaching that threat level
  • The blockchain community is actively researching quantum-resistant signature algorithms
  • Bitcoin addresses use a hash function (making deriving the public key from the address equally infeasible), providing an extra layer of protection
  • Ethereum's roadmap includes planned upgrades for quantum resistance

7. Key Management Best Practices

7.1 Backup Strategy

  • Write your mnemonic on paper or a metal plate (not digital storage)
  • Store multiple backups in geographically distributed secure locations
  • Consider using Shamir's Secret Sharing to split and store the mnemonic in fragments
  • Inform a trusted family member where the backup is kept (for emergencies)

7.2 Storage Security

  • Use a hardware wallet for large holdings
  • Keep a hot wallet for daily use separate from a cold wallet for long-term storage
  • Periodically verify the integrity of your backups
  • Avoid managing large holdings and everyday browsing on the same device

7.3 Operational Security

  • Generate and use mnemonic phrases in a secure environment
  • Carefully verify the full destination address before any transfer
  • Understand and review the content of every transaction you authorize
  • Promptly revoke contract approvals you no longer need

8. The Evolution of Key Technology

8.1 Multi-Party Computation (MPC)

The private key is split into multiple fragments. Signing is completed through multi-party computation, so no single fragment can independently sign a transaction. This eliminates single points of failure.

8.2 Account Abstraction

Standards such as ERC-4337 allow smart contract logic to replace traditional private key signing, enabling more flexible security models such as social recovery and multi-factor authentication.

8.3 Post-Quantum Cryptography

The blockchain community is actively researching post-quantum cryptography schemes (such as lattice-based cryptography and hash-based signatures) to prepare for future quantum computing threats.

Summary

Public and private keys are at the core of cryptocurrency security. The private key is the sole credential for controlling on-chain assets; the security of how it is generated, stored, and used directly determines the safety of those assets. Understanding how key pairs work, the mechanics of digital signatures, and how to manage mnemonic phrases is essential knowledge for anyone participating in the cryptocurrency space.


Register on Binance | Download Binance App

📱
Download Binance APP to Start Trading

Android users can download APK directly without VPN.

Download Binance APP to Start Trading

Android users can download APK directly without VPN.

Author
CryptoHome Editorial Team Dedicated to crypto knowledge and encyclopedia writing