A public key is a cryptographic string generated through asymmetric encryption algorithms, designed to be shared openly with anyone on a network. It works with a corresponding private key to enable secure communication, transaction verification, and identity authentication across digital systems, including blockchain networks.
The concept of the public key comes from a broader framework called Public Key Cryptography (PKC), also known as asymmetric encryption. Developed in the 1970s by researchers Whitfield Diffie and Martin Hellman, PKC was designed to solve a fundamental problem: how can two parties communicate securely over a public channel without sharing a secret password in advance?
The answer lies in a mathematical concept called a trapdoor function – a calculation easy to perform in one direction but computationally infeasible to reverse. A common example is prime factorization: multiplying two large prime numbers takes a fraction of a second, but finding those primes from the result would take modern computers thousands of years. This asymmetry makes PKC effective at validating authenticity without exposing the underlying secret.
In most cryptographic systems, a public key is mathematically derived from a private key, not the other way around. The private key is a large, randomly generated number that only the owner has. Running that number through an elliptic curve algorithm (the standard used in Bitcoin and Ethereum) produces the corresponding public key. Because of the trapdoor property, knowing the public key gives no useful information to recover the private key.
The relationship is strictly one-directional. You can derive a public key from a private key, but not the reverse. This asymmetry is the foundation of how public-private key pairs protect digital identities.
Public and private keys always operate as a matched pair. The private key stays hidden and acts as proof of ownership, while the public key is freely distributed across the network. Each key plays a distinct role depending on the operation performed.
In encryption, a sender uses the recipient's public key to scramble a message. Only the recipient's private key can decrypt it. In digital signing, the process is reversed: the sender uses their private key to sign data, and anyone with the corresponding public key can verify the signature. Blockchain networks rely almost exclusively on this model to validate transactions.
Within blockchain ecosystems, the public key functions as a verifiable identifier for a wallet. When a user initiates a transaction, their wallet software uses the private key to generate a cryptographic signature. Network validators then check that signature against the sender's public key to confirm two things: that the transaction came from the wallet's owner and that the transaction data was not tampered with after signing.
This process allows a fully decentralized network with no central authority to enforce trust. No institution needs to vouch for anyone's identity. The math does it instead.
Most users never interact directly with their public key. Instead, they see a blockchain address, a shorter, hashed representation of the public key. For Ethereum, this is the familiar hexadecimal string beginning with "0x". For Bitcoin, some wallets generate a new address for every transaction to enhance privacy, though all addresses trace back to the same underlying key pair.
Hashing the public key into an address adds a second layer of protection. Even if a future breakthrough weakened elliptic curve cryptography, the hash would provide an additional barrier before an attacker could reconstruct a private key.
The utility of public keys extends beyond blockchain. They underpin much of the security infrastructure people rely on daily without thinking. SSL/TLS protocols, which encrypt the connection between a browser and a web server, use public key cryptography to establish a secure session before any data is exchanged. Email encryption standards like PGP (Pretty Good Privacy) allow senders to encrypt messages so only the intended recipient with the correct private key can read them.
Digital signatures in legal and corporate contexts also depend on public key infrastructure. When someone signs a document electronically, the public key attached to their certificate lets any party verify that the signature is authentic and the document has not been altered since signing.
At an organizational and internet-wide scale, the management of public keys is governed by a system known as Public Key Infrastructure (PKI). PKI encompasses the policies, hardware, software, and procedures needed to create, distribute, store, and revoke digital certificates that bind public keys to verified identities. Certificate Authorities (CAs), such as DigiCert or Let's Encrypt, act as trusted third parties within this framework. They issue digital certificates confirming that a given public key genuinely belongs to a specific individual, organization, or website.
Without PKI, a malicious actor could substitute their own public key for someone else's and intercept communications meant for that party – an attack known as a man-in-the-middle attack. PKI solves this by providing a chain of trust that participants can verify independently.