The Quantum Threat to Bitcoin: How a Powerful Computer Can Steal Your Cryptocurrency in Under 10 Minutes
This series previously explored the fundamental principles of quantum computing. However, grasping how a quantum computer operates does not immediately reveal its potential to compromise bitcoin security. To understand this threat, it's essential to delve into the specifics of bitcoin's encryption and identify the vulnerabilities that quantum algorithms can exploit. This article commences with an examination of bitcoin's encryption mechanism, 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. The relationship between these keys can be envisioned as a one-way map, where starting from a known point on the curve (the generator point G), taking a series of steps defined by the curve's mathematics leads to a public key. While it's straightforward to calculate the public key from the private key, reversing this process is virtually impossible for classical computers due to the elliptic curve discrete logarithm problem. This one-way function is the cornerstone of bitcoin's security model, ensuring that only the owner of the private key can prove ownership and transfer coins. The security of this system is based on the premise that reversing the mathematical operation to obtain the private key from the public key is computationally infeasible for classical computers. However, the discovery of Shor's algorithm by mathematician Peter Shor in 1994 introduced a quantum approach that can efficiently solve the discrete logarithm problem. This quantum algorithm exploits the properties of quantum mechanics, including superposition, entanglement, and interference, to find the period of a function related to the elliptic curve. Knowing this period allows for the immediate derivation of the private key, thus compromising the security of the bitcoin wallet. Despite Shor's algorithm being known for over 30 years, its application has been hindered by the requirement for a quantum computer with a sufficient number of stable qubits to maintain coherence throughout the calculation. Recent research by Google, in collaboration with the Ethereum Foundation and Stanford University, has significantly reduced the estimated number of qubits needed to run Shor's algorithm against bitcoin's elliptic curve, from millions to fewer than 500,000. This advancement introduces a practical attack scenario where parts of the algorithm can be precomputed, waiting for a target public key to appear. Upon identifying a target, the quantum computer can derive the private key within approximately nine minutes, which is close to the average block confirmation time of bitcoin. This timeline introduces a 'mempool attack' scenario where an attacker has a window of opportunity to redirect funds before the original transaction is confirmed. Furthermore, the research highlights that approximately 6.9 million bitcoin, or one-third of the total supply, are vulnerable to an 'at-rest' attack because their public keys have already been exposed on the blockchain. These coins can be compromised without a time constraint, posing a significant security risk. The implications of these findings and the evolving landscape of quantum computing's threat to bitcoin security will be explored in the next part of this series.