How Quantum Computing Threatens Bitcoin Security in Under 10 Minutes
This series previously explored the fundamentals of quantum computing. However, understanding the mechanics of quantum computers doesn't directly explain how they can be used to compromise Bitcoin security. To grasp this, it's essential to delve into the specifics of Bitcoin's encryption and where its vulnerabilities lie. This piece begins by examining Bitcoin's use of elliptic curve cryptography to verify ownership. Each wallet has 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 process can be thought of as a one-way map, where starting from a known point (generator point G), taking a certain number of steps defined by the curve's math leads to a public key (point K). Anyone can verify the public key, but determining the number of steps (the private key) is virtually impossible for classical computers. This is due to the elliptic curve discrete logarithm problem, which is estimated to take longer than the age of the universe to solve with current classical algorithms. The security of Bitcoin relies on this one-way trapdoor, where the private key is used to create digital signatures without revealing the secret number. However, Shor's algorithm, discovered in 1994, offers a quantum solution to the discrete logarithm problem, potentially breaking Bitcoin's encryption. The algorithm works by converting the problem into finding the period of a function related to the elliptic curve, which is efficiently solvable by a quantum computer due to its ability to represent all possible inputs simultaneously and apply the function to them at once. The period, once found, allows for the straightforward calculation of the private key. This process utilizes the principles of superposition, entanglement, and interference, showcasing the power of quantum computing over classical methods. 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 estimates by Google, in collaboration with researchers from the Ethereum Foundation and Stanford, have significantly reduced the number of qubits needed, from millions to fewer than 500,000. This reduction, along with the design of quantum circuits that can implement Shor's algorithm against Bitcoin's specific elliptic curve, brings the threat closer to reality. Google's paper introduced a practical attack scenario, highlighting that parts of Shor's algorithm can be precomputed, leaving a quantum computer in a primed state, ready to finish the calculation once a target public key is identified. This leads to a 'nine-minute window' for an attacker to derive a private key and submit a competing transaction before the original transaction confirms, given Bitcoin's average block confirmation time of 10 minutes. The vulnerability is not just theoretical; approximately 6.9 million Bitcoin, or one-third of the total supply, are at risk due to their public keys being exposed on the blockchain. For coins transacted since the Taproot upgrade, the public key is already visible, making them susceptible to an 'at-rest' attack. In contrast, older coins are vulnerable once their public key is exposed during a transaction, leaving a narrow window for the owner to secure their funds before an attacker can exploit the weakness.