Home › Learn › Bitcoin and quantum computers: the post-quantum BIPs

Bitcoin and quantum computers: the post-quantum BIPs

A large enough quantum computer running Shor's algorithm could derive a private key from a public key, which would break the signatures Bitcoin uses today. No such computer exists, and nobody knows when or whether one will. Coins are only exposed where a public key is visible on chain: early P2PK outputs, reused addresses and Taproot outputs. Two BIPs propose responses: BIP 360 adds a Taproot-like output without a key path (Pay-to-Merkle-Root, P2MR), and BIP 361 sets out a phased retirement of today's signatures. Both are proposals; each BIP page shows its current status.

Updated · 7 min read

The short answer

Bitcoin uses two kinds of cryptography. ECDSA and Schnorr signatures prove ownership; both rely on the elliptic curve discrete logarithm problem being hard. Hash functions (SHA-256, RIPEMD-160) build addresses, link blocks and drive mining. Quantum algorithms threaten the first much more than the second.

BIP 360's authors put it this way: "it is unclear when or if" cryptographically relevant quantum computers (CRQCs) will become viable, and their proposal "does not take a position on any specific quantum computing timeline". BIP 361's authors argue the opposite emphasis, that migration takes years and should start early. This guide explains what is at stake and what each proposal would do, without guessing dates.

What a quantum computer could and couldn't break

Shor's algorithm: signatures

Shor's algorithm, published by Peter Shor in 1994, solves the discrete logarithm problem efficiently on a sufficiently large, error-corrected quantum computer. For Bitcoin that means computing the private key from a public key, which BIP 360 calls "quantum key recovery". It would affect ECDSA and BIP 340 Schnorr alike, since both use the secp256k1 curve. It only works where the public key is known, which is why the type of output matters.

Grover's algorithm: hashes and mining

Grover's algorithm gives a general quadratic speedup for search problems. Against a hash function it turns a 2^256 brute-force search into roughly 2^128 operations: a big reduction, but 2^128 is still far out of reach. That is why hashes are considered much more robust than elliptic curve signatures, and why outputs that publish only a hash protect keys while unspent. Shorter 160-bit hashes, used in P2PKH and P2WPKH addresses, keep a smaller margin. Grover could in principle speed up mining too, but no BIP proposes changing proof of work in response to quantum computing.

Which bitcoin outputs expose public keys?

BIP 360 separates two kinds of attack:

  • Long exposure attacks target public keys that sit on chain for a long time. An attacker has as long as the coins stay put.
  • Short exposure attacks target a public key revealed in a transaction waiting in the mempool, and would require a far faster quantum computer to finish before the transaction confirms.

Almost every spend reveals a public key, so short exposure applies to all output types. Long exposure depends on the output type:

Output type Address starts with Public key on chain before spending?
P2PK (pay to public key) no address Yes, in the output
Bare multisig (P2MS) no address Yes, in the output
P2PKH 1 No, only a hash
P2SH 3 No, only a hash
P2WPKH bc1q No, only a hash
P2WSH bc1q No, only a hash
P2TR (Taproot) bc1p Yes, the output key is a public key
P2MR (proposed in BIP 360) bc1z No, only a Merkle root

Three things turn a "No" into a "Yes". Address reuse: once you spend from an address, its public key is on chain, so coins still sitting there are exposed. Shared extended public keys: BIP 360 notes that xpubs and output descriptors reveal public keys too. Scripts that contain keys, once spent.

P2PK outputs include many coins mined in Bitcoin's first years. BIP 361's authors estimate that, as of 1 March 2026, over 34% of all bitcoin was in outputs whose public key had been revealed on chain.

Why does Taproot put a public key in the output?

BIP 341 explains the choice. Taproot needs the key for batch verification, and a 256-bit hash would have cost about as much space. On quantum risk its authors wrote that hashing keys "is often said to protect against ECDLP breaks or quantum computers", but "this protection is very weak at best: transactions are not protected while being confirmed, and a very large portion of the currency's supply is not under such protection regardless." Real resistance, they argued, needs different cryptographic assumptions. The Taproot guide covers the rest of the design.

