The Quantum Threat to Bitcoin: How a Powerful Computer Can Steal Your Cryptocurrency in Under 10 Minutes

The first part of this series explored the fundamental principles of quantum computing, highlighting its distinction from classical computing. However, understanding the inner workings of a quantum computer is only half the story; the real concern lies in its potential application to compromise bitcoin's security. This piece will examine how bitcoin's encryption functions, the vulnerabilities that a quantum algorithm can exploit, and the significance of Google's recent quantum computing paper in relation to the timeline of such an attack. Bitcoin utilizes elliptic curve cryptography, a system that relies on the mathematical relationship between a private key and a public key. Each wallet has a unique pair of keys: a private key, which is a secret number, and a public key, which is derived from the private key through a specific mathematical operation on the 'secp256k1' curve. This relationship can be thought of as a one-way map, where it is straightforward to generate a public key from a private key but virtually impossible to reverse the process using classical computers. The security of bitcoin is rooted in this one-way function, as the private key serves as proof of ownership, and the public key can be safely shared without compromising the private key. However, the discovery of Shor's algorithm by mathematician Peter Shor in 1994 introduced a quantum algorithm capable of breaking this one-way trapdoor. Shor's algorithm efficiently solves the discrete logarithm problem, which is the core of elliptic curve cryptography, by leveraging the principles of quantum mechanics such as superposition, entanglement, and interference. The algorithm works by converting the problem of finding a private key into a problem of finding the period of a function, which is a task well-suited for quantum computers. Despite the existence of Shor's algorithm for over 30 years, its application has been hindered by the requirement for a large number of stable qubits to maintain coherence throughout the calculation. Recent research by Google's Quantum AI division, in collaboration with Ethereum Foundation researcher Justin Drake and Stanford cryptographer Dan Boneh, has significantly reduced the estimated number of qubits needed, from millions to fewer than 500,000. This breakthrough, combined with the design of quantum circuits that implement Shor's algorithm against bitcoin's specific elliptic curve, has substantial implications for the security of bitcoin. The introduction of a practical attack scenario, where parts of the calculation can be precomputed and the quantum computer can be primed to finish the calculation once a target public key appears, has changed the perspective on the quantum threat. Google's paper estimates that the time required to derive a private key from a public key, once the precomputation is done, is approximately nine minutes. Given that bitcoin's average block confirmation time is 10 minutes, this creates a narrow window for a quantum attacker to potentially steal funds. The attack, known as the 'mempool attack,' is alarming but requires a quantum computer that does not yet exist. A more pressing 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 compromised without any time constraint, as the attacker can take as long as needed to derive the private key. The practical implications of these findings, including which 6.9 million bitcoin are already exposed, the impact of Taproot on bitcoin's privacy, and how quickly the hardware is advancing towards making such an attack feasible, will be explored in the next and final piece of this series.