A public key is one half of the cryptographic key pair that makes self-custody of digital assets possible. It is generated from a randomly chosen private key using elliptic-curve math, most commonly the secp256k1 curve that both Bitcoin and Ethereum rely on. The two keys form a matched set: whatever the private key signs, the public key can verify, but the private key itself cannot be reverse-engineered from the public one.
In practice, few people ever see a raw public key. Most blockchains hash it (Bitcoin runs it through SHA-256 and then RIPEMD-160; Ethereum uses Keccak-256) and encode the result into the shorter, more compact string known as an address, which is what actually appears on receipts and block explorers. The full public key only becomes visible on-chain at the moment a transaction is signed, since nodes need it to confirm the accompanying digital signature before accepting the transfer.
This design lets a wallet share its public key or address freely, much like a bank account number, while the private key stays hidden and does the authorizing. Anyone can look up the balance and transaction history tied to a public key, but only the holder of the matching private key can move the funds. Losing the private key does not affect the public key's validity, but it permanently locks the associated assets, since there is no central authority to reissue access.