Public Key
A public key is a string of letters and numbers, derived cryptographically from a private key, that a cryptocurrency wallet owner shares with others in order to receive digital assets such as cryptocurrencies or non-fungible tokens (NFTs).[1]
It is one half of a matched pair of keys—the other being a private key that must be kept secret—used in public-key cryptography to prove ownership of funds without revealing the secret that controls them.[2] On a blockchain, the public key is used to create a public address and to verify the digital signatures that authorize transactions, while the private key does the signing.[3]
Providing a public key compares to sending someone an email address: it can be given out freely to anyone who wishes to send funds, and every public key address corresponds to a private key that authorizes the owner to spend from that wallet.[1] Sharing a public key or address carries no risk to the security of funds, whereas losing the private key means permanent loss of access.[2]
Overview and Terminology
In everyday usage the terms public key and address are often conflated, but they are distinct objects. A public key is a large number derived directly from a private key, while an address is a shorter, hashed version of that public key designed to be easier to share and to add a layer of resistance against certain theoretical attacks.[2]
The full public key is not usually displayed anywhere a user can find it; wallets typically show the private key and address, and a blockchain explorer will show a public address, but not the public key itself.[3]
It is a common but misleading practice to describe a public key or address as the place where cryptocurrency is stored.
Cryptocurrency is code and bits with assigned ownership rather than something physically held at a location; the address functions more like a label attached to that ownership.[3] When two people transact, they reveal their public addresses to each other—an address being likened to a bank account number that the sender needs in order to send funds—but the public keys themselves are never exchanged.[3]
The relationship between the three items is asymmetric. Although the public key and address are both worked out from the private key, the reverse is nearly impossible: a private key cannot practically be regenerated from a public key or address.[3]
This has a direct consequence for recovery. A user who loses a public key can have it recreated from the private key, but a user who loses a private key will find any bitcoin or altcoin associated with the corresponding public address inaccessible forever, because blockchains have no central authority or password-recovery mechanism.[3][2]
Key Generation and Elliptic-Curve Mathematics
A private key is a randomly generated number, typically 256 bits long. The size of this keyspace is what makes it secure: crypto.news quantifies it as roughly 10^77 possible values, a figure it compares to the estimated 10^80 atoms in the observable universe.[2]
The public key is then derived from this private key using elliptic curve multiplication—multiplying the private key by a fixed generator point on the curve. This is a one-way function: fast to compute in the forward direction but practically impossible to reverse, because doing so would require solving the elliptic curve discrete logarithm problem, for which there is no known efficient solution.[2]
Investopedia similarly describes the private key being sent through a hashing function—usually, it says, an elliptical curve function—to create the public key.[3]
Both Bitcoin and Ethereum use the same elliptic curve, known as secp256k1. According to crypto.news, this curve produces 256-bit private keys and 512-bit uncompressed public keys, or 257-bit compressed public keys.[2]
A public key can be stored in two forms. An uncompressed public key is 65 bytes: a 1-byte prefix of 0x04 followed by 32 bytes for the x coordinate and 32 bytes for the y coordinate. A compressed public key is 33 bytes: a 1-byte prefix of 0x02 for an even y value or 0x03 for an odd y value, followed by the 32-byte x coordinate, with the prefix encoding the parity of y so that the y value can be reconstructed.[2]
Investopedia states that an Ethereum public key is 64 bytes, or 128 characters in hexadecimal format, and that on Ethereum the public key is generated automatically by the wallet.[3]
The choice of compression format has a practical consequence. Compressed and uncompressed public keys derived from the same private key produce different Bitcoin addresses, so importing a private key into a wallet that uses a different compression format than the original will generate a different address.[2]
Address Derivation
Because a raw public key is long and, on some chains, best kept off the ledger until needed, wallets hash it into a shorter address before it is shared. Beyond the convenience of a shorter string, an address that has never been used to send a transaction has not yet exposed its public key on-chain, which crypto.news describes as a theoretical layer of protection against future quantum attacks.[2]
The two major networks derive addresses differently. On Bitcoin, the public key is passed through the SHA-256 hashing algorithm and then RIPEMD-160 to produce a 160-bit hash; a version byte is prepended, a checksum is appended, and the result is encoded in Base58Check format, producing a final address that can begin with 1, 3, or bc1.[2]
Investopedia gives a compatible account, noting that when a public key is first created it is a long string that must be compressed and shortened, and that on Bitcoin two zeros are added and the result is sent through Base58Check to be encoded further.[3]
On Ethereum, the public key is run through the Keccak-256 hash function and the last 20 bytes—160 bits—of the resulting hash are taken as the address, with a "0x" prefix added and, optionally, an EIP-55 checksum.[2] Investopedia describes this as Ethereum using the last 20 bytes of the public key and adding 0x to the front.[3] Ethereum uses uncompressed public keys internally but strips the prefix byte during derivation, using only the 64-byte x and y values.[2]
Security and Randomness Failures
The security of any key pair depends entirely on the quality of the randomness used to generate the private key. Weak or predictable randomness has repeatedly allowed attackers to recover private keys, and crypto.news documents several real-world failures.[2]
In July 2026, researchers discovered that the Coldcard hardware wallet had been generating weak private keys for five years because a build flag in the firmware instructed the device to skip its dedicated hardware randomness chip. After an attacker reverse-engineered the weakness, wallet-draining began on July 30, 2026, emptying approximately $116 million in bitcoin before the vulnerability was publicly disclosed.[2]
Earlier incidents followed the same pattern. In 2013, the Android SecureRandom vulnerability caused multiple Bitcoin wallets to generate duplicate random numbers, which enabled attackers to compute private keys from transaction signatures.[2] In September 2022, the Profanity vanity-address generator was exploited when researchers found that its key generation used only a 32-bit seed, reducing the effective keyspace from 2^256 to 2^32—about four billion possibilities—which could be brute-forced in minutes.[2]
To mitigate such risks, crypto.news recommends using reputable hardware wallets with true random number generators, along with options for users to add their own entropy through methods such as dice rolls or coin flips.
Additional practical recommendations include never sharing private keys or seed phrases; verifying an address format and visually confirming its first and last characters to counter clipboard malware that swaps addresses; researching a hardware manufacturer's track record on entropy; and keeping multiple secure backups of a seed phrase, including metal backups for environmental resistance.[2