---
title: "P2TR vs Legacy Addresses: Quantum Risk and Bitcoin Migration"
description: "A look at how Pay-to-Taproot exposes public keys directly on-chain, why legacy Pay-to-PubKey-Hash conceals them behind hash functions until spending, and how Bitcoin plans to navigate quantum computing threats."
url: https://basisdesk.news/learn/bitcoin-quantum-resistant-addresses-debate
published: 2026-11-19T12:30:31.677Z
modified: 2026-11-19T12:30:31.677Z
section: Bitcoin
author: Basis Desk Newsroom (AI-generated, source-verified)
sentiment: neutral
tickers: [BTC]
tags: [bitcoin, taproot, p2tr, p2pkh, quantum-computing, cryptography, schnorr-signatures, bip-341, bip-360, post-quantum]
license: Quote with attribution to Basis Desk (basisdesk.news). Not financial advice.
---

# P2TR vs Legacy Addresses: Quantum Risk and Bitcoin Migration

A look at how Pay-to-Taproot exposes public keys directly on-chain, why legacy Pay-to-PubKey-Hash conceals them behind hash functions until spending, and how Bitcoin plans to navigate quantum computing threats.

## Key points

- P2TR addresses directly expose a 32-byte tweaked public key on-chain, making them vulnerable to Shor's algorithm before spending occurs.
- Legacy P2PKH outputs hide public keys behind SHA-256 and RIPEMD-160 hashes, providing a pre-spend defense against quantum key extraction.
- The quantum protection of P2PKH vanishes immediately once an address broadcasts a spend or if an address is reused.
- Post-quantum alternatives like NIST-standardized ML-DSA require thousands of bytes per signature, posing substantial block space and hardware wallet challenges.

A sufficiently powerful quantum computer running Shor's algorithm could derive the private keys that control funds on the Bitcoin network if those public keys are directly visible on the public ledger [1]. Pay-to-Taproot outputs make this key recovery possible ahead of spending because they expose a tweaked public key directly within the script [2]. In contrast, legacy Pay-to-PubKey-Hash outputs conceal public keys behind two cryptographic hash functions until a transaction is broadcast [3]. Understanding this architectural divide determines how developers approach Bitcoin's long-term post-quantum migration.

## The Quantum Threat to Bitcoin Cryptography

Bitcoin relies on public-key cryptography to verify asset ownership and authorize transfers. When a user creates a standard Bitcoin wallet, the software generates a private key, which is a random 256-bit number. Using **elliptic curve cryptography**—specifically the secp256k1 curve—the software derives a corresponding public key through point multiplication [3].

Under classical computing constraints, reversing this multiplication is mathematically intractable. A classical computer would take billions of years to determine a private key from an exposed public key using the best-known algorithms for the discrete logarithm problem. Consequently, Bitcoin's security model assumes that publicly sharing a public key introduces zero practical risk to the underlying private key.

Quantum computing undermines this assumption. In 1994, mathematician Peter Shor formulated an algorithm that solves the discrete logarithm problem in polynomial time on an error-corrected quantum computer [1]. If an adversary gains access to a machine with several thousand stable, fault-tolerant logical qubits, they could compute a Bitcoin private key directly from any exposed secp256k1 public key in hours or even minutes. This vulnerability threatens every transaction format that records raw public keys on-chain.

## Legacy P2PKH and the Hash Barrier

Bitcoin's original transactions included Pay-to-PubKey (P2PK), which posted raw public keys directly into transaction outputs. Satoshi Nakamoto soon introduced **Pay-to-PubKey-Hash** (P2PKH) addresses, which start with the number 1, to save block space and reduce transcription errors [3]. P2PKH inadvertently introduced a defense against quantum key extraction for unspent funds.

Instead of publishing the raw public key to the blockchain when receiving funds, a P2PKH output contains a 20-byte hash of the public key. This digest is produced by running the public key through two distinct cryptographic functions: SHA-256 and RIPEMD-160, a sequence commonly termed Hash160 [3]. When an address receives $BTC in a P2PKH output, the underlying public key never appears on the public ledger. The network only records this 160-bit hash.

Shor's algorithm cannot invert cryptographic hash functions. A quantum adversary attempting to derive the private key behind an unspent P2PKH output must first reverse RIPEMD-160 and SHA-256 to uncover the public key. Quantum computers can search unstructured problems using Grover's algorithm, which provides a quadratic speedup rather than an exponential one [1]. For a 160-bit hash, Grover's algorithm lowers the effective brute-force security to 80 bits. While 80 bits is within the theoretical reach of advanced computing clusters, it remains far more resistant to immediate extraction than the secp256k1 curve targeted by Shor's algorithm.

However, this hash protection disappears the moment the owner spends from a P2PKH address. To fulfill the spending condition, the spending transaction must reveal both the original public key and a valid digital signature [3]. Once broadcast to the peer-to-peer network, the public key enters the memory pool (mempool). A quantum adversary monitoring the mempool could theoretically compute the private key from the exposed public key and broadcast a conflicting transaction with a higher fee to steal the funds before the original transaction confirms. Furthermore, if a user reuses a P2PKH address, the public key remains permanently visible on-chain, nullifying the hash barrier for any subsequent funds sent to that address.

