Web3 Learning

What Is the Relationship Between a Bitcoin Private Key, Public Key, and Address?

By Safeheron Team

A Bitcoin private key, public key, and address form a one-way chain of derivation: the private key produces the public key, and the public key produces the address, but neither step can be reversed. The private key determines who can spend the funds and must be kept secret; the public key is used to verify signatures; and the address is used to receive payments and can be shared publicly. One private key corresponds to only one public key, but it can generate several types of address.

What Are a Private Key, a Public Key, and an Address?

A private key is a 256-bit random number used to sign transactions. The public key is derived from the private key through elliptic curve operations, and nodes use it to verify that a signature was produced by the corresponding private key. An address is a string produced by hashing and encoding a public key or script, and it tells the payer the conditions under which the funds will be locked.

All of these steps are one-way. Deriving the private key from the public key requires solving the elliptic curve discrete logarithm problem, and deriving the public key from the address requires breaking a hash function. Neither is feasible with current computing power.

What Formats Do Bitcoin Private Keys Come In?

The same private key can be written in different formats. The most direct is a 64-digit hexadecimal number. For importing and exporting, wallets more commonly use the WIF format, which adds the version byte 0x80 in front of the private key, then adds a checksum and encodes the result in Base58. WIF keys for uncompressed public keys start with 5, while those for compressed public keys start with K or L.

Taking the publicly known demo private key 1 as an example, its compressed WIF is KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn. Anyone can spend funds at the addresses for this private key, so never use it. Most wallets today no longer display individual private keys directly; instead, users back up a mnemonic phrase, and an HD wallet derives all the private keys from it.

What Is the Difference Between Compressed and Uncompressed Public Keys?

A public key is a point on the curve with two coordinates, x and y. The uncompressed format writes out both coordinates, starts with 04, and is 65 bytes long. The compressed format writes only the x-coordinate, uses the prefix 02 or 03 to indicate whether y is even or odd, and is 33 bytes long. Both represent the same point, but the compressed format makes transactions smaller and fees lower. It is now standard practice, and SegWit addresses accept only compressed public keys.

Note that compressed and uncompressed public keys have different hashes, so they also generate different legacy addresses. For private key 1, the uncompressed address is 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm, while the compressed address is 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH. When importing a very old private key, choosing the wrong format can make the balance appear to be missing.

How Many Addresses Can One Private Key Have?

A private key has only one public key, but that public key can generate multiple address types, including legacy, P2SH-wrapped SegWit, native SegWit, and Taproot. On-chain, these are completely different addresses with separate balances. Wallets usually display only one type, so if someone sends funds to another address type for the same private key, the funds are not lost; they can only be seen and spent with a wallet that supports that type.

What Can Be Made Public, and What Must Never Be Exposed?

Addresses can be shared freely; that is what they are for. Making a public key public does not lead to stolen funds either, and it is automatically revealed on-chain when the funds are spent. What requires care is the extended public key (xpub), which can derive every address in a wallet. If it leaks, others cannot move your funds, but they can see your entire balance and transaction history.

Private keys and mnemonic phrases must never be exposed, because whoever obtains them effectively obtains the funds. For businesses, the challenge is that the private key must be usable for signing, yet must never sit in the hands of any single person or server, which is exactly the problem threshold signatures are designed to solve.

Conclusion

A private key, public key, and address form a chain that can only be computed in one direction: the address can be made public, while the private key determines everything. One private key corresponds to multiple addresses; choosing the wrong format does not lose funds, but a leaked private key cannot be undone. Safeheron’s MPC Wallet-as-a-Service provides businesses with MPC key management and a policy engine.

Want your business’s private keys to never exist in full in any one place?

Contact Safeheron’s Sales Team to Book a 1:1 Demo

Share

Looking for a secure way to manage digital assets?

Talk to our experts and find the right solution for your business.

Request a Demo