The Quantum Threat to Bitcoin: How a 9-Minute Window Can Compromise Your Cryptocurrency
This series previously explored the principles of quantum computing. However, understanding how it works is only half the story - to comprehend the threat it poses to bitcoin, one must also grasp how bitcoin's security functions and where its weaknesses lie. This piece delves into the mechanics of bitcoin's encryption, why a quantum algorithm can break it, and the significance of Google's recent research, which has altered the timeline for this risk. Bitcoin relies on a system called elliptic curve cryptography to establish ownership. Each wallet has a pair of keys: a private key, which is a secret number, and a public key derived from the private key through a mathematical operation on a specific curve. This relationship 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 hinges on this one-way trapdoor, with the private key serving as proof of ownership and the public key being safe to share. However, a quantum algorithm known as Shor's algorithm can efficiently solve the discrete logarithm problem, thereby breaking this trapdoor. Shor's algorithm works by converting the problem of finding a private key into one of finding the period of a function, which quantum computers can solve efficiently by representing all possible inputs simultaneously and applying a quantum operation called the Fourier transform. Despite Shor's algorithm being known for over 30 years, its application has been hindered by the requirement for a quantum computer with a large number of stable qubits. Recent research by Google has significantly reduced the estimated number of qubits needed, from millions to fewer than 500,000, making the threat more tangible. The study designed quantum circuits that implement Shor's algorithm against bitcoin's specific elliptic curve, requiring approximately 1,200 to 1,450 logical qubits. Because qubits lose their quantum state constantly, a large number of physical qubits are needed to maintain a smaller number of reliable logical qubits. Google's paper introduced a practical attack scenario where parts of Shor's algorithm 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. If a user broadcasts a transaction with their public key visible, an attacker has roughly nine minutes to derive the private key and submit a competing transaction, giving them a 41% chance of succeeding. More concerning is the vulnerability of the 6.9 million bitcoin (about one-third of the total supply) in wallets where the public key has been permanently exposed on the blockchain, as these coins are susceptible to an 'at-rest' attack that does not race against the clock. The implications of this vulnerability and the pace at which hardware is closing the gap will be explored in the next piece.