How Quantum Computing Threatens Bitcoin Security in Under 10 Minutes
The first part of this series delved into the fundamentals of quantum computing, explaining how it differs from classical computing. However, understanding the mechanics of quantum computers doesn't necessarily reveal how they can be used to compromise bitcoin security. To grasp this, it's essential to comprehend what bitcoin's security is based on and where its weaknesses lie. This piece will dissect bitcoin's encryption, starting with its elliptic curve cryptography system, which relies on a one-way function to prove ownership. Each wallet has a private key, a 256-digit binary number, and a public key derived from it using a specific 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). While anyone can verify the public key, determining the number of steps (private key) taken to get there is virtually impossible for classical computers. This one-way function is the backbone of bitcoin's security model, with the private key serving as proof of ownership and the public key being safe to share. When sending bitcoin, the wallet uses the private key to create a digital signature, a mathematical proof of knowing the secret number without revealing it. However, Peter Shor's quantum algorithm, discovered in 1994, can efficiently solve the discrete logarithm problem, effectively breaking the one-way trapdoor. Shor's algorithm works by converting the problem into finding the period of a function, which quantum computers can solve using superposition, entanglement, and interference. Despite Shor's algorithm being known for over 30 years, its implementation has been hindered by the requirement for a large number of stable qubits. Recent estimates by Google have reduced the required number of qubits from millions to fewer than 500,000, making the threat more tangible. Google's paper introduced a practical attack scenario where parts of Shor's algorithm can be precomputed, allowing a quantum computer to be 'primed' and ready to attack once a target public key appears. The attack, known as the 'mempool attack,' gives the attacker roughly nine minutes to derive a private key and submit a competing transaction, with a 41% chance of succeeding before the original transaction confirms. Moreover, approximately 6.9 million bitcoin, or one-third of the total supply, are vulnerable to an 'at-rest' attack since their public keys have been exposed on the blockchain, making them susceptible to attack without any time constraint.