The Quantum Threat to Bitcoin: How Your Cryptocurrency Could be Stolen in Under 10 Minutes

In the first part of this series, we explored the fundamental principles of quantum computing. However, understanding how quantum computers work is only half the story - to comprehend the threat they pose to bitcoin, we need to delve into the specifics of bitcoin's security and where its weaknesses lie. This piece will examine bitcoin's encryption, the role of elliptic curve cryptography, and the nine-minute window of vulnerability identified by Google's recent research. Bitcoin's security relies on a system called elliptic curve cryptography, which utilizes a pair of keys: a private key and a public key. The public key is derived from the private key through a mathematical operation on a specific curve, creating a one-way map that allows for easy verification but makes it virtually impossible for classical computers to reverse-engineer the private key. This one-way function is the foundation of bitcoin's security model. However, in 1994, mathematician Peter Shor discovered a quantum algorithm that can efficiently break this encryption. Shor's algorithm leverages the principles of quantum computing, including superposition, entanglement, and interference, to solve the discrete logarithm problem that underlies elliptic curve cryptography. The algorithm works by converting the problem into finding the period of a function, which is a task well-suited to quantum computers. By applying the function to all possible inputs simultaneously and using the Fourier transform to filter out incorrect answers, the algorithm can quickly determine the private key. The attack utilizes all three quantum properties: superposition to evaluate the function on every possible input, entanglement to link the input and output, and interference to filter out noise. While Shor's algorithm has been known for over 30 years, its implementation has been hindered by the need for a large number of stable qubits to maintain coherence throughout the calculation. Recent research by Google has significantly reduced the estimated number of qubits required, from millions to fewer than 500,000. The study designed two quantum circuits that implement Shor's algorithm against bitcoin's specific elliptic curve, using approximately 1,200 and 1,450 logical qubits, respectively. The introduction of a practical attack scenario has changed the way we think about the threat. By precomputing parts of the algorithm that depend on the elliptic curve's fixed parameters, a quantum computer can be primed to finish the calculation quickly once a target public key appears. Google estimates that the second half of the calculation takes around nine minutes, which is roughly the same time as bitcoin's average block confirmation time. This creates a narrow window of opportunity for a quantum attacker to derive a private key and submit a competing transaction. The math gives the attacker a roughly 41% chance of succeeding before the original transaction confirms. While this 'mempool attack' is alarming, it requires a quantum computer that does not yet exist. A more pressing concern is the 6.9 million bitcoin (approximately one-third of the total supply) that are already vulnerable to an 'at-rest' attack, as their public keys have been permanently exposed on the blockchain. A quantum computer running Shor's algorithm can turn these public keys into private keys, giving the attacker control over the coins. The implications of this vulnerability and the rapid progress in quantum computing hardware will be explored in the next and final piece of this series.