BIP 360: Pay-to-Merkle-Root (P2MR)

BIP 360, by Hunter Beast, Ethan Heilman and Isabel Foxen Duke, proposes a new output type through a soft fork. P2MR works like a Taproot output with the key path removed:

  • What's in the output: OP_2 plus the 32-byte Merkle root of a script tree, built exactly as in BIP 341 (TapLeaf and TapBranch hashes). It is SegWit version 2, so addresses start with bc1z.
  • How it's spent: always through a script, revealing the leaf script, its inputs and a control block of 1 + 32m bytes. Unlike Taproot there is no internal key to reveal.
  • What it protects against: long exposure attacks, because only a hash is on chain until spending. The BIP says it gives 128 bits of collision resistance and 256 bits of preimage resistance, the same as P2WSH.
  • What it doesn't do: add post-quantum signatures. Scripts in a P2MR tree still use today's signature opcodes, so short exposure attacks remain possible. The authors say protection against those "may require the introduction of post-quantum signatures", which they intend to offer as a separate proposal, and name ML-DSA and SLH-DSA as schemes to scrutinize.

Why not just use P2WSH, which already hides keys behind a hash? Because P2WSH doesn't support Tapscript, and the BIP calls Tapscript's OP_SUCCESSx upgrade path "critical" for adding post-quantum signature opcodes later.

The cost. A P2MR spend is always larger than a Taproot key path spend: the BIP's example witness for a depth-1 tree is 135 bytes against 66 bytes for a P2TR key path spend. It is smaller than the equivalent Taproot script path spend, since no internal key is included. Single-leaf trees are made anyone-can-spend, to push users toward at least two spending paths.

The name. BIP 360's changelog records earlier names: it was Pay to Quantum Resistant Hash (P2QRH), renamed Pay-to-Tapscript-Hash (P2TSH) in September 2025 and Pay-to-Merkle-Root in February 2026. The witness version also changed from 3 to 2 in 2025.

BIP 361: Post Quantum Migration and Legacy Signature Sunset

BIP 361, by Jameson Lopp, Christian Papathanasiou, Ian Smith, Joe Ross, Steve Vaile and Pierre-Luc Dallaire-Demers, assumes some post-quantum output type has already been deployed and proposes a pre-announced sunset of ECDSA and Schnorr:

Phase What happens When
A Sending to quantum-vulnerable output types is disallowed; coins can only move into post-quantum outputs 160,000 blocks (about 3 years) after activation
B Spends signed with ECDSA or Schnorr must also pass a quantum-safe "rescue protocol" 2 years after Phase A

The rescue idea relies on something the real owner knows and a quantum attacker doesn't. For example, a wallet built with BIP 32 hardened derivation could prove knowledge of the parent private key, perhaps with a zero-knowledge proof. The BIP says no such rescue is believed possible for P2PK outputs, and that it is compatible with a separate "Hourglass" style proposal for them.

This is the most contested part of the quantum discussion. BIP 361 calls itself "radically different from any in Bitcoin's history" and argues that coins taken by a quantum attacker would amount to "a theft from everyone". Critics see restricting old signatures as confiscating coins whose owners don't act in time. The authors respond that if rescue protocols cover most of the supply, the restriction "will be at most mildly confiscatory". Both positions have supporters.

Other quantum ideas in the BIPs

  • Lamport signatures via OP_CAT. BIP 347 lists hash-based Lamport signatures as one use of OP_CAT, but notes that a Taproot output's key path would still be exposed to a quantum attacker. BIP 360 adds that such signatures are one-time: signing twice with the same key risks leaking it.
  • New script systems. BIP 141 already named "Lamport signatures, which are quantum computing resistant" as an example of what witness versioning could add later.
  • Encrypted transport. BIP 324 lists post-quantum upgrades to its handshake as a possible future feature.

More covenant and opcode proposals that could interact with this work are in the covenants guide, and the activation question in the soft forks guide.

What you can do today

