The Quantum Threat to Bitcoin: How a Powerful Computer Can Steal Your Cryptocurrency in Under 10 Minutes

The first part of this series delved into the physics of quantum computing, explaining how these machines differ fundamentally from classical computers. However, understanding the inner workings of a quantum computer doesn't reveal how it can be used to steal bitcoin. To grasp this, one must comprehend what a quantum computer attacks and how bitcoin's security is structured, including its weaknesses. This piece begins with an examination of bitcoin's encryption, leading to the nine-minute window identified by Google's recent quantum computing paper as the time it takes to break it. Bitcoin utilizes elliptic curve cryptography to verify ownership. Each wallet has two 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. This process can be thought of as a one-way map, where starting from a known point (the generator point G), taking a certain number of steps defined by the curve's math leads to a public key. While anyone can verify the public key, determining the number of steps (the private key) is virtually impossible for classical computers due to the elliptic curve discrete logarithm problem. It's estimated that solving this with classical algorithms would take longer than the age of the universe. The security of bitcoin relies on this one-way trapdoor, with the private key proving ownership and the public key being safe to share because classical computers cannot reverse the math. When sending bitcoin, the wallet uses the private key to create a digital signature without revealing it. However, Shor's algorithm, discovered in 1994, breaks this trapdoor by solving the discrete logarithm problem efficiently, using quantum properties to find the period of a function related to the elliptic curve. This period allows for the immediate recovery of the private key. The process involves superposition, where the algorithm evaluates a function on all possible inputs simultaneously, entanglement, which links inputs and outputs, and interference, which filters out incorrect answers. Despite Shor's algorithm being known for over 30 years, running it requires a quantum computer with a large number of stable qubits, previously estimated to be in the millions. Google's recent paper reduced this estimate to fewer than 500,000 qubits, introducing two quantum circuits that implement Shor's algorithm against bitcoin's elliptic curve, requiring approximately 1,200 to 1,450 logical qubits and millions of Toffoli gates. A Toffoli gate acts on three qubits, with two control qubits affecting a target qubit. Due to qubit instability, hundreds of redundant qubits are needed to maintain a single reliable logical qubit, explaining the high ratio of physical to logical qubits in quantum computers. The paper also introduced a practical attack scenario, where parts of Shor's algorithm can be precomputed, allowing the quantum computer to sit in a primed state. Once a target public key appears, the machine only needs to finish the second half of the calculation, estimated to take about nine minutes. Given bitcoin's average block confirmation time of 10 minutes, an attacker has roughly nine minutes to derive a private key and submit a competing transaction. This gives the attacker a 41% chance of succeeding before the original transaction confirms. The bigger concern is the 6.9 million bitcoin already exposed on the blockchain, vulnerable to an 'at-rest' attack without a time constraint. A quantum computer running Shor's algorithm can turn a public key into a private key, controlling the coins. For coins transacted since the Taproot upgrade, the public key is already visible, while for older addresses, the public key is hidden until spent, giving the owner roughly nine minutes before an attacker can catch up.