## Pay-to-Taproot and On-Chain Public Keys

Activated in November 2021 via Bitcoin Improvement Proposals 340, 341, and 342, Taproot introduced the Pay-to-Taproot (P2TR) output format, visible as addresses starting with "bc1p" [2]. Taproot replaced legacy ECDSA signatures with **Schnorr signatures** and enabled Merklized Alternative Script Trees (MAST) [2]. For a complete breakdown of these mechanics, see [Bitcoin Taproot, Explained: Schnorr Signatures and MAST](https://basisdesk.news/learn/taproot-explained).

Taproot delivers major efficiency gains by unifying single-key spends and complex smart contracts into identical-looking outputs. Under P2TR, an output script consists of a witness version byte (0x01) followed directly by a 32-byte public key [2]. This value is not a hash; it is an actual point on the secp256k1 curve, constructed by tweaking an internal public key with the Merkle root of any alternative spending scripts [2]. Detailed comparisons of these script formats can be explored in [Bitcoin Address Types Explained: Legacy, SegWit, and Taproot](https://basisdesk.news/learn/bitcoin-address-types-explained).

Because the P2TR output explicitly contains this 32-byte public key, the address reveals mathematical material directly susceptible to Shor's algorithm while the funds sit unspent. A quantum adversary does not need to wait for a spending transaction to appear in the mempool. The adversary can observe the unspent transaction output (UTXO) set, isolate the 32-byte key from the P2TR output, and run Shor's algorithm to compute the internal private key [1, 2].

Consider a numerical comparison of the data exposed on-chain prior to spending:
- A legacy P2PKH UTXO holds an output script containing `OP_DUP OP_HASH160 <20-byte Public Key Hash> OP_EQUALVERIFY OP_CHECKSIG`. The exposed key material is exactly 20 bytes of hashed data, requiring a preimage attack to reveal the curve point.
- A native SegWit (P2WPKH) UTXO contains `OP_0 <20-byte Public Key Hash>`. It also exposes 20 bytes of hashed data, preserving the hash shield prior to spending.
- A P2TR UTXO contains `OP_1 <32-byte Tweaked Public Key>`. The exposed key material is a 32-byte x-only elliptic curve point, requiring zero hash inversions before initiating Shor's algorithm.

Assume a user holds 5 $BTC in an unspent output. In a P2PKH script, a quantum adversary must execute roughly 2^80 operations to reverse the hash barrier before attacking the elliptic curve. In a P2TR script, that hash barrier is zero operations: the adversary immediately initiates Shor's algorithm against the 32-byte curve point. If Shor's algorithm requires approximately 2,000 to 4,000 logical qubits to break secp256k1, the P2TR output is vulnerable as soon as such a machine exists, whereas the unspent P2PKH output remains shielded behind SHA-256 and RIPEMD-160.

## Trade-offs: Taproot Efficiency vs. Hash Concealment

The exposure of public keys in Taproot was an intentional design decision, not an oversight. Bitcoin developers evaluated the quantum trade-off when drafting BIP 341 [2]. Eliminating the hash wrapper provided three critical advantages for classical operation.

First, omitting the hash wrapper saves significant on-chain block space. In standard single-sig spends, a P2TR input only needs to provide a 64-byte Schnorr signature in the witness field [2]. It does not need to push a separate 33-byte compressed public key to satisfy a script hash, reducing transaction fees for users.

Second, Taproot's design enables key aggregation protocols like MuSig2, where multiple participants combine their keys into a single joint key off-chain [2]. The blockchain records only the combined key and verifies a single standard signature, preserving participant privacy.

Third, developers recognized that the hash shield in P2PKH and P2WPKH offers asymmetric and temporary protection. Address reuse ruins the hash shield instantly. Furthermore, during the spending window between transaction broadcast and block confirmation, any legacy address must expose its raw public key to the mempool [3]. If quantum computers become fast enough to run Shor's algorithm in under ten minutes, unspent hash protection cannot prevent mempool theft during transit.

## Proposed Quantum-Safe Migration Paths

Protecting the Bitcoin ledger against future quantum systems requires transitioning to post-quantum cryptography (PQC). The National Institute of Standards and Technology (NIST) has standardized several quantum-resistant algorithms, including lattice-based schemes like ML-DSA (formerly Dilithium) and stateful hash-based schemes like SLH-DSA (formerly SPHINCS+) [4]. Implementing these algorithms on Bitcoin presents steep operational hurdles.

Post-quantum signatures are substantially larger than classical signatures. A secp256k1 Schnorr signature requires 64 bytes. In contrast, an ML-DSA signature requires over 2,400 bytes, and an SLH-DSA signature can exceed 7,000 bytes [4]. Processing signatures of this size would drastically lower Bitcoin's transaction throughput under the existing 4-megabyte block weight limit, or demand a contentious block size increase.

To manage this transition without breaking consensus or congesting blocks prematurely, developers have explored targeted soft forks. One architectural proposal is BIP 360, which examines mechanisms to invalidate or freeze unspent outputs that have exposed public keys while providing a cryptographically verifiable claim path for valid owners [5]. Technical frameworks surrounding this proposal are detailed in [Bitcoin Developers Propose BIP 360 to Mitigate Long-Exposure Quantum Vulnerabilities](https://basisdesk.news/news/bitcoin-developers-propose-bip-360-quantum-resistance).

A viable migration path would likely follow a phased soft-fork timeline:
1. Introduction of a new witness version (such as SegWit version 2) that defines a post-quantum signature verification opcode, using either compact lattice schemes or hash-based signatures.
2. Implementation of committed spend proofs, allowing users to send funds to a post-quantum address that hides the quantum public key behind a post-quantum hash until spent.
3. A grace period during which users are incentivized to move funds from exposed public key outputs (P2PK, reused addresses, and P2TR) into quantum-resistant script formats.
4. Potential consensus restrictions that disable direct spending from secp256k1 outputs, requiring owners of dormant coins to prove ownership through alternative zero-knowledge proofs or staged recovery scripts.

Hardware wallet constraints compound this engineering challenge. Embedded devices featuring microcontrollers with limited RAM struggle to generate the large mathematical matrices required for lattice cryptography. The operational trade-offs for signing transactions on consumer signing devices are evaluated in [Trezor Evaluates Post-Quantum Signature Trade-Offs for Bitcoin Hardware Wallets](https://trezor-quantum-resistance-shrincs-bitcoin-wallets).

## Common Misconceptions

*Legacy addresses are completely quantum-proof.* P2PKH addresses conceal the public key only until the first spend [3]. Once a spending transaction is broadcast, the public key is visible in the mempool. If an address is ever reused, all remaining and future funds directed to that address lose their hash protection completely.

*Taproot weakened Bitcoin's existing security profile.* Taproot relies on secp256k1, the exact same mathematical curve Bitcoin has utilized since its genesis block in 2009 [2, 3]. For any classical adversary, Taproot is just as cryptographically sound as legacy P2PKH or native SegWit. It only accelerates the window of vulnerability in a hypothetical post-quantum future where Shor's algorithm is operational.

*A quantum computer will break Bitcoin overnight without warning.* The construction of an error-corrected, fault-tolerant quantum computer requires scaling from today's physical qubit counts into millions of physical components to yield thousands of stable logical qubits [1]. Cryptographers and developers monitor quantum hardware milestones to ensure post-quantum soft forks can be deployed years before machines reach the threshold required to attack 256-bit elliptic curves.

## How This Connects to the Market

The post-quantum debate is not an immediate operational emergency, but it directly informs the roadmaps of protocol developers, custody providers, and long-term institutional allocators. Institutional custody systems holding cold-storage $BTC over decades must account for the longevity of the script types they select. While Taproot offers undeniable fee and operational benefits for Lightning Network channels, multisig structures, and complex smart contracts, entities securing static reserves must recognize that P2TR addresses permanently expose their public keys on-chain.

Over the coming years, Bitcoin core development will center on minimizing signature overhead and benchmarking post-quantum cryptographic primitives. Market participants tracking protocol resilience should watch for formal proposals introducing post-quantum witness versions, developments in zero-knowledge proofs capable of verifying classical keys without exposing them, and ecosystem-wide standards for address migration.

## FAQ

**Why does P2TR expose the public key if P2PKH hid it?**

Taproot omitted the hash wrapper to reduce transaction data sizes, optimize block space, and enable key-aggregation privacy features like MuSig2 under classical computing assumptions.

**Can a quantum computer steal funds from a P2PKH address while it sits unspent?**

Not directly through Shor's algorithm. An attacker must first reverse the RIPEMD-160 and SHA-256 hash functions, which Shor's algorithm cannot solve, leaving the key shielded until a spending transaction is broadcast.

**What happens if a user reuses a legacy Bitcoin address?**

Address reuse destroys the hash protection. The first transaction reveals the raw public key to the blockchain, leaving all subsequent funds at that address directly vulnerable to quantum derivation.

**How large are post-quantum signatures compared to Bitcoin's current signatures?**

Current secp256k1 Schnorr signatures are 64 bytes. NIST-standardized post-quantum signatures such as ML-DSA-44 require over 2,400 bytes, which would consume significantly more block space.

## Sources

1. [Bitcoin Developer Documentation: Transactions](https://developer.bitcoin.org/reference/transactions.html) — Bitcoin Project
2. [FIPS 204: Module-Lattice-Based Digital Signature Standard](https://csrc.nist.gov/pubs/fips/204/final) — National Institute of Standards and Technology
3. [BIP 341: Taproot: SegWit Version 1 Spending Rules](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki) — Bitcoin Core Developers
4. [BIP 360: Pay-to-Quantum-Resistant Script Proposals](https://github.com/bitcoin/bips) — Bitcoin Core Developers

---
Basis Desk Newsroom · AI-generated, source-verified · https://basisdesk.news/about/how-we-use-ai
