TeachMeBitcoin

Public vs. Private Keys

From TeachMeBitcoin, the free encyclopedia ⏱️ 3 min read

Public vs. Private Keys: The Asymmetric Lifecycle

Bitcoin's entire security model relies on Asymmetric Cryptography (also known as public-key cryptography). Unlike symmetric systems where the same key locks and unlocks data, asymmetric systems utilize a mathematically matched pair of keys with completely different roles.


⚖️ Comparative Overview of the Key Pair

Attribute Private Key Public Key
Confidentiality Strictly Secret (Keep offline/safe) Publicly Shared (Sent to the network)
Mathematical Type 256-bit Scalar Integer ($k$) $(x, y)$ Elliptic Curve Coordinate Point ($K$)
Role in Wallet Signs transactions to authorize spends Identifies the owner & verifies signatures
Derivation Path Seed $\rightarrow$ Private Key Private Key $\rightarrow$ Public Key
Loss Impact Complete, permanent loss of associated coins Can be easily re-derived from private key

🔄 The Transaction Signing Lifecycle

To understand how these keys interact, let's look at the lifecycle of a standard transaction spend.

When Alice wants to send $1.5 \text{ BTC}$ to Bob:

┌────────────────────────────────────────────────────────┐
│               STEP 1: TRANSACTION SIGNING              │
├────────────────────────────────────────────────────────┤
│ • Alice constructs transaction data (the Message, M).  │
│ • Alice uses her PRIVATE KEY (k) to sign M.            │
│ • Outputs an ECDSA cryptographic signature: (r, s).    │
└───────────────────────────┬────────────────────────────┘
                            │
                            ▼ (Broadcasts)
┌────────────────────────────────────────────────────────┐
│               STEP 2: NETWORK BROADCAST                │
├────────────────────────────────────────────────────────┤
│ • Alice sends the raw transaction to the P2P Network.  │
│ • This contains: M, Signature (r, s), and Public Key K.│
└───────────────────────────┬────────────────────────────┘
                            │
                            ▼ (Validators Receive)
┌────────────────────────────────────────────────────────┐
│               STEP 3: NODES VERIFY                     │
├────────────────────────────────────────────────────────┤
│ • Nodes run the verification algorithm:                │
│             Verify(M, Signature (r, s), Public Key K)  │
│ • Confirm mathematical ownership without ever seeing   │
│   Alice's secret private key!                          │
└────────────────────────────────────────────────────────┘

🔑 Why Revealing Your Private Key is Fatal

Because of the mathematical relationship on the elliptic curve, a signature $(r, s)$ can only be generated by someone in possession of the private key $k$.

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!