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

The first part of this series explored the basics of quantum computing, but knowing how it works is not enough to understand its potential impact on bitcoin. To grasp this, it's essential to comprehend what quantum computers can attack and where the vulnerabilities lie in bitcoin's security. This piece begins with an examination of bitcoin's encryption system, which utilizes elliptic curve cryptography to verify ownership. Each wallet has a pair of keys: a private key, kept secret, 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 and taking a certain number of steps leads to a public key, but reversing this process to find the private key is virtually impossible for classical computers. The security of bitcoin relies on this one-way trapdoor, with private keys proving ownership and public keys being safe to share because classical computers cannot reverse the math. However, the discovery of Shor's algorithm by mathematician Peter Shor in 1994 introduced a quantum algorithm that can efficiently break this trapdoor. Shor's algorithm solves the discrete logarithm problem, which classical computers cannot, by converting it into finding the period of a function and utilizing quantum properties such as superposition, entanglement, and interference. Although Shor's algorithm has been known for over 30 years, its application has been hindered by the requirement for a quantum computer with a sufficient 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, along with the design of quantum circuits that implement Shor's algorithm against bitcoin's specific elliptic curve, brings the threat of quantum attacks closer to reality. The introduction of a practical attack scenario, where parts of the algorithm can be precomputed and the quantum computer can sit in a primed state waiting for a target public key, changes the dynamics of the threat. If a user broadcasts a transaction and their public key becomes visible, an attacker has roughly nine minutes to derive the private key and submit a competing transaction. This 'mempool attack' gives the attacker about a 41% chance of succeeding before the original transaction is confirmed. Moreover, approximately 6.9 million bitcoin, where the public key has been permanently exposed on the blockchain, are vulnerable to an 'at-rest' attack, which does not require racing against the clock. The implications of these findings and how they impact the security of bitcoin, especially in light of advancements in quantum computing hardware, will be explored in the next piece.