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 fundamental principles of quantum computing, explaining how it differs from classical computing. However, understanding the mechanics of quantum computing does not directly reveal how it can be exploited to steal bitcoin. To grasp this, one must comprehend what quantum computers are attacking and the inherent weaknesses in bitcoin's security framework. This piece begins by examining bitcoin's encryption methodology, which relies on elliptic curve cryptography to verify ownership. Each wallet possesses a pair of 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. This process can be thought of as a one-way map, where starting from a known point on the curve, one takes a series of steps defined by the curve's mathematics, with the number of steps being the private key, and the endpoint being the public key. Anyone can verify the public key, but determining the private key from it is virtually impossible for classical computers, as it involves solving the elliptic curve discrete logarithm problem, which is estimated to take longer than the age of the universe. However, in 1994, mathematician Peter Shor discovered a quantum algorithm that can efficiently solve this problem, thereby breaking the encryption. Shor's algorithm works by converting the problem into finding the period of a function, which represents the cycle of outputs when feeding sequential numbers into a function related to the elliptic curve. Quantum computers are uniquely suited for this task, as they can represent all possible inputs simultaneously in a superposition, apply the function to all of them at once, and then use a quantum operation called the Fourier transform to find the period, from which the private key can be derived. The reason bitcoin remains secure today is that implementing Shor's algorithm requires a quantum computer with a large number of stable qubits, which has been beyond current technological capabilities. However, a recent paper by Google significantly reduced the estimated number of qubits needed, from millions to fewer than 500,000, by designing quantum circuits that implement Shor's algorithm against bitcoin's specific elliptic curve. This development introduces a practical attack scenario where parts of the calculation can be precomputed, waiting for a target public key to appear. Once a public key is exposed, the quantum computer can finish the calculation in approximately nine minutes, which is close to the average time it takes for a bitcoin transaction to be confirmed. This means that if a user broadcasts a transaction, a quantum attacker has about nine minutes to derive the private key and submit a competing transaction, with a roughly 41% chance of succeeding before the original transaction confirms. Moreover, approximately 6.9 million bitcoin, whose public keys have already been exposed on the blockchain, are vulnerable to an 'at-rest' attack, where the attacker has unlimited time to derive the private key. The implications of these findings and the race to develop quantum-resistant cryptography are critical for the future security of bitcoin.