Public-Key Cryptography: The Mathematical Foundation of Blockchain Security

Crypto Basics
Updated on2026-08-21
106

Public-key cryptography uses a pair of related keys to verify authorization: the private key creates a digital signature, while the public key allows the network to verify it. Control of the private key generally determines control of an account, but the private key cannot be derived from the public key.

Blockchain transfers primarily use public-key cryptography to prove who authorized a transaction. This does not mean that everything on a public ledger is encrypted or hidden.

Public-key cryptography workflow: the private key signs a transaction, the public key verifies the signature, and the private key always remains with its holder

A private key is usually generated from secure random data and is the core secret that must be protected. A public key is derived from the private key through mathematical operations such as elliptic-curve cryptography. A blockchain address is often produced by hashing and encoding a public key or script, although derivation rules vary across networks.

This relationship is generally one-way: a public key can be calculated from a private key, but deriving the private key from the public key is computationally infeasible under practical conditions. An address is easier than a public key to display and validate for formatting, but the address itself is not an account password. For more about address formats and checking addresses before sending or receiving crypto, read What Is a Crypto Wallet Address?.

How Does a Digital Signature Authorize a Transaction?

A wallet first constructs the message to be signed, or its hash, from the transaction fields and then uses the private key to generate a signature. When nodes receive the transaction, signature, and corresponding public-key information, they can verify two things: whether the signature belongs to that key and whether the signed data has been altered.

Blockchain signature verification: a transaction and signature are sent to nodes, which use the public key to check authorization and data integrity

A valid signature does not guarantee that a transaction will succeed. Nodes also check balances, UTXOs, nonces, contract conditions, fees, and consensus rules. A signature does not prove who the signer is in the real world unless the address has been reliably linked to an identity.

A Digital Signature Is Not Data Encryption

A digital signature provides integrity, proof of authorization, and a degree of non-repudiation, while encryption is used to hide content. Transactions on a public blockchain are usually readable by anyone, even when they carry valid signatures.

Hashing is not encryption either. It is often used to produce a transaction digest before the signing algorithm processes it. Put simply, hashing creates a data fingerprint, the private key signs that fingerprint, and the public key verifies the signature. For details about hashing, read What Is a Hash Algorithm?.

What Roles Do Wallets and Seed Phrases Play?

A wallet is a tool that manages keys, addresses, and signing workflows; asset records remain on the blockchain ledger. Deleting a wallet application does not destroy on-chain assets, but losing the only backup of the keys may result in permanent loss of control.

A seed phrase is commonly used to deterministically generate a set of keys. Anyone who knows the seed phrase can often restore multiple accounts, so it is at least as sensitive as a private key. A wallet password generally protects a local file or device. It cannot replace a seed-phrase backup or make an exposed seed phrase secure again.

  • Entering a seed phrase or private key on a website, in a chat, or in a customer-support form.
  • Saving key material in screenshots, cloud synchronization services, or plaintext files.
  • Using wallets, browser extensions, or signing devices from untrusted sources.
  • Looking only at the confirmation button instead of checking the network, address, amount, and contract permissions before signing.
  • Using poor-quality randomness or repeatedly using unsafe signature parameters.
  • Mistaking a contract approval that allows token spending for an ordinary login signature.

A hardware wallet can isolate private keys, but users must still manually verify the signing details shown on its screen. Multisignature and threshold-signature schemes can reduce the risk posed by the failure of a single key, but they also make coordination, backup, and recovery more complex.

Is It Safe to Make a Public Key Public?

Public keys are designed for public verification and ordinarily do not reveal private keys. However, reusing addresses can make different transactions easier to associate with one another. This privacy risk is different from the risk of key compromise.

Some networks expose only a hash of the public key before funds are first spent and reveal the public key when spending occurs. The future impact of quantum computing on current algorithms still depends on hardware capabilities, protocol design, and upgrade progress; it does not mean that public keys can already be directly cracked today.

Public-key cryptography is only one part of blockchain technology. To learn how a signed transaction proceeds to confirmation, read How Does Blockchain Work?.

Frequently Asked Questions

Can a Public Key Be Used Directly as a Receiving Address?

Not in every case. Some protocols or scripts use public keys directly, but common wallet addresses are produced through hashing, versioning, and checksum encoding. Always use the address format generated by a wallet for the intended network.

Why Does My Address Stay the Same After I Change Phones?

If the new device restores the wallet with the same seed phrase and derivation path, it may generate the same keys and addresses. The displayed addresses may differ if the wallet uses a different account type or derivation path.

Does a Login Signature Incur an On-Chain Transaction Fee?

Simply signing a login message locally usually does not go on-chain and does not incur a network fee. However, message signatures, approval transactions, and contract calls must be distinguished from one another: the latter two may change on-chain state or grant permission over assets.

Does a Multisignature Wallet Split One Private Key into Several Parts?

Traditional multisignature schemes usually use multiple independent private keys to meet a threshold, such as requiring two signatures out of three keys. Threshold signatures may instead divide signing capability into shares. The two approaches differ in their on-chain behavior and recovery procedures.

Catalogs

Recommended

View more
What Is a Block? An In-Depth Look at Block Structure
Crypto Basics
What Is a Validator? The Role of a Staking Node
Crypto Basics
2025 Overview of Major Layer1 Blockchain Ecosystems
Crypto Basics