Nothing in the protocol currently requires you to act. Sensible habits that help regardless:

  • Don't reuse addresses. Spending from an address reveals its public key.
  • Keep xpubs and descriptors private, since they reveal public keys.
  • Know your output type. Hash-based outputs (bc1q, 3, 1) keep the key off chain until you spend; Taproot (bc1p) doesn't. The address checker tells you which type an address is.
  • Be wary of anyone selling a "quantum-safe" wallet or migration service. Never type a seed phrase or private key into a website.

Frequently asked questions

Can quantum computers break Bitcoin?

Not today. A large, error-corrected quantum computer running Shor's algorithm could derive private keys from visible public keys, which would put some coins at risk, but no such machine exists and its arrival date is unknown. Hash functions and mining are far less affected. BIPs 360 and 361 propose ways to prepare.

What is BIP 360 (P2MR)?

BIP 360 proposes Pay-to-Merkle-Root (P2MR), a SegWit version 2 output with bc1z addresses. It is like Taproot without the key path: the output commits only to the Merkle root of a script tree, so no public key is on chain until the coins are spent. That protects against long exposure quantum attacks, though not against attacks during the brief time a spend sits in the mempool.

Is Taproot more vulnerable to quantum computers?

For coins held long-term, yes in one respect: a Taproot (P2TR) output contains a public key, so it is exposed to long exposure attacks from the moment it is created, while P2WPKH or P2PKH outputs reveal the key only when spent. Taproot's authors argued that hashing gives weak protection overall, since keys are revealed at spend time and when addresses are reused.

Would BIP 361 freeze old coins?

BIP 361 proposes that, about five years after activation, ECDSA and Schnorr spends would also have to pass a quantum-safe rescue protocol, such as proving knowledge of a wallet's BIP 32 seed. Coins whose owners can't satisfy one, including P2PK outputs for which no rescue is known, could become unspendable. Whether that is acceptable is strongly debated.

Is Bitcoin mining at risk from quantum computers?

Much less than signatures. Grover's algorithm gives only a quadratic speedup for hash searches like SHA-256 mining, compared with the exponential speedup Shor's algorithm gives against elliptic curve keys. No BIP proposes changing Bitcoin's proof of work in response to quantum computing.

BIPs in this article

  • BIP 360: Pay-to-Merkle-Root (P2MR): Draft. Proposes a new output type, Pay-to-Merkle-Root, that works like Taproot but removes the option to spend directly with a single public key. Since only hashes are exposed until spending, coins in…
  • BIP 361: Post Quantum Migration and Legacy Signature Sunset: Draft. Outlines a phased plan, once a quantum-resistant address type exists, to retire today's signature types. First, sending coins to quantum-vulnerable addresses would be blocked; later, after a…
  • BIP 341: Taproot: SegWit version 1 spending rules: Deployed. Taproot introduces a new kind of Bitcoin output that can be spent either with a single signature or by revealing just one of many possible alternative spending conditions, kept hidden in a tree…
  • BIP 347: OP_CAT in Tapscript: Complete. Brings back OP_CAT, an instruction that joins two pieces of data together, which was disabled in Bitcoin's early days over security concerns. Re-enabled only inside Taproot scripts, this simple…
  • BIP 340: Schnorr Signatures for secp256k1: Deployed. Defines a standard for Schnorr signatures, a simpler and more flexible signing method than the ECDSA scheme Bitcoin originally used, on the same elliptic curve. Schnorr signatures are compact (64…
  • BIP 141 (SegWit): Segregated Witness (Consensus layer): Deployed. Defines Segregated Witness (SegWit), which moves signatures into a separate "witness" section of each transaction while remaining compatible with older nodes. This fixed transaction malleability,…
  • BIP 324: Version 2 P2P Encrypted Transport Protocol: Deployed. Introduces a new, encrypted way for Bitcoin nodes to talk to each other, so internet providers and passive observers cannot read or easily tamper with the traffic. It also slightly reduces bandwidth…
  • BIP 32 (HD wallets): Hierarchical Deterministic Wallets: Deployed. Defines hierarchical deterministic (HD) wallets, in which a single seed generates a whole tree of keys. Users can back up a wallet once and share watch-only parts, for example with a shop or…

Learn more

Guides

Free tools

Glossary