Wallets & security

Public key

Definition

A public key is the shareable half of a crypto key pair, calculated from the private key, that lets the network verify your signatures and from which your wallet address is derived.

How public key works

Public-key cryptography uses two linked keys. The private key signs, and the public key verifies. Bitcoin and Ethereum use elliptic curve cryptography, where computing the public key from the private key is easy, but the reverse is not feasible.

Your wallet address is usually a shortened, hashed version of the public key. On Ethereum, the address is the last 20 bytes of the hash of the public key. Bitcoin uses several address formats built from the public key in different ways.

You rarely need to handle a public key directly. Some advanced tools, such as multisig setups or watch-only wallets, use an extended public key (xpub) to track every address of a wallet. An xpub cannot spend funds, but it reveals your full balance and history, so share it only with tools you trust.

Example

Suppose Alice signs a transaction sending 0.05 BTC to Bob. Each node on the network receives the transaction, the signature and Alice's public key. It runs the verification math and confirms that only the owner of the matching private key could have produced that signature, and that the public key matches the address holding the 0.05 BTC. The private key itself never travels across the network.

Common mistakes

  • Believing the public key is the same thing as the wallet address in every blockchain.
  • Sharing an xpub with an unknown app without realising it exposes every address and balance in the wallet.
  • Thinking a public key can be used to move funds.

Learn and practise

FAQ

Is it safe to share my public key?

Yes, in terms of spending. A public key cannot move funds, though it can link your addresses and reveal your activity.

Is a public key the same as a wallet address?

Not exactly. The address is usually derived from the public key by hashing and encoding it, which makes it shorter and adds error checks.