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

The first part of this series delved into the physics underlying quantum computing, explaining how these machines differ fundamentally from classical computers. However, understanding the mechanics of quantum computing doesn't directly reveal how it can be exploited to steal bitcoin. To grasp this, one must comprehend what quantum computers are attacking - the encryption that secures bitcoin - and where the vulnerabilities lie. This piece begins with an examination of bitcoin's encryption system, known as elliptic curve cryptography, which is used to verify ownership. Each bitcoin wallet has two keys: a private key, which is a secret 256-digit binary number, and a public key, derived from the private key through a mathematical operation on the 'secp256k1' curve. The process can be thought of as a one-way map, where starting from a known point on the curve, taking a certain number of steps (defined by your private key) leads to your public key. Anyone can verify that you've arrived at that public key, but figuring out the number of steps (your private key) is virtually impossible for classical computers. This one-way function is the backbone of bitcoin's security model. Your private key proves ownership, and your public key can be shared safely because classical computers cannot reverse the process. When sending bitcoin, your wallet uses the private key to create a digital signature, proving you know the secret without revealing it. However, a quantum algorithm discovered by Peter Shor in 1994 can efficiently break this encryption. Shor's algorithm solves the discrete logarithm problem, which would take a classical computer longer than the universe has existed, in what's known as polynomial time. The algorithm converts finding the private key into a problem of finding the period of a function related to the elliptic curve. By using quantum properties such as superposition, entanglement, and interference, a quantum computer can find this period, from which the private key can be easily derived. Despite Shor's algorithm being known for over 30 years, the reason bitcoin remains secure is that implementing this algorithm requires a quantum computer with a large number of stable qubits. Recent research by Google, in collaboration with Ethereum Foundation and Stanford cryptographer Dan Boneh, has significantly reduced the estimated number of qubits needed, from millions to fewer than 500,000. This reduction is crucial because it brings the threat of quantum computers to bitcoin closer to reality. The team designed quantum circuits that can run Shor's algorithm against bitcoin's elliptic curve, with estimates suggesting that the calculation could be completed in about nine minutes once a target public key is identified. This introduces a practical attack scenario where parts of the calculation can be precomputed, waiting for a target public key to appear. The nine-minute window is significant because it's just below bitcoin's average block confirmation time of 10 minutes, giving a quantum attacker a roughly 41% chance of deriving a private key and submitting a competing transaction 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 approximately 6.9 million bitcoin (about one-third of the total supply) that are already vulnerable to an 'at-rest' attack because their public keys have been permanently 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 using Shor's algorithm. The practical implications of this vulnerability, including which 6.9 million bitcoin are exposed and how Taproot, a privacy upgrade on Bitcoin, affects this, will be explored in the next part of this series.