The Quantum Threat to Bitcoin: How a Quantum Computer Can Steal Your Coins in Under 10 Minutes
The first part of this series delved into the physics behind quantum computing, but understanding how quantum computers work is only half the story. To grasp how they can be used to steal bitcoin, it's essential to know what they're attacking and where the weakness lies. This piece begins with an explanation of bitcoin's encryption, working through to the nine-minute window it takes to break it, as identified by Google's recent quantum computing paper. Bitcoin relies on elliptic curve cryptography, a system that uses 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 called 'secp256k1'. This creates a one-way map, where it's easy to go forward but virtually impossible for classical computers to reverse the process. However, a quantum algorithm known as Shor's algorithm can break this trapdoor, solving the discrete logarithm problem efficiently. Shor's algorithm works by converting the problem into finding the period of a function, which is exactly what quantum computers are designed for. The algorithm uses superposition to evaluate the function on all possible inputs simultaneously, applies a quantum operation called the Fourier transform to filter out wrong answers, and then recovers the private key. The reason bitcoin still exists despite the existence of Shor's algorithm for over 30 years is that running it requires a quantum computer with a large enough number of stable qubits. Google's paper reduced the estimated number of qubits needed from millions to fewer than 500,000, introducing a practical attack scenario that changes how to think about the threat. The parts of Shor's algorithm that depend on the elliptic curve's fixed parameters can be precomputed, allowing the quantum computer to sit in a primed state, waiting for a target public key to appear. Google estimates that the second half of the calculation takes about nine minutes, which is roughly the same time as bitcoin's average block confirmation time. This creates a 'mempool attack' scenario where an attacker has a 41% chance of deriving a private key and submitting a competing transaction before the original transaction confirms. The bigger concern is the 6.9 million bitcoin sitting in wallets where the public key has already been exposed on the blockchain, making them vulnerable to an 'at-rest' attack that requires no race against the clock.