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

In the first part of this series, we explored the physics behind quantum computing and how it differs from classical computing. However, understanding the mechanics of quantum computing doesn't reveal how it can be used to steal bitcoin. To grasp this, we need to delve into the security mechanisms of bitcoin and identify the vulnerabilities that a quantum computer can exploit. This piece will examine bitcoin's encryption, the potential weaknesses, and the nine-minute window identified by Google's recent quantum computing paper. Bitcoin relies on elliptic curve cryptography to verify ownership. Each wallet has a private key, a 256-digit binary number, and a public key derived from it using a mathematical operation on the secp256k1 curve. The relationship between the private and public keys is a one-way function, making it easy to generate a public key from a private key but virtually impossible for classical computers to reverse the process. This one-way trapdoor is the foundation of bitcoin's security model. Your private key proves ownership, and your public key can be shared safely because classical computers cannot reverse the math. When sending bitcoin, your wallet uses the private key to create a digital signature, a mathematical proof that you know the secret number without revealing it. Shor's algorithm, discovered by mathematician Peter Shor in 1994, is a quantum algorithm that can break this trapdoor. It solves the discrete logarithm problem efficiently, which would take a classical computer longer than the universe has existed. The algorithm works by converting the problem into finding the period of a function, which is a task that quantum computers are well-suited for. By applying the function to all possible inputs simultaneously and using quantum operations like the Fourier transform, the algorithm can find the period and, subsequently, the private key. The attack utilizes all three quantum properties: superposition, entanglement, and interference. Although Shor's algorithm has been known for over 30 years, it requires a quantum computer with a large number of stable qubits to maintain coherence throughout the calculation. Google's recent paper reduced the estimated number of qubits needed from millions to fewer than 500,000. The team designed two quantum circuits that implement Shor's algorithm against bitcoin's elliptic curve, one using approximately 1,200 logical qubits and the other using approximately 1,450 logical qubits. The paper also introduced a practical attack scenario, where the quantum computer can precompute parts of the calculation and wait for a target public key to appear. Once the public key is visible, the machine only needs to finish the second half of the calculation, which Google estimates takes around nine minutes. This creates a narrow window 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. This mempool attack is alarming but requires a quantum computer that does not yet exist. A more significant concern is the 6.9 million bitcoin (approximately one-third of the total supply) sitting in wallets where the public key has already been exposed on the blockchain. These coins are vulnerable to an 'at-rest' attack, which can be carried out without racing against the clock. A quantum computer running Shor's algorithm can turn a bitcoin public key into the private key that controls the coins. For coins transacted since Taproot, the public key is already visible, while for coins in older addresses, the public key is hidden until spent, at which point the owner has roughly nine minutes before the attacker can catch up.