A public key is a cryptographic key derived from your private key through a one-way mathematical function. You share it openly so others can send you funds or verify your digital signatures. Knowing your public key gives someone nothing they can use to spend your crypto. Knowing your private key gives them everything.
The relationship between private and public keys relies on elliptic curve cryptography. Bitcoin and Ethereum both use the secp256k1 curve. Your private key is a 256-bit random number. The wallet multiplies that number by a fixed generator point on the elliptic curve, producing a new point on the curve. That new point is your public key.
The math is one-directional. Going from private key to public key is fast and deterministic. Going backward, calculating the private key from the public key, requires solving the elliptic curve discrete logarithm problem, which is computationally infeasible with current technology.
These two terms are related but not interchangeable. Your wallet address is derived from your public key by running it through a hash function. For Bitcoin, the public key gets hashed with SHA-256 then RIPEMD-160, and the result gets encoded with checksum data. For Ethereum, the public key gets hashed with Keccak-256 and the last 20 bytes become your address.
The extra hashing step adds a layer of security. If a flaw in elliptic curve cryptography were ever discovered, the hash layer provides an additional barrier between the attacker and the private key. It also shortens the address, making it more practical to share and type.
When you send a transaction, your wallet signs it with your private key. Anyone can verify that signature using your public key without ever needing your private key. This is the core of Bitcoin's trust model: you do not need to trust the person sending you Bitcoin. You verify the math.
The signature proves two things simultaneously. First, the transaction came from the holder of the private key corresponding to that address. Second, the transaction data was not altered after signing, because any modification would invalidate the signature.
In standard Bitcoin Pay-to-Public-Key-Hash (P2PKH) transactions, your public key does not appear on-chain until you spend from that address. The address is a hash of your public key. Your public key reveals itself in the spending transaction's scriptSig. This is why reusing Bitcoin addresses weakens privacy: once you spend, your public key is visible to anyone analyzing the chain.
Ethereum works differently. Your public key is implicit in every signed transaction, because the signature verification process requires it. Tools like Etherscan can reconstruct your public key from any transaction you have signed.
https://bitcoin.org/en/developer-guide#public-key-cryptography
https://learnmeabitcoin.com/technical/cryptography/elliptic-curve
https://ethereum.org/en/developers/docs/accounts