Bitcoin Address Encoding Explorer

Interactive, step-by-step derivation from a random private key to final mainnet address encoding. Includes legacy P2PKH, compatibility P2SH-P2WPKH, native SegWit (P2WPKH), and Taproot (P2TR, key-path).

Key Generation Basics

secp256k1

Private Key Domain

\[ d \in \{1,2,\dots,n-1\} \] \[ n=\texttt{0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141} \]

Choose uniform random \(d\) in this range; each valid value is a different secret key.

Public Key from EC

\[ Q=d\cdot G,\quad Q=(x,y) \]

\(G\) is the generator point. Computing \(Q\) from \(d\) is easy; reversing \(d\) from \(Q\) is infeasible.

Key Encoding Forms

\[ \text{Uncompressed}=04\|x\|y \quad (65\ \text{bytes}) \] \[ \text{Compressed}= \begin{cases} 02\|x,& \text{if } y \equiv 0 \pmod{2}\\ 03\|x,& \text{if } y \equiv 1 \pmod{2} \end{cases} \quad (33\ \text{bytes}) \]

Equivalent rule: use prefix 02 when \(y \equiv 0 \pmod{2}\) (even \(y\)), and 03 when \(y \equiv 1 \pmod{2}\) (odd \(y\)).

This app generates 32-byte private keys with cryptographic randomness and derives both pubkey forms from the same \(Q=d\cdot G\).
Notes: mainnet only (`0x00`, `0x05`, HRP `bc`). P2SH is shown as P2SH-P2WPKH because raw P2SH needs a redeem script; this is the standard pubkey-derived compatibility form.