Unlocking the Threat: How Quantum Computing Can Compromise Bitcoin Security in Under 10 Minutes
The first part of this series explored the fundamental principles of quantum computing. However, understanding how quantum computers work is only half the story; the other half involves grasping what they can attack and how. This part focuses on bitcoin's security framework, why a quantum algorithm poses a significant threat, and the recent developments that have altered the timeline of this threat. Bitcoin relies on elliptic curve cryptography, a system that utilizes a pair of keys: a private key, which is a secret 256-bit number, and a public key, derived from the private key through a mathematical operation on the 'secp256k1' curve. This relationship is akin to 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 is based on this one-way function, with the private key serving as proof of ownership and the public key being safe to share. When a transaction is made, the wallet uses the private key to create a digital signature, proving knowledge of the secret number without revealing it. However, the advent of Shor's algorithm, a quantum algorithm discovered by Peter Shor in 1994, changes this dynamic. Shor's algorithm efficiently solves the discrete logarithm problem, which is the backbone of bitcoin's security, by leveraging the principles of quantum mechanics. It converts the problem of finding a private key into finding the period of a function, which quantum computers can solve efficiently by applying the function to all possible inputs simultaneously and then filtering the results through a quantum Fourier transform. This process exploits the properties of superposition, entanglement, and interference, allowing the quantum computer to find the period and, from it, the private key. The reason bitcoin remains secure for now is that running Shor's algorithm requires a quantum computer with a sufficient number of stable qubits. Recent estimates by Google's Quantum AI division, 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 comes from designing quantum circuits that implement Shor's algorithm against bitcoin's specific elliptic curve more efficiently. The team proposed two circuits, one requiring approximately 1,200 logical qubits and the other 1,450, with the number of physical qubits needed being much higher due to the requirement for redundancy to maintain coherence. The introduction of a practical attack scenario by Google's paper is particularly noteworthy. It suggests that parts of Shor's algorithm can be precomputed for bitcoin's elliptic curve, allowing a quantum computer to be 'primed' and ready to attack the moment a target public key appears. This reduces the time needed to derive a private key from a public key to about nine minutes, which is alarmingly close to bitcoin's average block confirmation time of 10 minutes. This creates a 'mempool attack' scenario where an attacker has a roughly 41% chance of redirecting funds before the original transaction confirms. Moreover, approximately 6.9 million bitcoin, or one-third of the total supply, are in wallets where the public key has been permanently exposed on the blockchain, making them vulnerable to an 'at-rest' attack that does not require racing against the clock. The implications of these findings and the ongoing advancements in quantum computing hardware are critical for the future security of bitcoin.