[TLDR Guide] Bitcoin Private Key, Public Key, and Public Address

Kevin Choi
Nov 18, 2017 · 2 min read

A public-key cryptography (or asymmetrical cryptography) is one that uses pairs of keys: 1. public key (open to anyone); and 2. private key (only known to the owner). In the case of Bitcoin which uses such cryptography, then what is the relationship between one’s private key, public key, and public address??

1. Private key

A private key is essentially a randomly generated, 32-byte number.

2. Public key

A public key can be derived from the private key using what’s called Elliptic Curve Cryptography. Bitcoin uses a specific elliptic curve called secp256k1 over the finite (prime) field of (2²⁵⁶-2³²-2⁹-2⁸-2⁷-2⁶-2⁴-1) number of elements, using the generator point (on the curve) G=(x, y) where (in hexademical):

x=79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798

y=483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8

Formula: public key = (private key) * G

Optional:

Elliptic curve: y² = x³+a x+b

secp256k1 curve: y² = x³+7

There exists a group law on the set of all points on a given elliptic curve. There’s even what’s called a point at infinity on the curve.

In the formula, note that the multiplication (a number times a point) is done via group law on the elliptic curve.

3. Public address

Public key → 8-step process involving concatenation, hash functions (SHA-256 and RIPEMD-160), and Base58Check → public address

Optional:

A hash function h() is one that can be used to map data of arbitrary size to data of fixed size. It satisfies two properties: 1. one-way given h(x)=y, it’s computationally infeasible to find z such that h(z)=y; and 2. collision-free it’s computationally infeasible to find x and y such that h(x)=h(y).

Note: private key → public key → public address is essentially a one-way street!

Chain Intelligence

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store