The Quantum Threat to Bitcoin: How Your Coins Can Be Stolen in Under 10 Minutes
The first part of this series explored the fundamental principles of quantum computing, distinguishing it from classical computing. However, understanding how quantum computers work is only half the story; the other half involves grasping what they can attack and how they can be used maliciously, such as stealing bitcoin. To comprehend the threat, we must first understand bitcoin's security framework, which relies on elliptic curve cryptography. Each bitcoin wallet has a private key, a secret 256-bit number, and a public key derived from the private key through a mathematical operation on the 'secp256k1' curve. This process is akin to a one-way map: easy to follow in one direction but virtually impossible to reverse with classical computers. The security model of bitcoin is based on this one-way trapdoor, where your private key proves ownership, and your public key is safe to share because it cannot be reversed to find the private key. When sending bitcoin, your wallet uses the private key to create a digital signature, proving you know the secret number without revealing it. However, Peter Shor's quantum algorithm, discovered in 1994, can break this trapdoor by efficiently solving the discrete logarithm problem that classical computers find insurmountable. The algorithm works by converting the problem into finding the period of a function related to the elliptic curve, a task quantum computers are particularly suited for due to their ability to represent multiple values simultaneously (superposition), correlate inputs and outputs (entanglement), and filter out incorrect answers (interference). Despite Shor's algorithm being known for over 30 years, the reason bitcoin remains secure is the requirement for a large number of stable qubits to run the algorithm, which has been beyond current technological capabilities. Google's recent paper significantly reduced the estimated number of qubits needed from millions to fewer than 500,000, a 20-fold reduction. The team designed quantum circuits that implement Shor's algorithm against bitcoin's specific elliptic curve, requiring approximately 1,200 to 1,450 logical qubits and tens of millions of Toffoli gates. Because qubits are prone to losing their quantum state, a significant portion of a quantum computer's infrastructure is dedicated to maintaining coherence and correcting errors. Google's research introduced a practical attack scenario where parts of Shor's algorithm can be precomputed, allowing the quantum computer to wait in a primed state for a target public key to appear. Once a public key is visible, the machine only needs to finish the second half of the calculation, which Google estimates takes about nine minutes. This timeline is alarming because it is close to bitcoin's average block confirmation time of 10 minutes, giving an attacker a 41% chance of deriving a private key and submitting a competing transaction before the original transaction confirms. The bigger concern is the approximately 6.9 million bitcoin (about one-third of the total supply) that are vulnerable to an 'at-rest' attack because their public keys have already been exposed on the blockchain. These coins can be targeted without racing against the clock, as the attacker can take as long as needed to derive the private key. In practice, this means a significant portion of bitcoin is at risk once a sufficiently powerful quantum computer is built, highlighting the urgent need for quantum-resistant cryptographic solutions.