TeachMeBitcoin

Quantum Security: P2PK vs. P2PKH

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

Quantum Security: P2PK vs. P2PKH

One of the most fascinating technical differences between P2PK and the later P2PKH standard is how they handle the visibility of the public key. This has significant implications for Quantum Resistance.

1. The Elliptic Curve Weakness

Bitcoin uses the secp256k1 elliptic curve. While extremely secure today, a powerful enough quantum computer could theoretically use Shor's Algorithm to derive a private key from a public key.

2. P2PK: Exposed from Birth

In P2PK, the public key is written directly into the ScriptPubKey.

3. P2PKH: Hidden Behind the Hash

In P2PKH, the ScriptPubKey contains a Hash of your public key.

4. The Race to Spend

In a quantum world, a P2PKH user only faces a "Race Condition."

  1. User broadcasts a transaction, revealing their public key.

  2. A quantum attacker sees the public key and tries to derive the private key before the transaction is mined (usually within 10 minutes). For a P2PK user, the attacker doesn't have to race; they can take as long as they want.

Script Type Public Key Reveal Quantum Risk Level
P2PK At time of Receipt High
P2PKH At time of Spending Moderate

In the next section, we will look at P2PK in Coinbase Transactions.

☕ 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!