The Quantum Threat to Bitcoin: How a Powerful Computer Can Steal Your Cryptocurrency in Under 10 Minutes
The first part of this series delved into the physics behind quantum computing, explaining how these machines differ fundamentally from classical computers. However, understanding the inner workings of a quantum computer does not directly reveal how it can be utilized to steal bitcoin. To comprehend this, it's essential to grasp what a quantum computer attacks and how the security of bitcoin is structured, including the specific vulnerabilities it exploits. This piece begins by examining bitcoin's encryption method, known as elliptic curve cryptography, which is used to verify ownership. Each bitcoin wallet has two keys: a private key, which is a secret number, and a public key, derived from the private key through a mathematical operation on the 'secp256k1' curve. The relationship between these keys 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 the curve's mathematics leads to the public key. However, determining the number of steps (the private key) from the public key is virtually impossible for classical computers due to the elliptic curve discrete logarithm problem. It's estimated that solving this problem for a 256-bit curve with the best-known classical algorithms would take longer than the age of the universe. The security model of bitcoin relies on this one-way trapdoor, where the private key proves ownership, and the public key can be safely shared without risking the disclosure of the private key. When sending bitcoin, the wallet uses the private key to create a digital signature, proving knowledge of the secret number without revealing it. Peter Shor's algorithm, discovered in 1994, provides a quantum approach to solving the discrete logarithm problem efficiently, thereby breaking the trapdoor. This algorithm converts the problem into finding the period of a function related to the elliptic curve, which quantum computers can solve by representing all possible inputs simultaneously (superposition), applying the function to all inputs at once, and then using the Fourier transform to reinforce correct answers while canceling out incorrect ones. The result is the period, from which the private key can be determined, allowing the theft of bitcoin. Shor's algorithm utilizes the three key properties of quantum computing: superposition, entanglement, and interference. Despite the algorithm being known for over 30 years, implementing it has been beyond reach due to the requirement for a large number of stable qubits. However, Google's recent paper reduced the estimated number of qubits needed from millions to fewer than 500,000, significantly lowering the barrier. The paper introduced a practical attack scenario where parts of the calculation can be precomputed, leaving the quantum computer in a primed state, ready to finish the calculation once a target public key appears. This reduces the time needed to derive a private key to about nine minutes, which is close to bitcoin's average block confirmation time of 10 minutes. This creates a 'mempool attack' scenario where an attacker has a roughly 41% chance of redirecting funds before the original transaction confirms. More concerning is the vulnerability of the 6.9 million bitcoin (about one-third of the total supply) that have had their public keys exposed on the blockchain, making them susceptible to an 'at-rest' attack that doesn't require racing against the clock. The implications of this vulnerability, the impact of Taproot on bitcoin privacy, and how the development of quantum hardware is narrowing the gap to making such attacks feasible will be discussed in the next part of this series.